[#46] services/ir: Add NeoFS LOCODE database to IR volumes

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-09 18:57:37 +03:00 committed by Alex Vanin
parent 210f8d222b
commit 635d1a0db0
5 changed files with 41 additions and 4 deletions

4
.env
View file

@ -24,3 +24,7 @@ HTTP_GW_IMAGE=nspccdev/neofs-http-gate
# S3 Gate
S3_GW_VERSION=0.14.2
S3_GW_IMAGE=nspccdev/neofs-s3-gate
# NeoFS LOCODE database
LOCODE_DB_URL=https://github.com/nspcc-dev/neofs-locode-db/releases/download/v0.1.0/locode_db.gz
#LOCODE_DB_PATH=/path/to/locode_db

View file

@ -26,3 +26,5 @@ NEOFS_IR_CONTRACTS_ALPHABET_ZHIVETE=3623a2094e5163a426edeee70eb11582764a771b
NEOFS_IR_MORPH_VALIDATORS=02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
NEOFS_IR_AUDIT_PDP_MAX_SLEEP_INTERVAL=100ms
NEOFS_IR_LOCODE_DB_PATH=/locode/db

20
services/ir/artifacts.mk Normal file
View file

@ -0,0 +1,20 @@
# Get NeoFS LOCODE database
LOCODE_DB_ARCHIVE_PATH=./vendor
LOCODE_DB_ARCHIVE_FILE=locode_db.gz
get.ir: LOCODE_DB_PATH?=
get.ir:
@mkdir -p ${LOCODE_DB_ARCHIVE_PATH}
ifeq (${LOCODE_DB_PATH},)
@echo "⇒ Download NeoFS LOCODE database from ${LOCODE_DB_URL}"
@curl \
-sSL "${LOCODE_DB_URL}" \
-o ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE}
else
@echo "⇒ Copy local archive of NeoFS LOCODE database from ${LOCODE_DB_PATH}"
@cp ${LOCODE_DB_PATH} ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE}
endif
gzip -dfk ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE}

View file

@ -17,6 +17,7 @@ services:
volumes:
- ./01.key:/01.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
env_file: [ ".env", ".ir.env" ]
environment:
- NEOFS_IR_KEY=/01.key
@ -34,6 +35,7 @@ services:
volumes:
- ./02.key:/02.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:
@ -52,6 +54,7 @@ services:
volumes:
- ./03.key:/03.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:
@ -70,6 +73,7 @@ services:
volumes:
- ./04.key:/04.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:
@ -88,6 +92,7 @@ services:
volumes:
- ./05.key:/05.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:
@ -106,6 +111,7 @@ services:
volumes:
- ./06.key:/06.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:
@ -124,6 +130,7 @@ services:
volumes:
- ./07.key:/07.key
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/locode_db:/locode/db
stop_signal: SIGKILL
env_file: [ ".env", ".ir.env" ]
environment:

View file

@ -22,7 +22,8 @@ services:
- NEOFS_NODE_KEY=/01.key
- NEOFS_NODE_ADDRESS=s01.${LOCAL_DOMAIN}:8080
- NEOFS_GRPC_ENDPOINT=s01.${LOCAL_DOMAIN}:8080
- NEOFS_NODE_ATTRIBUTE_0=/Location:Europe/Country:Russia/City:Moscow
- NEOFS_NODE_ATTRIBUTE_0=UN-LOCODE:RU MSK
- NEOFS_NODE_ATTRIBUTE_1=Price:22
storage02:
image: ${NODE_IMAGE}:${NODE_VERSION}
@ -44,7 +45,8 @@ services:
- NEOFS_NODE_KEY=/02.key
- NEOFS_NODE_ADDRESS=s02.${LOCAL_DOMAIN}:8080
- NEOFS_GRPC_ENDPOINT=s02.${LOCAL_DOMAIN}:8080
- NEOFS_NODE_ATTRIBUTE_0=/Location:Europe/Country:Russia/City:Saint-Petersburg
- NEOFS_NODE_ATTRIBUTE_0=UN-LOCODE:RU LED
- NEOFS_NODE_ATTRIBUTE_1=Price:33
storage03:
image: ${NODE_IMAGE}:${NODE_VERSION}
@ -66,7 +68,8 @@ services:
- NEOFS_NODE_KEY=/03.key
- NEOFS_NODE_ADDRESS=s03.${LOCAL_DOMAIN}:8080
- NEOFS_GRPC_ENDPOINT=s03.${LOCAL_DOMAIN}:8080
- NEOFS_NODE_ATTRIBUTE_0=/Location:Europe/Country:Sweden/City:Stockholm
- NEOFS_NODE_ATTRIBUTE_0=UN-LOCODE:SE STO
- NEOFS_NODE_ATTRIBUTE_1=Price:11
storage04:
image: ${NODE_IMAGE}:${NODE_VERSION}
@ -88,7 +91,8 @@ services:
- NEOFS_NODE_KEY=/04.key
- NEOFS_NODE_ADDRESS=s04.${LOCAL_DOMAIN}:8080
- NEOFS_GRPC_ENDPOINT=s04.${LOCAL_DOMAIN}:8080
- NEOFS_NODE_ATTRIBUTE_0=/Location:Europe/Country:Finalnd/City:Helsinki
- NEOFS_NODE_ATTRIBUTE_0=UN-LOCODE:FI HEL
- NEOFS_NODE_ATTRIBUTE_1=Price:44
volumes:
storage_s01: