From a0fdaebbf41d847badeac4e39961ef4cf95df3d0 Mon Sep 17 00:00:00 2001 From: Pavel Pogodaev Date: Fri, 25 Oct 2024 16:24:26 +0300 Subject: [PATCH] [#85] Add s3 lifecycler Signed-off-by: Pavel Pogodaev --- .env | 6 +++- .services | 1 + services/s3_lifecycler/.env | 1 + services/s3_lifecycler/.hosts | 1 + services/s3_lifecycler/.int_test.env | 1 + services/s3_lifecycler/cfg/config.yml | 42 +++++++++++++++++++++++ services/s3_lifecycler/docker-compose.yml | 38 ++++++++++++++++++++ services/s3_lifecycler/wallet.json | 30 ++++++++++++++++ 8 files changed, 119 insertions(+), 1 deletion(-) create mode 120000 services/s3_lifecycler/.env create mode 100644 services/s3_lifecycler/.hosts create mode 120000 services/s3_lifecycler/.int_test.env create mode 100644 services/s3_lifecycler/cfg/config.yml create mode 100644 services/s3_lifecycler/docker-compose.yml create mode 100644 services/s3_lifecycler/wallet.json diff --git a/.env b/.env index 6bb3728..a1a1586 100644 --- a/.env +++ b/.env @@ -28,9 +28,13 @@ REST_GW_VERSION=c9c85e90 REST_GW_IMAGE=truecloudlab/frostfs-rest-gw # S3 Gate -S3_GW_VERSION=0.30.4 +S3_GW_VERSION=0.31.0-rc.4 S3_GW_IMAGE=truecloudlab/frostfs-s3-gw +# Lifecycler +S3_LIFECYCLER_VERSION=0.1.3 +S3_LIFECYCLER_IMAGE=truecloudlab/frostfs-s3-lifecycler + # FrostFS LOCODE database LOCODE_DB_URL=https://git.frostfs.info/attachments/a2e8def7-52b6-49f1-89cd-a056712e8e54 #LOCODE_DB_PATH=/path/to/locode_db diff --git a/.services b/.services index d9f34c7..d165241 100644 --- a/.services +++ b/.services @@ -3,3 +3,4 @@ http_gate s3_gate rest_gate +s3_lifecycler diff --git a/services/s3_lifecycler/.env b/services/s3_lifecycler/.env new file mode 120000 index 0000000..c7360fb --- /dev/null +++ b/services/s3_lifecycler/.env @@ -0,0 +1 @@ +../../.env \ No newline at end of file diff --git a/services/s3_lifecycler/.hosts b/services/s3_lifecycler/.hosts new file mode 100644 index 0000000..8eb1796 --- /dev/null +++ b/services/s3_lifecycler/.hosts @@ -0,0 +1 @@ +IPV4_PREFIX.84 lifecycler.LOCAL_DOMAIN diff --git a/services/s3_lifecycler/.int_test.env b/services/s3_lifecycler/.int_test.env new file mode 120000 index 0000000..582b6a2 --- /dev/null +++ b/services/s3_lifecycler/.int_test.env @@ -0,0 +1 @@ +../../.int_test.env \ No newline at end of file diff --git a/services/s3_lifecycler/cfg/config.yml b/services/s3_lifecycler/cfg/config.yml new file mode 100644 index 0000000..2555980 --- /dev/null +++ b/services/s3_lifecycler/cfg/config.yml @@ -0,0 +1,42 @@ +logger: + level: debug + +prometheus: + enabled: true + address: :9090 + +lifecycle: + job_fetcher_buffer: 1000 + executor_pool_size: 100 + +frostfs: + stream_timeout: 10s + connect_timeout: 10s + healthcheck_timeout: 15s + rebalance_interval: 60s + pool_error_threshold: 100 + tree_pool_max_attempts: 4 + +credential: + use: wallets + source: + wallets: + - path: /wallet.json + address: NTt1rxvmEDxEuuogLxs2xgxA71qhVaUcN7 + passphrase: "cycle" + - path: /user-wallet.json + address: NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM + passphrase: "" + +morph: + reconnect_clients_interval: 30s + dial_timeout: 5s + contract: + netmap: netmap.frostfs + frostfsid: frostfsid.frostfs + container: container.frostfs + +# Wallet configuration +wallet: + path: /wallet.json # Path to wallet + passphrase: "cycle" # Passphrase to decrypt wallet diff --git a/services/s3_lifecycler/docker-compose.yml b/services/s3_lifecycler/docker-compose.yml new file mode 100644 index 0000000..3456d0c --- /dev/null +++ b/services/s3_lifecycler/docker-compose.yml @@ -0,0 +1,38 @@ +--- + +version: "2.4" +services: + s3_lifecycler: + image: ${S3_LIFECYCLER_IMAGE}:${S3_LIFECYCLER_VERSION} + domainname: ${LOCAL_DOMAIN} + hostname: s3_lifecycler + container_name: s3_lifecycler + restart: on-failure + networks: + s3_lifecycler_int: + internet: + ipv4_address: ${IPV4_PREFIX}.84 + volumes: + - ./wallet.json:/wallet.json + - ./../../vendor/hosts:/etc/hosts + - ./cfg:/etc/frostfs/s3-lifecycler + - ./../../wallets/wallet.json:/user-wallet.json + stop_signal: SIGKILL + env_file: [ ".env", ".int_test.env" ] + command: [ "frostfs-s3-lifecycler", "--config", "/etc/frostfs/s3-lifecycler/config.yml" ] + environment: + - S3_LIFECYCLER_MORPH_RPC_ENDPOINT_0_ADDRESS=ws://morph-chain:30333/ws + - S3_LIFECYCLER_FROSTFS_PEERS_0_ADDRESS=s01.${LOCAL_DOMAIN}:8080 + - S3_LIFECYCLER_FROSTFS_PEERS_0_WEIGHT=0.2 + - S3_LIFECYCLER_FROSTFS_PEERS_1_ADDRESS=s02.${LOCAL_DOMAIN}:8080 + - S3_LIFECYCLER_FROSTFS_PEERS_1_WEIGHT=0.2 + - S3_LIFECYCLER_FROSTFS_PEERS_2_ADDRESS=s03.${LOCAL_DOMAIN}:8080 + - S3_LIFECYCLER_FROSTFS_PEERS_2_WEIGHT=0.2 + - S3_LIFECYCLER_FROSTFS_PEERS_3_ADDRESS=s04.${LOCAL_DOMAIN}:8080 + - S3_LIFECYCLER_FROSTFS_PEERS_3_WEIGHT=0.2 + +networks: + s3_lifecycler_int: + internet: + external: true + name: basenet_internet diff --git a/services/s3_lifecycler/wallet.json b/services/s3_lifecycler/wallet.json new file mode 100644 index 0000000..ff8f34e --- /dev/null +++ b/services/s3_lifecycler/wallet.json @@ -0,0 +1,30 @@ +{ + "version": "1.0", + "accounts": [ + { + "address": "NTt1rxvmEDxEuuogLxs2xgxA71qhVaUcN7", + "key": "6PYR3XurAyTzVeDG5WV2Z8vnGdySw3mTLuKjr6Nwo7tae64SJ7XjZSMMPQ", + "label": "lifecycler", + "contract": { + "script": "DCED9z0M+WSGfXZGxYLj1yYwmgxJXE/kNA4+oWNi0q1uKCdBVuezJw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "isDefault": false + } + ], + "scrypt": { + "n": 16384, + "r": 8, + "p": 8 + }, + "extra": { + "Tokens": null + } +}