From 959d994ae58b971afa2ff97a28cacb352af67722 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 22 Sep 2020 11:47:39 +0300 Subject: [PATCH] Add local devenv domain Signed-off-by: Stanislav Bogatyrev --- .env | 15 ++--- Makefile | 15 +++-- services/basenet/.hosts | 2 +- services/basenet/docker-compose.yml | 4 +- services/chain/.hosts | 2 +- services/chain/artifacts.mk | 1 - services/chain/docker-compose.yml | 4 +- services/ir/.hosts | 11 ++-- services/ir/.ir.env | 8 +-- services/ir/05.key | Bin 0 -> 32 bytes services/ir/06.key | 1 + services/ir/07.key | 1 + services/ir/docker-compose.yml | 84 ++++++++++++++++++++++-- services/morph_chain/.hosts | 2 +- services/morph_chain/artifacts.mk | 1 - services/morph_chain/docker-compose.yml | 4 +- services/storage/.hosts | 8 +-- services/storage/.storage.env | 2 +- services/storage/docker-compose.yml | 42 ++++++++---- 19 files changed, 152 insertions(+), 55 deletions(-) create mode 100644 services/ir/05.key create mode 100644 services/ir/06.key create mode 100644 services/ir/07.key diff --git a/.env b/.env index 65b06d0..2083ddf 100644 --- a/.env +++ b/.env @@ -1,5 +1,6 @@ # Basenet settings -IPV4_PREFIX=192.168.123 +LOCAL_DOMAIN=neofs.devenv +IPV4_PREFIX=192.168.130 # NeoGo privnet CHAIN_URL="https://fs.neo.org/dist/devenv.gz" @@ -8,12 +9,10 @@ NEOGO_VERSION=0.91.0-6-gd7e13de5 # NeoGo sidechain MORPH_CHAIN_URL="https://fs.neo.org/dist/neo.morph.gz" -# NeoFS Services -NODE_VERSION=0.11.0-94-g163c1d2 -IR_VERSION=0.11.0-94-g163c1d2 - -# NeoFS Services Images -NODE_IMAGE=nspccdev/neofs-storage +# NeoFS Storage nodes +IR_VERSION=0.11.0-125-g336d72c IR_IMAGE=nspccdev/neofs-ir - +# NeoFS InnerRing nodes +NODE_VERSION=0.11.0-125-g336d72c +NODE_IMAGE=nspccdev/neofs-storage diff --git a/Makefile b/Makefile index ffdf6c9..339d5f2 100644 --- a/Makefile +++ b/Makefile @@ -42,19 +42,22 @@ rebuild: $(foreach SVC, $(BUILD_SVCS), build.$(SVC)) .PHONY: up up: get $(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) - @: # Stop environments .PHONY: down down: $(foreach SVC, $(STOP_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) - @: # Display changes for /etc/hosts .PHONY: hosts +.ONESHELL: hosts: - @for file in $(HOSTS_LINES); do \ - while read h; do \ - echo $${h} | sed 's|IPV4_PREFIX|$(IPV4_PREFIX)|g'; \ - done < $${file}; \ + @for file in $(HOSTS_LINES) + do + while read h + do + echo $${h} | \ + sed 's|IPV4_PREFIX|$(IPV4_PREFIX)|g' | \ + sed 's|LOCAL_DOMAIN|$(LOCAL_DOMAIN)|g' + done < $${file}; done diff --git a/services/basenet/.hosts b/services/basenet/.hosts index 5841629..7a55c3d 100644 --- a/services/basenet/.hosts +++ b/services/basenet/.hosts @@ -1 +1 @@ -IPV4_PREFIX.10 bastion.localtest.nspcc.ru +IPV4_PREFIX.10 bastion.LOCAL_DOMAIN diff --git a/services/basenet/docker-compose.yml b/services/basenet/docker-compose.yml index 5285b78..9272795 100644 --- a/services/basenet/docker-compose.yml +++ b/services/basenet/docker-compose.yml @@ -6,13 +6,13 @@ services: basenet: container_name: bastion image: debian:10 - domainname: localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} hostname: bastion command: ["/bin/sleep", "infinity"] restart: always stop_signal: SIGKILL environment: - - TZ=Europe/Moscow + - TZ=Etc/UTC networks: internet: ipv4_address: ${IPV4_PREFIX}.10 diff --git a/services/chain/.hosts b/services/chain/.hosts index ddec2ee..1668720 100644 --- a/services/chain/.hosts +++ b/services/chain/.hosts @@ -1 +1 @@ -IPV4_PREFIX.50 main_chain.localtest.nspcc.ru +IPV4_PREFIX.50 main_chain.LOCAL_DOMAIN diff --git a/services/chain/artifacts.mk b/services/chain/artifacts.mk index 9d61d81..997484d 100644 --- a/services/chain/artifacts.mk +++ b/services/chain/artifacts.mk @@ -1,4 +1,3 @@ -get.chain: JF_TOKEN?= get.chain: CHAIN_DUMP_NAME=devenv.dump. get.chain: CHAIN_PATH?= get.chain: diff --git a/services/chain/docker-compose.yml b/services/chain/docker-compose.yml index 225f749..64060a4 100644 --- a/services/chain/docker-compose.yml +++ b/services/chain/docker-compose.yml @@ -4,7 +4,9 @@ version: "2.4" services: neofs_main_chain: image: nspccdev/neo-go:${NEOGO_VERSION} - container_name: main_chain.localtest.nspcc.ru + container_name: main_chain + domainname: ${LOCAL_DOMAIN} + hostname: main_chain networks: chain_int: internet: diff --git a/services/ir/.hosts b/services/ir/.hosts index 3719e86..77d5bd3 100644 --- a/services/ir/.hosts +++ b/services/ir/.hosts @@ -1,4 +1,7 @@ -IPV4_PREFIX.61 m01.localtest.nspcc.ru -IPV4_PREFIX.62 m02.localtest.nspcc.ru -IPV4_PREFIX.63 m03.localtest.nspcc.ru -IPV4_PREFIX.64 m04.localtest.nspcc.ru +IPV4_PREFIX.61 ir01.LOCAL_DOMAIN +IPV4_PREFIX.62 ir02.LOCAL_DOMAIN +IPV4_PREFIX.63 ir03.LOCAL_DOMAIN +IPV4_PREFIX.64 ir04.LOCAL_DOMAIN +IPV4_PREFIX.65 ir05.LOCAL_DOMAIN +IPV4_PREFIX.66 ir06.LOCAL_DOMAIN +IPV4_PREFIX.67 ir07.LOCAL_DOMAIN diff --git a/services/ir/.ir.env b/services/ir/.ir.env index d944713..302463b 100644 --- a/services/ir/.ir.env +++ b/services/ir/.ir.env @@ -1,10 +1,10 @@ NEOFS_IR_LOGGER_LEVEL=debug NEOFS_IR_METRICS_ENABLED=true NEOFS_IR_PPROF_ENABLED=true -NEOFS_IR_MAINNET_ENDPOINT_CLIENT=http://main_chain.localtest.nspcc.ru:30333 -NEOFS_IR_MAINNET_ENDPOINT_NOTIFICATION=ws://main_chain.localtest.nspcc.ru:30333/ws -NEOFS_IR_MORPH_ENDPOINT_CLIENT=http://morph_chain.localtest.nspcc.ru:30333 -NEOFS_IR_MORPH_ENDPOINT_NOTIFICATION=ws://morph_chain.localtest.nspcc.ru:30333/ws +NEOFS_IR_MAINNET_ENDPOINT_CLIENT=http://main_chain:30333 +NEOFS_IR_MAINNET_ENDPOINT_NOTIFICATION=ws://main_chain:30333/ws +NEOFS_IR_MORPH_ENDPOINT_CLIENT=http://morph_chain:30333 +NEOFS_IR_MORPH_ENDPOINT_NOTIFICATION=ws://morph_chain:30333/ws NEOFS_IR_TIMERS_EPOCH=30s NEOFS_IR_CONTRACTS_NETMAP=f41ce4aceff0522ed6ce303c684fdddd690332a7 diff --git a/services/ir/05.key b/services/ir/05.key new file mode 100644 index 0000000000000000000000000000000000000000..9deadd53eefa8e45150aeb1aeefa149d5f4866f7 GIT binary patch literal 32 ocmb2#Ar|B%nltMfgQ&nYfy<)q5sX#;ZXQXVsmyvzN>=SS0KUl#D*ylh literal 0 HcmV?d00001 diff --git a/services/ir/06.key b/services/ir/06.key new file mode 100644 index 0000000..2ba2097 --- /dev/null +++ b/services/ir/06.key @@ -0,0 +1 @@ +“‹é"ˉE¢k±jšõ¼Îp<¿“¼²$â9;– \ No newline at end of file diff --git a/services/ir/07.key b/services/ir/07.key new file mode 100644 index 0000000..951daac --- /dev/null +++ b/services/ir/07.key @@ -0,0 +1 @@ +T£ ïm«pªU Õ%ÅKx+g–ÿÕºLe„½"-3r \ No newline at end of file diff --git a/services/ir/docker-compose.yml b/services/ir/docker-compose.yml index 2e2e10e..ec9ddf3 100644 --- a/services/ir/docker-compose.yml +++ b/services/ir/docker-compose.yml @@ -2,28 +2,36 @@ version: "2.4" services: - ir01: image: ${IR_IMAGE}:${IR_VERSION} - container_name: m01.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: ir01 + container_name: ir01 networks: ir_int: internet: ipv4_address: ${IPV4_PREFIX}.61 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./01.key:/01.key" ] env_file: [ ".env", ".ir.env" ] environment: - NEOFS_IR_KEY=/01.key - ir02: image: ${IR_IMAGE}:${IR_VERSION} - container_name: m02.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: ir02 + container_name: ir02 networks: ir_int: internet: ipv4_address: ${IPV4_PREFIX}.62 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./02.key:/02.key" ] env_file: [ ".env", ".ir.env" ] @@ -32,11 +40,16 @@ services: ir03: image: ${IR_IMAGE}:${IR_VERSION} - container_name: m03.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: ir03 + container_name: ir03 networks: ir_int: internet: ipv4_address: ${IPV4_PREFIX}.63 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./03.key:/03.key" ] env_file: [ ".env", ".ir.env" ] @@ -45,17 +58,76 @@ services: ir04: image: ${IR_IMAGE}:${IR_VERSION} - container_name: m04.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: ir04 + container_name: ir04 networks: ir_int: internet: ipv4_address: ${IPV4_PREFIX}.64 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./04.key:/04.key" ] env_file: [ ".env", ".ir.env" ] environment: - NEOFS_IR_KEY=/04.key + ir05: + image: ${IR_IMAGE}:${IR_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: ir05 + container_name: ir05 + networks: + ir_int: + internet: + ipv4_address: ${IPV4_PREFIX}.65 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" + stop_signal: SIGKILL + volumes: [ "./05.key:/05.key" ] + env_file: [ ".env", ".ir.env" ] + environment: + - NEOFS_IR_KEY=/05.key + + ir06: + image: ${IR_IMAGE}:${IR_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: ir06 + container_name: ir06 + networks: + ir_int: + internet: + ipv4_address: ${IPV4_PREFIX}.66 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" + stop_signal: SIGKILL + volumes: [ "./06.key:/06.key" ] + env_file: [ ".env", ".ir.env" ] + environment: + - NEOFS_IR_KEY=/06.key + + ir07: + image: ${IR_IMAGE}:${IR_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: ir07 + container_name: ir07 + networks: + ir_int: + internet: + ipv4_address: ${IPV4_PREFIX}.67 + extra_hosts: + - "main_chain:${IPV4_PREFIX}.50" + - "morph_chain:${IPV4_PREFIX}.90" + stop_signal: SIGKILL + volumes: [ "./07.key:/07.key" ] + env_file: [ ".env", ".ir.env" ] + environment: + - NEOFS_IR_KEY=/07.key + networks: ir_int: internet: diff --git a/services/morph_chain/.hosts b/services/morph_chain/.hosts index dc26515..8af39d3 100644 --- a/services/morph_chain/.hosts +++ b/services/morph_chain/.hosts @@ -1 +1 @@ -IPV4_PREFIX.90 morph_chain.localtest.nspcc.ru +IPV4_PREFIX.90 morph_chain.LOCAL_DOMAIN diff --git a/services/morph_chain/artifacts.mk b/services/morph_chain/artifacts.mk index 4535a7a..f2999a4 100644 --- a/services/morph_chain/artifacts.mk +++ b/services/morph_chain/artifacts.mk @@ -1,4 +1,3 @@ -get.morph_chain: JF_TOKEN?= get.morph_chain: MORPH_CHAIN_DUMP_NAME=neo.morph.dump. get.morph_chain: MORPH_CHAIN_PATH?= get.morph_chain: diff --git a/services/morph_chain/docker-compose.yml b/services/morph_chain/docker-compose.yml index d1d5b73..68354f1 100644 --- a/services/morph_chain/docker-compose.yml +++ b/services/morph_chain/docker-compose.yml @@ -4,7 +4,9 @@ version: "2.4" services: neofs_morph_chain: image: nspccdev/neo-go:${NEOGO_VERSION} - container_name: morph_chain.localtest.nspcc.ru + container_name: morph_chain + domainname: ${LOCAL_DOMAIN} + hostname: morph_chain networks: chain_int: internet: diff --git a/services/storage/.hosts b/services/storage/.hosts index 2ea6d3f..331af77 100644 --- a/services/storage/.hosts +++ b/services/storage/.hosts @@ -1,4 +1,4 @@ -IPV4_PREFIX.71 s01.localtest.nspcc.ru -IPV4_PREFIX.72 s02.localtest.nspcc.ru -IPV4_PREFIX.73 s03.localtest.nspcc.ru -IPV4_PREFIX.74 s04.localtest.nspcc.ru +IPV4_PREFIX.71 s01.LOCAL_DOMAIN +IPV4_PREFIX.72 s02.LOCAL_DOMAIN +IPV4_PREFIX.73 s03.LOCAL_DOMAIN +IPV4_PREFIX.74 s04.LOCAL_DOMAIN diff --git a/services/storage/.storage.env b/services/storage/.storage.env index 8afb965..e864b64 100644 --- a/services/storage/.storage.env +++ b/services/storage/.storage.env @@ -1,4 +1,4 @@ -NEOFS_MORPH_ENDPOINT=http://morph_chain.localtest.nspcc.ru:30333 +NEOFS_MORPH_ENDPOINT=http://morph_chain:30333 NEOFS_ACCOUNTING_SCRIPTHASH=39ff7eb35bb6357ebed9f244f2aa72e8e7557eaf NEOFS_CONTAINER_SCRIPTHASH=4a445a72c5dba72c0c4e4634cff86c48dfe2c396 diff --git a/services/storage/docker-compose.yml b/services/storage/docker-compose.yml index f3fd133..3e2629e 100644 --- a/services/storage/docker-compose.yml +++ b/services/storage/docker-compose.yml @@ -2,66 +2,82 @@ version: "2.4" services: - storage01: image: ${NODE_IMAGE}:${NODE_VERSION} - container_name: s01.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: s01 + container_name: s01 networks: storage_int: internet: ipv4_address: ${IPV4_PREFIX}.71 + extra_hosts: + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./01.key:/01.key" ] env_file: [ ".env", ".storage.env" ] environment: - NEOFS_NODE_KEY=/01.key - - NEOFS_NODE_ADDRESS=s01.localtest.nspcc.ru:8080 - - NEOFS_GRPC_ENDPOINT=s01.localtest.nspcc.ru:8080 + - NEOFS_NODE_ADDRESS=s01.${LOCAL_DOMAIN}:8080 + - NEOFS_GRPC_ENDPOINT=s01.${LOCAL_DOMAIN}:8080 storage02: image: ${NODE_IMAGE}:${NODE_VERSION} - container_name: s02.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: s02 + container_name: s02 + container_name: s02 networks: storage_int: internet: ipv4_address: ${IPV4_PREFIX}.72 + extra_hosts: + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./02.key:/02.key" ] env_file: [ ".env", ".storage.env" ] environment: - NEOFS_NODE_KEY=/02.key - - NEOFS_NODE_ADDRESS=s02.localtest.nspcc.ru:8080 - - NEOFS_GRPC_ENDPOINT=s02.localtest.nspcc.ru:8080 + - NEOFS_NODE_ADDRESS=s02.${LOCAL_DOMAIN}:8080 + - NEOFS_GRPC_ENDPOINT=s02.${LOCAL_DOMAIN}:8080 storage03: image: ${NODE_IMAGE}:${NODE_VERSION} - container_name: s03.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: s03 + container_name: s03 networks: storage_int: internet: ipv4_address: ${IPV4_PREFIX}.73 + extra_hosts: + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./03.key:/03.key" ] env_file: [ ".env", ".storage.env" ] environment: - NEOFS_NODE_KEY=/03.key - - NEOFS_NODE_ADDRESS=s03.localtest.nspcc.ru:8080 - - NEOFS_GRPC_ENDPOINT=s03.localtest.nspcc.ru:8080 + - NEOFS_NODE_ADDRESS=s03.${LOCAL_DOMAIN}:8080 + - NEOFS_GRPC_ENDPOINT=s03.${LOCAL_DOMAIN}:8080 storage04: image: ${NODE_IMAGE}:${NODE_VERSION} - container_name: s04.localtest.nspcc.ru + domainname: ${LOCAL_DOMAIN} + hostname: s04 + container_name: s04 networks: storage_int: internet: ipv4_address: ${IPV4_PREFIX}.74 + extra_hosts: + - "morph_chain:${IPV4_PREFIX}.90" stop_signal: SIGKILL volumes: [ "./04.key:/04.key" ] env_file: [ ".env", ".storage.env" ] environment: - NEOFS_NODE_KEY=/04.key - - NEOFS_NODE_ADDRESS=s04.localtest.nspcc.ru:8080 - - NEOFS_GRPC_ENDPOINT=s04.localtest.nspcc.ru:8080 + - NEOFS_NODE_ADDRESS=s04.${LOCAL_DOMAIN}:8080 + - NEOFS_GRPC_ENDPOINT=s04.${LOCAL_DOMAIN}:8080 networks: storage_int: