Compare commits

..

1 commit

Author SHA1 Message Date
81bdc3a775 [#91] Refine CODEOWNERS settings
All checks were successful
DCO action / DCO (pull_request) Successful in 8m32s
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-12-10 16:17:36 +03:00
21 changed files with 122 additions and 87 deletions

28
.env
View file

@ -8,24 +8,28 @@ BASTION_VERSION=10
BASTION_IMAGE=debian BASTION_IMAGE=debian
# NeoGo privnet # NeoGo privnet
NEOGO_VERSION=0.106.3 NEOGO_VERSION=0.104.0
NEOGO_IMAGE=nspccdev/neo-go NEOGO_IMAGE=nspccdev/neo-go
# FrostFS InnerRing nodes # FrostFS InnerRing nodes
IR_VERSION=0.45.0-rc.6 IR_VERSION=0.42.9
IR_IMAGE=git.frostfs.info/truecloudlab/frostfs-ir IR_IMAGE=git.frostfs.info/truecloudlab/frostfs-ir
# FrostFS Storage nodes # FrostFS Storage nodes
NODE_VERSION=0.45.0-rc.6 NODE_VERSION=0.42.9
NODE_IMAGE=git.frostfs.info/truecloudlab/frostfs-storage NODE_IMAGE=git.frostfs.info/truecloudlab/frostfs-storage
# HTTP Gate # HTTP Gate
HTTP_GW_VERSION=0.33.0-rc.3 HTTP_GW_VERSION=0.30.2
HTTP_GW_IMAGE=git.frostfs.info/truecloudlab/frostfs-http-gw HTTP_GW_IMAGE=truecloudlab/frostfs-http-gw
# REST Gate
REST_GW_VERSION=c9c85e90
REST_GW_IMAGE=truecloudlab/frostfs-rest-gw
# S3 Gate # S3 Gate
S3_GW_VERSION=0.33.0-rc.3 S3_GW_VERSION=0.31.0-rc.4
S3_GW_IMAGE=git.frostfs.info/truecloudlab/frostfs-s3-gw S3_GW_IMAGE=truecloudlab/frostfs-s3-gw
# Lifecycler # Lifecycler
S3_LIFECYCLER_VERSION=0.1.3 S3_LIFECYCLER_VERSION=0.1.3
@ -36,17 +40,17 @@ LOCODE_DB_URL=https://git.frostfs.info/attachments/a2e8def7-52b6-49f1-89cd-a0567
#LOCODE_DB_PATH=/path/to/locode_db #LOCODE_DB_PATH=/path/to/locode_db
# FrostFS CLI binary # FrostFS CLI binary
FROSTFS_CLI_VERSION=0.45.0-rc.6 FROSTFS_CLI_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v${NODE_VERSION}/frostfs-cli
FROSTFS_CLI_IMAGE=git.frostfs.info/truecloudlab/frostfs-cli
#FROSTFS_CLI_PATH=/path/to/frostfs-cli-binary #FROSTFS_CLI_PATH=/path/to/frostfs-cli-binary
# FrostFS ADM tool binary # FrostFS ADM tool binary
FROSTFS_ADM_VERSION=0.45.0-rc.6 FROSTFS_ADM_VERSION=498f9955ea
FROSTFS_ADM_IMAGE=git.frostfs.info/truecloudlab/frostfs-adm FROSTFS_ADM_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v${NODE_VERSION}/frostfs-adm
#FROSTFS_ADM_PATH=/path/to/frostfs-adm-binary #FROSTFS_ADM_PATH=/path/to/frostfs-adm-binary
# Compiled FrostFS Smart Contracts # Compiled FrostFS Smart Contracts
FROSTFS_CONTRACTS_URL=https://git.frostfs.info/TrueCloudLab/frostfs-contract/releases/download/v0.21.1/frostfs-contract-v0.21.1.tar.gz FROSTFS_CONTRACTS_VERSION=694daebb19
FROSTFS_CONTRACTS_URL=https://git.frostfs.info/TrueCloudLab/frostfs-contract/releases/download/v0.19.2/frostfs-contract-v0.19.2.tar.gz
#FROSTFS_CONTRACTS_PATH=/path/to/unpacked/frostfs-contracts-dir #FROSTFS_CONTRACTS_PATH=/path/to/unpacked/frostfs-contracts-dir
# Jaeger tracing # Jaeger tracing

View file

@ -2,4 +2,5 @@
# Will start from top to bottom and stop in reverse # Will start from top to bottom and stop in reverse
http_gate http_gate
s3_gate s3_gate
rest_gate
s3_lifecycler s3_lifecycler

View file

@ -58,8 +58,9 @@ get: $(foreach SVC, $(GET_SVCS), get.$(SVC))
# Start environment # Start environment
.PHONY: up .PHONY: up
up: up/basic up/pre-services up: up/basic
@$(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) @$(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d))
./vendor/frostfs-adm morph proxy-add-account --config frostfs-adm.yml --account=`docker container exec morph_chain neo-go wallet dump-keys -w /wallets/s3-wallet.json | head -1 | awk '{print $1}'` || die "Couldn't set s3-gw wallet as proxy wallet"
@echo "Full FrostFS Developer Environment is ready" @echo "Full FrostFS Developer Environment is ready"
# Build up FrostFS # Build up FrostFS
@ -72,8 +73,6 @@ up/basic: up/bootstrap
# Start bootstrap services # Start bootstrap services
.PHONY: up/bootstrap .PHONY: up/bootstrap
up/bootstrap: STORAGE_WALLETS = $(wildcard ./services/storage/wallet*.json)
up/bootstrap: STORAGE_ACCOUNTS = $(foreach wallet,$(STORAGE_WALLETS),$(shell docker container exec morph_chain neo-go wallet dump-keys -w /wallets/storage/$(notdir $(wallet)) | head -1 | awk '{print $$1}' ))
up/bootstrap: get vendor/hosts up/bootstrap: get vendor/hosts
@$(foreach SVC, $(START_BOOTSTRAP), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) @$(foreach SVC, $(START_BOOTSTRAP), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d))
@source ./bin/helper.sh @source ./bin/helper.sh
@ -82,16 +81,11 @@ up/bootstrap: get vendor/hosts
@./vendor/frostfs-adm --config frostfs-adm.yml morph \ @./vendor/frostfs-adm --config frostfs-adm.yml morph \
ape add-rule-chain --target-type namespace --target-name "" \ ape add-rule-chain --target-type namespace --target-name "" \
--rule 'allow Container.* *' --chain-id "allow_container_ops" --rule 'allow Container.* *' --chain-id "allow_container_ops"
@for f in ./services/storage/wallet*.json; do \
echo -e "Transfer GAS to storage wallets: $(foreach wallet,$(STORAGE_WALLETS),\n\t$(wallet))" echo "Transfer GAS to wallet $${f}" \
./vendor/frostfs-adm -c frostfs-adm.yml morph refill-gas \ && ./vendor/frostfs-adm -c frostfs-adm.yml morph refill-gas --storage-wallet $${f} --gas 10.0 \
$(foreach wallet,$(STORAGE_WALLETS),--storage-wallet $(wallet)) \ || die "Failed to transfer GAS to alphabet wallets"; \
--gas 10.0 \ done
|| die "Failed to transfer GAS to alphabet wallets"
echo -e "Register storage accounts in proxy contract: $(foreach account,$(STORAGE_ACCOUNTS),\n\t$(account))"
./vendor/frostfs-adm morph proxy-add-account --config frostfs-adm.yml \
$(foreach account,$(STORAGE_ACCOUNTS),--account=$(account)) \
|| die "Couldn't set storage allet as proxy wallet"
@echo "Create frostfsid subject for ./wallets/wallet.json"; \ @echo "Create frostfsid subject for ./wallets/wallet.json"; \
if [ -n "$$(./vendor/frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --namespace '')" ]; then \ if [ -n "$$(./vendor/frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --namespace '')" ]; then \
echo "Subject already exists"; \ echo "Subject already exists"; \
@ -103,31 +97,6 @@ up/bootstrap: get vendor/hosts
fi fi
echo "FrostFS sidechain environment is deployed" echo "FrostFS sidechain environment is deployed"
# Prepare to start services
.PHONY: up/pre-services
up/pre-services:
@source ./bin/helper.sh
@echo "Prepare storage for services"; \
if [ -z "$$(./vendor/frostfs-cli -c cli-cfg.yml container list)" ]; then \
subj_key=`docker container exec -it morph_chain neo-go wallet dump-keys -w /wallets/system-wallet.json | tail -1 | tr -d ' \r\n'` \
&& echo "Subject key: $${subj_key}" \
&& ./vendor/frostfs-adm -c frostfs-adm.yml morph frostfsid create-subject --namespace "" --subject-key $${subj_key} --subject-name system \
|| die "Failed to create subject for system wallet"; \
proxy_acc=`docker container exec -it morph_chain neo-go wallet dump-keys -w /wallets/s3-wallet.json | head -1 | cut -d" " -f1` \
&& echo "Proxy acc: $${proxy_acc}" \
&& ./vendor/frostfs-adm morph proxy-add-account --config frostfs-adm.yml --account=$${proxy_acc} || die "Failed to register S3 gateway as proxy acc"; \
cid=`./vendor/frostfs-cli -c cli-cfg.yml container create -p "REP 4" --nns-name "cors" --nns-zone "container" --await | grep CID | cut -d" " -f2` \
&& echo "CORS Container: $${cid}" \
&& ./vendor/frostfs-cli -c cli-cfg.yml ape-manager add --target-type container --target-name $${cid} --rule "allow Object.* *" || die "Failed to create CORS container"; \
cid=`./vendor/frostfs-cli -c cli-cfg.yml container create -p "REP 4" --nns-name "mfa" --nns-zone "container" --await | grep CID | cut -d" " -f2` \
&& echo "MFA Container: $${cid}" \
&& ./vendor/frostfs-cli -c cli-cfg.yml ape-manager add --target-type container --target-name $${cid} --rule "allow Object.* *" || die "Failed to create MFA container"
cid=`./vendor/frostfs-cli -c cli-cfg.yml container create -p "REP 4" --nns-name "website" --nns-zone "container" --await | grep CID | cut -d" " -f2` \
&& echo "Website configuration Container: $${cid}" \
&& ./vendor/frostfs-cli -c cli-cfg.yml ape-manager add --target-type container --target-name $${cid} --rule "allow Object.* *" || die "Failed to create Website configuration container"
fi
@echo "Storage is prepared";
# Build up certain service # Build up certain service
.PHONY: up/% .PHONY: up/%
up/%: get vendor/hosts up/%: get vendor/hosts
@ -188,7 +157,7 @@ clean:
vols=`docker-compose -f services/$${svc}/docker-compose.yml config --volumes` vols=`docker-compose -f services/$${svc}/docker-compose.yml config --volumes`
if [[ ! -z "$${vols}" ]]; then if [[ ! -z "$${vols}" ]]; then
for vol in $${vols}; do for vol in $${vols}; do
docker volume rm -f "$${svc}_$${vol}" docker volume rm -f "$${svc}_$${vol}" 2> /dev/null
done done
fi fi
done done

View file

@ -143,7 +143,7 @@ Registers user wallet and issues s3 credentials.
Usage and default parameter values: Usage and default parameter values:
```sh ```sh
make s3cred [password=""] [contract_password=s3] [wallet=""] [gate_public_key=0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf] make s3cred [password=""] [contract_password=s3] [wallet=/user_wallet.json] [gate_public_key=0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf]
``` ```
As soon as the storage node is in the network map (see above) you can generate S3 As soon as the storage node is in the network map (see above) you can generate S3
@ -159,9 +159,8 @@ $ make s3cred
"container_id": "EXArWh8x1zeHG3851s1RtoCo7dowxF6rhLGA15nbMffT" "container_id": "EXArWh8x1zeHG3851s1RtoCo7dowxF6rhLGA15nbMffT"
} }
``` ```
Running without any parameters results in defaults which are based on the private key from Running without any parameters will result in defaults which are based on the private key from
`/wallets/wallet.json` user wallet and `/wallet.json` contract wallet. `/user-wallet.json` file and `/wallet.json` contract wallet.
If `wallet` parameter is set, gate searches custom user wallet file in `/wallets` directory.
Now let's configure an S3 client (AWS CLI will be used as example): Now let's configure an S3 client (AWS CLI will be used as example):
@ -173,7 +172,7 @@ Default region name []: us-east-1
Default output format []: json Default output format []: json
``` ```
If you need to create credentials for different users, put user wallet to `wallets` dir and specify it via `wallet` parameter. If you need to create credentials for different users, put user wallets to `wallets` dir and specify them via `wallet` parameter.
Pass wallet password in `password` parameter if it's not default. The same is for `contract_wallet` and `gate_public_key` params. Pass wallet password in `password` parameter if it's not default. The same is for `contract_wallet` and `gate_public_key` params.
```sh ```sh

View file

@ -1,3 +0,0 @@
wallet: ./wallets/system-wallet.json
password: ""
rpc-endpoint: s01.frostfs.devenv:8080

View file

@ -4,15 +4,13 @@ A single-node N3 privnet deployment, running on
Contracts deployed: Contracts deployed:
- Alphabet (AZ) [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/alphabet) - Alphabet (AZ) [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/alphabet)
- Audit [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/audit)
- Balance [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/balance) - Balance [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/balance)
- Container [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/container) - Container [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/container)
- FrostFS [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/frostfs)
- FrostFSID [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/frostfsid)
- NNS [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/nns)
- Netmap [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/netmap) - Netmap [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/netmap)
- Policy [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/policy) - NeoFSID [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/neofsid)
- Processing [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/processing)
- Proxy [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/proxy) - Proxy [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/proxy)
- Reputation [contract](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/reputation)
RPC available at `http://morph-chain.frostfs.devenv:30333`. RPC available at `http://morph-chain.frostfs.devenv:30333`.

View file

@ -22,6 +22,3 @@ server:
wallet: wallet:
path: /wallet.json # Path to wallet path: /wallet.json # Path to wallet
passphrase: one # Passphrase to decrypt wallet passphrase: one # Passphrase to decrypt wallet
containers:
cors: cors.container

View file

@ -30,9 +30,11 @@ get.cli:
@mkdir -p ./vendor @mkdir -p ./vendor
ifeq (${FROSTFS_CLI_PATH},) ifeq (${FROSTFS_CLI_PATH},)
echo "⇒ Download FrostFS CLI binary from ${FROSTFS_CLI_IMAGE}:${FROSTFS_CLI_VERSION}" @echo "⇒ Download FrostFS CLI binary from ${FROSTFS_CLI_URL}"
$(shell docker cp `docker create --name tmp ${FROSTFS_CLI_IMAGE}:${FROSTFS_CLI_VERSION}`:/bin/frostfs-cli ${FROSTFS_CLI_FILE} && docker rm tmp >/dev/null) @curl \
chmod +x ${FROSTFS_CLI_FILE} -ksSL "${FROSTFS_CLI_URL}" \
-o ${FROSTFS_CLI_FILE}
@chmod +x ${FROSTFS_CLI_FILE}
else else
@echo "⇒ Copy local binary from ${FROSTFS_CLI_PATH}" @echo "⇒ Copy local binary from ${FROSTFS_CLI_PATH}"
@cp ${FROSTFS_CLI_PATH} ${FROSTFS_CLI_FILE} @cp ${FROSTFS_CLI_PATH} ${FROSTFS_CLI_FILE}

View file

@ -23,8 +23,8 @@ get.adm: FROSTFS_ADM_DEST=./vendor/frostfs-adm
get.adm: get.adm:
ifeq (${FROSTFS_ADM_PATH},) ifeq (${FROSTFS_ADM_PATH},)
@echo "⇒ Download FrostFS ADM binary from ${FROSTFS_ADM_IMAGE}:${FROSTFS_ADM_VERSION}" @echo "⇒ Download FrostFS ADM binary from ${FROSTFS_ADM_URL}"
$(shell docker cp `docker create --name tmp ${FROSTFS_ADM_IMAGE}:${FROSTFS_ADM_VERSION}`:/bin/frostfs-adm ${FROSTFS_ADM_DEST} && docker rm tmp >/dev/null) @curl -skSL ${FROSTFS_ADM_URL} -o ${FROSTFS_ADM_DEST}
@chmod +x ${FROSTFS_ADM_DEST} @chmod +x ${FROSTFS_ADM_DEST}
else else
@echo "⇒ Copy frostfs-adm binary from ${FROSTFS_ADM_PATH}" @echo "⇒ Copy frostfs-adm binary from ${FROSTFS_ADM_PATH}"

View file

@ -19,12 +19,7 @@ services:
- ./config.yml:/wallets/config.yml - ./config.yml:/wallets/config.yml
- ./../../vendor/hosts:/etc/hosts - ./../../vendor/hosts:/etc/hosts
- ./../../wallets/wallet.json:/wallets/wallet.json - ./../../wallets/wallet.json:/wallets/wallet.json
- ./../../wallets/system-wallet.json:/wallets/system-wallet.json
- ./../s3_gate/wallet.json:/wallets/s3-wallet.json - ./../s3_gate/wallet.json:/wallets/s3-wallet.json
- ./../storage/wallet01.json:/wallets/storage/wallet01.json
- ./../storage/wallet02.json:/wallets/storage/wallet02.json
- ./../storage/wallet03.json:/wallets/storage/wallet03.json
- ./../storage/wallet04.json:/wallets/storage/wallet04.json
- chains:/chains - chains:/chains
networks: networks:

View file

@ -11,7 +11,6 @@ ProtocolConfiguration:
VerifyTransactions: true VerifyTransactions: true
StateRootInHeader: true StateRootInHeader: true
P2PSigExtensions: true P2PSigExtensions: true
Hardforks: {}
ApplicationConfiguration: ApplicationConfiguration:
SkipBlockVerification: false SkipBlockVerification: false

1
services/rest_gate/.env Symbolic link
View file

@ -0,0 +1 @@
../../.env

View file

@ -0,0 +1 @@
IPV4_PREFIX.83 rest.LOCAL_DOMAIN

View file

@ -0,0 +1 @@
../../.int_test.env

View file

@ -0,0 +1,12 @@
prometheus:
enabled: true
address: :9090
server:
# The IP and port to listen on.
listen-address: 0.0.0.0:8090
# Wallet settings
wallet:
path: /wallet.json # Path to wallet
passphrase: one # Password to decrypt wallet

View file

@ -0,0 +1,32 @@
---
services:
rest_gate:
image: ${REST_GW_IMAGE}:${REST_GW_VERSION}
domainname: ${LOCAL_DOMAIN}
hostname: rest
container_name: rest_gate
restart: on-failure
networks:
rest_gate_int:
internet:
ipv4_address: ${IPV4_PREFIX}.83
volumes:
- ./wallet.json:/wallet.json
- ./../../vendor/hosts:/etc/hosts
- ./cfg:/etc/frostfs/rest
stop_signal: SIGTERM
stop_grace_period: 15s
env_file: [ ".env", ".int_test.env" ]
command: [ "frostfs-rest-gw", "--config", "/etc/frostfs/rest/config.yml" ]
environment:
- REST_GW_POOL_PEERS_0_ADDRESS=s01.${LOCAL_DOMAIN}:8080
- REST_GW_POOL_PEERS_1_ADDRESS=s02.${LOCAL_DOMAIN}:8080
- REST_GW_POOL_PEERS_2_ADDRESS=s03.${LOCAL_DOMAIN}:8080
- REST_GW_POOL_PEERS_3_ADDRESS=s04.${LOCAL_DOMAIN}:8080
networks:
rest_gate_int:
internet:
external: true
name: basenet_internet

View file

@ -0,0 +1,30 @@
{
"version": "3.0",
"accounts": [
{
"address": "NPFCqWHfi9ixCJRu7DABRbVfXRbkSEr9Vo",
"key": "6PYTAGjdaeicUDPqGv9mmgwb9kTwimWJJmmfNqJSDGH9qM79zSRcL9oHiB",
"label": "REST Gateway",
"contract": {
"script": "DCECcuPzZCZ2VyDsm2jKEOMnU6xEWO2bF1dvOvBWTDFYB1ZBVuezJw==",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
}
],
"scrypt": {
"n": 16384,
"r": 8,
"p": 8
},
"extra": {
"Tokens": null
}
}

View file

@ -47,8 +47,3 @@ frostfsid:
policy: policy:
enabled: false enabled: false
containers:
cors: cors.container
mfa: mfa.container
website: website.container

View file

@ -14,8 +14,10 @@ services:
volumes: volumes:
# Gate wallet # Gate wallet
- ./wallet.json:/wallet.json - ./wallet.json:/wallet.json
# Folder for custom user wallets # Custom user wallets
- ./../../wallets/:/wallets/ - ./wallets:/wallets
# Default user wallet
- ./../../wallets/wallet.json:/wallets/wallet.json
- ./tls.key:/tls.key - ./tls.key:/tls.key
- ./tls.crt:/tls.crt - ./tls.crt:/tls.crt
- ./../../vendor/hosts:/etc/hosts - ./../../vendor/hosts:/etc/hosts

View file

@ -1,5 +1,6 @@
--- ---
version: "2.4"
services: services:
s3_lifecycler: s3_lifecycler:
image: ${S3_LIFECYCLER_IMAGE}:${S3_LIFECYCLER_VERSION} image: ${S3_LIFECYCLER_IMAGE}:${S3_LIFECYCLER_VERSION}

View file

@ -1 +0,0 @@
{"version":"1.0","accounts":[{"address":"NQijiVKHbL22PfF2AJQukv1CX75itxgzht","key":"6PYQKrpme57VqaucxuF7dDoSZRRA8d94oatHcScqhiFBauCXQvFDaYwEWa","label":"","contract":{"script":"DCEDRdLtpFIWeYyI7doTKRhIl4qYjaybGDveTyGpbqjsLZNBVuezJw==","parameters":[{"name":"parameter0","type":"Signature"}],"deployed":false},"lock":false,"isDefault":false}],"scrypt":{"n":16384,"r":8,"p":8},"extra":{"Tokens":null}}