[#48] Add S3 Lifecycler

Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
Pavel Pogodaev 2024-11-05 14:26:32 +03:00
parent fcc4b84805
commit 9031da1b60
7 changed files with 101 additions and 0 deletions

View file

@ -4,6 +4,7 @@ ARG NEOGO_HUB_IMAGE=nspccdev/neo-go
ARG FROSTFS_CORE_TAG=0.42.15 ARG FROSTFS_CORE_TAG=0.42.15
ARG FROSTFS_HTTP_GATE_TAG=0.30.2 ARG FROSTFS_HTTP_GATE_TAG=0.30.2
ARG FROSTFS_S3_GATE_TAG=0.30.7 ARG FROSTFS_S3_GATE_TAG=0.30.7
ARG FROSTFS_S3_LIFECYCLER_TAG=0.1.3
ARG NEOGO_TAG=0.106.0 ARG NEOGO_TAG=0.106.0
FROM ${NEOGO_HUB_IMAGE}:${NEOGO_TAG} AS neo-go FROM ${NEOGO_HUB_IMAGE}:${NEOGO_TAG} AS neo-go
@ -13,6 +14,7 @@ FROM ${FROSTFS_HUB_IMAGE}-ir:${FROSTFS_CORE_TAG} AS frostfs-ir
FROM ${FROSTFS_HUB_IMAGE}-storage:${FROSTFS_CORE_TAG} AS frostfs-storage FROM ${FROSTFS_HUB_IMAGE}-storage:${FROSTFS_CORE_TAG} AS frostfs-storage
FROM ${FROSTFS_HUB_IMAGE}-s3-gw:${FROSTFS_S3_GATE_TAG} AS frostfs-s3-gw FROM ${FROSTFS_HUB_IMAGE}-s3-gw:${FROSTFS_S3_GATE_TAG} AS frostfs-s3-gw
FROM ${FROSTFS_HUB_IMAGE}-http-gw:${FROSTFS_HTTP_GATE_TAG} AS frostfs-http-gw FROM ${FROSTFS_HUB_IMAGE}-http-gw:${FROSTFS_HTTP_GATE_TAG} AS frostfs-http-gw
FROM ${FROSTFS_HUB_IMAGE}-s3-lifecycler:${FROSTFS_S3_LIFECYCLER_TAG} AS frostfs-s3-lifecycler
# Executable image # Executable image
FROM alpine AS frostfs-aio FROM alpine AS frostfs-aio
@ -34,6 +36,7 @@ COPY --from=frostfs-storage /bin/frostfs-node /usr/bin/frostfs-node
COPY --from=frostfs-s3-gw /bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw COPY --from=frostfs-s3-gw /bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw
COPY --from=frostfs-s3-gw /bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate COPY --from=frostfs-s3-gw /bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate
COPY --from=frostfs-http-gw /bin/frostfs-http-gw /usr/bin/frostfs-http-gw COPY --from=frostfs-http-gw /bin/frostfs-http-gw /usr/bin/frostfs-http-gw
COPY --from=frostfs-s3-lifecycler /bin/frostfs-s3-lifecycler /usr/bin/frostfs-s3-lifecycler
COPY ./adm/frostfs-adm.yml /config/frostfs-adm.yml COPY ./adm/frostfs-adm.yml /config/frostfs-adm.yml
COPY ./ir/cli-cfg.yaml /config/cli-cfg-ir.yaml COPY ./ir/cli-cfg.yaml /config/cli-cfg-ir.yaml
@ -45,6 +48,8 @@ COPY ./morph/node-wallet.json /config/node-wallet.json
COPY ./morph/node-config.yaml /config/node-config.yaml COPY ./morph/node-config.yaml /config/node-config.yaml
COPY ./http-gw/http-gw-config.yaml /config/http-gw-config.yaml COPY ./http-gw/http-gw-config.yaml /config/http-gw-config.yaml
COPY ./http-gw/http-gw-wallet.json /config/http-gw-wallet.json COPY ./http-gw/http-gw-wallet.json /config/http-gw-wallet.json
COPY ./s3-lifecycler/lc-user-wallet.json /config/lc-user-wallet.json
COPY ./s3-lifecycler/s3-lc-config.yaml /config/s3-lc-config.yaml
COPY ./s3-gw/rules.json /config/bearer-rules.json COPY ./s3-gw/rules.json /config/bearer-rules.json
COPY ./s3-gw/regions.json /config/regions.json COPY ./s3-gw/regions.json /config/regions.json
COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml

View file

@ -4,6 +4,7 @@ ARG NEOGO_HUB_IMAGE=nspccdev/neo-go
ARG FROSTFS_CORE_TAG=0.42.15 ARG FROSTFS_CORE_TAG=0.42.15
ARG FROSTFS_HTTP_GATE_TAG=0.30.2 ARG FROSTFS_HTTP_GATE_TAG=0.30.2
ARG FROSTFS_S3_GATE_TAG=0.30.7 ARG FROSTFS_S3_GATE_TAG=0.30.7
ARG FROSTFS_S3_LIFECYCLER_TAG=0.1.3
ARG NEOGO_TAG=0.106.0 ARG NEOGO_TAG=0.106.0
FROM ${NEOGO_HUB_IMAGE}:${NEOGO_TAG} AS neo-go FROM ${NEOGO_HUB_IMAGE}:${NEOGO_TAG} AS neo-go
@ -12,6 +13,7 @@ FROM ${FROSTFS_HUB_IMAGE}-cli:${FROSTFS_CORE_TAG} AS frostfs-cli
FROM ${FROSTFS_HUB_IMAGE}-ir:${FROSTFS_CORE_TAG} AS frostfs-ir FROM ${FROSTFS_HUB_IMAGE}-ir:${FROSTFS_CORE_TAG} AS frostfs-ir
FROM ${FROSTFS_HUB_IMAGE}-storage:${FROSTFS_CORE_TAG} AS frostfs-storage FROM ${FROSTFS_HUB_IMAGE}-storage:${FROSTFS_CORE_TAG} AS frostfs-storage
FROM ${FROSTFS_HUB_IMAGE}-s3-gw:${FROSTFS_S3_GATE_TAG} AS frostfs-s3-gw FROM ${FROSTFS_HUB_IMAGE}-s3-gw:${FROSTFS_S3_GATE_TAG} AS frostfs-s3-gw
FROM ${FROSTFS_HUB_IMAGE}-s3-lifecycler:${FROSTFS_S3_LIFECYCLER_TAG} AS frostfs-s3-lifecycler
FROM ${FROSTFS_HUB_IMAGE}-http-gw:${FROSTFS_HTTP_GATE_TAG} AS frostfs-http-gw FROM ${FROSTFS_HUB_IMAGE}-http-gw:${FROSTFS_HTTP_GATE_TAG} AS frostfs-http-gw
# Executable image # Executable image
@ -32,6 +34,7 @@ COPY --from=frostfs-cli /bin/frostfs-cli /usr/bin/frostfs-cli
COPY --from=frostfs-ir /bin/frostfs-ir /usr/bin/frostfs-ir COPY --from=frostfs-ir /bin/frostfs-ir /usr/bin/frostfs-ir
COPY --from=frostfs-storage /bin/frostfs-node /usr/bin/frostfs-node COPY --from=frostfs-storage /bin/frostfs-node /usr/bin/frostfs-node
COPY --from=frostfs-s3-gw /bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw COPY --from=frostfs-s3-gw /bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw
COPY --from=frostfs-s3-lifecycler /bin/frostfs-s3-lifecycler /usr/bin/frostfs-s3-lifecycler
COPY --from=frostfs-s3-gw /bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate COPY --from=frostfs-s3-gw /bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate
COPY --from=frostfs-http-gw /bin/frostfs-http-gw /usr/bin/frostfs-http-gw COPY --from=frostfs-http-gw /bin/frostfs-http-gw /usr/bin/frostfs-http-gw
@ -50,6 +53,8 @@ COPY ./s3-gw/regions.json /config/regions.json
COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml
COPY ./s3-gw/s3-gw-wallet.json /config/s3-gw-wallet.json COPY ./s3-gw/s3-gw-wallet.json /config/s3-gw-wallet.json
COPY ./s3-gw/user-wallet.json /config/user-wallet.json COPY ./s3-gw/user-wallet.json /config/user-wallet.json
COPY ./s3-lifecycler/s3-lc-config.yaml /config/s3-lc-config.yaml
COPY ./s3-lifecycler/lc-user-wallet.json /config/lc-user-wallet.json
COPY ./sn/cli-cfg.yaml /config/cli-cfg-sn.yaml COPY ./sn/cli-cfg.yaml /config/cli-cfg-sn.yaml
COPY ./sn/wallet.json /config/wallet-sn.json COPY ./sn/wallet.json /config/wallet-sn.json
COPY ./sn/config.yaml /config/config-sn.yaml COPY ./sn/config.yaml /config/config-sn.yaml

View file

@ -19,6 +19,7 @@ COPY ./bin/frostfs-s3-gw /usr/bin/frostfs-s3-gw
COPY ./bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate COPY ./bin/frostfs-s3-authmate /usr/bin/frostfs-s3-authmate
COPY ./bin/frostfs-http-gw /usr/bin/frostfs-http-gw COPY ./bin/frostfs-http-gw /usr/bin/frostfs-http-gw
COPY ./bin/issue-creds.sh /usr/bin/issue-creds.sh COPY ./bin/issue-creds.sh /usr/bin/issue-creds.sh
COPY ./bin/frostfs-s3-lifecycler /usr/bin/frostfs-s3-lifecycler
COPY ./adm/frostfs-adm.yml /config/frostfs-adm.yml COPY ./adm/frostfs-adm.yml /config/frostfs-adm.yml
COPY ./ir/cli-cfg.yaml /config/cli-cfg-ir.yaml COPY ./ir/cli-cfg.yaml /config/cli-cfg-ir.yaml
@ -35,6 +36,8 @@ COPY ./s3-gw/regions.json /config/regions.json
COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml COPY ./s3-gw/s3-gw-config.yaml /config/s3-gw-config.yaml
COPY ./s3-gw/s3-gw-wallet.json /config/s3-gw-wallet.json COPY ./s3-gw/s3-gw-wallet.json /config/s3-gw-wallet.json
COPY ./s3-gw/user-wallet.json /config/user-wallet.json COPY ./s3-gw/user-wallet.json /config/user-wallet.json
COPY ./s3-lifecycler/s3-lc-config.yaml /config/s3-lc-config.yaml
COPY ./s3-lifecycler/lc-user-wallet.json /config/lc-user-wallet.json
COPY ./sn/cli-cfg.yaml /config/cli-cfg-sn.yaml COPY ./sn/cli-cfg.yaml /config/cli-cfg-sn.yaml
COPY ./sn/wallet.json /config/wallet-sn.json COPY ./sn/wallet.json /config/wallet-sn.json
COPY ./sn/config.yaml /config/config-sn.yaml COPY ./sn/config.yaml /config/config-sn.yaml

View file

@ -11,6 +11,7 @@ files for:
- frostfs-s3-gw - frostfs-s3-gw
- frostfs-s3-authmate - frostfs-s3-authmate
- frostfs-http-gw - frostfs-http-gw
- frostfs-s3-lifecycler
Entrypoint script starts blockchain, inner ring, storage, s3, and http gateway Entrypoint script starts blockchain, inner ring, storage, s3, and http gateway
services and configures it in the initial start. services and configures it in the initial start.
@ -117,6 +118,7 @@ Put all the needed pre-built binaries to the `frostfs-aio/bin/`:
- frostfs-s3-gw - frostfs-s3-gw
- frostfs-s3-authmate - frostfs-s3-authmate
- frostfs-http-gw - frostfs-http-gw
- frostfs-s3-lifecycler
Make sure they all have the `x` right for the execution enabled. Make sure they all have the `x` right for the execution enabled.
Build frostfs-aio image using pre-built local binaries for all the services. Build frostfs-aio image using pre-built local binaries for all the services.

View file

@ -66,6 +66,7 @@ runServices() {
done done
/usr/bin/frostfs-s3-gw --config /config/s3-gw-config.yaml |& tee -a ${LOG_DIR}/frostfs-s3-gw & /usr/bin/frostfs-s3-gw --config /config/s3-gw-config.yaml |& tee -a ${LOG_DIR}/frostfs-s3-gw &
/usr/bin/frostfs-s3-lifecycler --config /config/s3-lc-config.yaml |& tee -a ${LOG_DIR}/frostfs-s3-lifecycler &
/usr/bin/frostfs-http-gw --config /config/http-gw-config.yaml |& tee -a ${LOG_DIR}/frostfs-http-gw & /usr/bin/frostfs-http-gw --config /config/http-gw-config.yaml |& tee -a ${LOG_DIR}/frostfs-http-gw &
} }

View file

@ -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
}
}

View file

@ -0,0 +1,55 @@
# Wallet address, path to the wallet must be set as cli parameter or environment variable
wallet:
path: /config/lc-user-wallet.json # Path to wallet
address: NTt1rxvmEDxEuuogLxs2xgxA71qhVaUcN7 # Account address. If omitted default one will be used.
passphrase: "cycle" # Passphrase to decrypt wallet. If you're using a wallet without a password, place '' here.
logger:
level: debug # Log level.
destination: stdout # Logging destination.
sampling:
enabled: false
initial: 100
thereafter: 100
interval: 1s
morph:
rpc_endpoint:
- address: ws://localhost:30333/ws
priority: 1
reconnect_clients_interval: 30s
dial_timeout: 5s
contract:
netmap: netmap.frostfs
frostfsid: frostfsid.frostfs
container: container.frostfs
credential:
use: wallets
source:
wallets:
- path: /config/lc-user-wallet.json
address: NTt1rxvmEDxEuuogLxs2xgxA71qhVaUcN7
passphrase: "cycle"
- path: /config/user-wallet.json
address: NWeByJPgNC97F83hTUnSbnZSBKaFvk5HNw
passphrase: ""
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
peers:
0:
address: localhost:8080
priority: 1
weight: 1