2023-05-15 11:22:33 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
include .env
|
|
|
|
include help.mk
|
|
|
|
|
|
|
|
# Common variables
|
|
|
|
REPO=$(notdir $(shell pwd))
|
|
|
|
VERSION ?= "$(shell git describe --tags --match "v*" 2>/dev/null || git rev-parse --short HEAD | sed 's/^v//')"
|
|
|
|
|
|
|
|
# Variables for docker
|
|
|
|
NEOGO_HUB_IMAGE ?= "nspccdev/neo-go"
|
|
|
|
NEOGO_HUB_TAG ?= "0.101.1"
|
|
|
|
FROSTFS_HUB_IMAGE ?= "truecloudlab/frostfs"
|
2023-07-13 16:02:09 +00:00
|
|
|
FROSTFS_CORE_TAG ?= "0.36.0"
|
|
|
|
FROSTFS_GATES_TAG ?= "0.27.0"
|
2023-05-15 11:22:33 +00:00
|
|
|
AIO_IMAGE ?= "truecloudlab/frostfs-aio"
|
|
|
|
|
2023-05-18 13:39:29 +00:00
|
|
|
# Variables for compose
|
2023-06-22 13:26:01 +00:00
|
|
|
COMPOSE_CMD_UP ?= docker-compose up -d
|
|
|
|
COMPOSE_CMD_DOWN ?= docker-compose down
|
|
|
|
|
2023-05-18 13:39:29 +00:00
|
|
|
COMPOSE_V2 = "$(shell docker compose version --short | grep -q '^2' && echo true)"
|
|
|
|
ifeq ($(COMPOSE_V2), "true")
|
2023-06-22 13:26:01 +00:00
|
|
|
COMPOSE_CMD_UP = docker compose up -d --wait
|
|
|
|
COMPOSE_CMD_DOWN = docker compose down
|
2023-05-18 13:39:29 +00:00
|
|
|
endif
|
|
|
|
|
2023-05-15 11:22:33 +00:00
|
|
|
# Variables for S3
|
|
|
|
S3_BEARER_RULES ?= "/config/bearer-rules.json"
|
|
|
|
S3_GATE_PUBLIC_KEY ?= "0312fe65b101565de74eedf477afb43417ff5f795732506cfddc8e044c5a030d76"
|
|
|
|
|
|
|
|
# Build aio Docker image
|
|
|
|
image-aio:
|
2023-07-17 14:34:13 +00:00
|
|
|
@echo "⇒ Build aio docker image"
|
2023-05-15 11:22:33 +00:00
|
|
|
@docker build \
|
|
|
|
--rm \
|
|
|
|
--build-arg FROSTFS_HUB_IMAGE=$(FROSTFS_HUB_IMAGE) \
|
|
|
|
--build-arg FROSTFS_CORE_TAG=$(FROSTFS_CORE_TAG) \
|
|
|
|
--build-arg FROSTFS_GATES_TAG=$(FROSTFS_GATES_TAG) \
|
|
|
|
--build-arg NEOGO_HUB_IMAGE=$(NEOGO_HUB_IMAGE) \
|
|
|
|
--build-arg NEOGO_TAG=$(NEOGO_HUB_TAG) \
|
|
|
|
-f Dockerfile \
|
|
|
|
-t $(AIO_IMAGE):$(AIO_VERSION) .
|
|
|
|
|
2023-07-17 14:34:13 +00:00
|
|
|
# Build aio Docker image from all local pre-built binaries
|
|
|
|
image-aio-local:
|
|
|
|
@echo "⇒ Build aio docker image from all local pre-built binaries"
|
|
|
|
@docker build \
|
|
|
|
--rm \
|
|
|
|
-f Dockerfile.local \
|
|
|
|
-t $(AIO_IMAGE):$(AIO_VERSION) .
|
|
|
|
|
2023-08-21 13:51:32 +00:00
|
|
|
# Build aio Docker image with custom binaries
|
|
|
|
image-aio-custom:
|
|
|
|
@echo "⇒ Build aio Docker image with custom binaries"
|
|
|
|
@docker build \
|
|
|
|
--rm \
|
|
|
|
-f Dockerfile.custom \
|
|
|
|
-t $(AIO_IMAGE):$(AIO_VERSION) .
|
|
|
|
|
2023-05-15 11:22:33 +00:00
|
|
|
# Start AIO
|
|
|
|
up:
|
2023-06-22 13:26:01 +00:00
|
|
|
@$(COMPOSE_CMD_UP)
|
2023-05-15 11:22:33 +00:00
|
|
|
|
|
|
|
# Stop AIO
|
|
|
|
down:
|
2023-06-22 13:26:01 +00:00
|
|
|
@$(COMPOSE_CMD_DOWN)
|
2023-05-15 11:22:33 +00:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
clean:
|
2023-06-22 13:26:01 +00:00
|
|
|
@$(COMPOSE_CMD_DOWN) --volumes
|
2023-05-15 11:22:33 +00:00
|
|
|
|
|
|
|
# Generate S3 credentials
|
|
|
|
s3cred:
|
|
|
|
@docker exec aio /usr/bin/frostfs-s3-authmate issue-secret \
|
|
|
|
--wallet /config/user-wallet.json \
|
|
|
|
--peer localhost:8080 \
|
|
|
|
--gate-public-key $(S3_GATE_PUBLIC_KEY) \
|
|
|
|
--container-placement-policy "REP 1" \
|
2023-07-27 16:41:23 +00:00
|
|
|
--bearer-rules $(S3_BEARER_RULES)
|
|
|
|
|
|
|
|
# Generate S3 credentials based on imported wallets
|
|
|
|
s3cred-custom:
|
|
|
|
@docker exec aio /usr/bin/frostfs-s3-authmate issue-secret \
|
|
|
|
--wallet /wallets/$(wallet) \
|
|
|
|
--peer localhost:8080 \
|
|
|
|
--gate-public-key $(S3_GATE_PUBLIC_KEY) \
|
|
|
|
--container-placement-policy "REP 1" \
|
|
|
|
--bearer-rules $(S3_BEARER_RULES)
|
|
|
|
|
2023-10-30 15:00:07 +00:00
|
|
|
enable-oracle:
|
|
|
|
@docker exec aio neo-go contract invokefunction -r http://localhost:30333 \
|
|
|
|
--wallet-config /config/node-config.yaml \
|
|
|
|
--out /config/tx.json 49cf4e5378ffcd4dec034fd98a174c5491e395e2 designateAsRole \
|
|
|
|
int:8 [ bytes:02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 ] \
|
|
|
|
-- NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP
|
|
|
|
@docker exec aio neo-go wallet sign --in /config/tx.json \
|
|
|
|
-r http://localhost:30333 \
|
|
|
|
--wallet-config /config/node-config.yaml \
|
|
|
|
-a NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP
|
|
|
|
|
2023-05-15 11:22:33 +00:00
|
|
|
# Tick new epoch in side chain
|
|
|
|
tick.epoch:
|
|
|
|
@docker exec aio /usr/bin/frostfs-adm --config /config/frostfs-adm.yml morph force-new-epoch
|
|
|
|
|
|
|
|
# Show current version
|
|
|
|
version:
|
|
|
|
@echo $(VERSION)
|
|
|
|
@echo "frostfs-node: $(AIO_VERSION)"
|
|
|
|
@echo "neo-go: $(NEOGO_VERSION)"
|