bringup/Makefile

110 lines
3.4 KiB
Makefile

FROSTFS_VERSION?=0.42.9
FROSTFS_CONTRACTS_VERSION=0.19.4
FROSTFS_LOCODE_VERSION=0.4.0
FROSTFS_HTTPGW_VERSION=0.30.2
FROSTFS_S3GW_VERSION=0.30.6
NEOGO_VERSION?=0.106.3
NEOGO_RPC_ENDPOINT?=http://$(NEOGO_NODE1_IP):30333
NEOGO_NODE1_IP?=$(call docker_ip,morph1)
IR_NODE1_IP?=$(call docker_ip,innerring1)
STORAGE_NODE1_IP?=$(call docker_ip,storage1)
ALPHABET=az buky vedi glagoli dobro yest zhivete
NODE_COUNT?=7
NODE_ID?=1
NODE_LETTER=$(word $(NODE_ID),$(ALPHABET))
export NODE_COUNT
export NODE_ID
export NODE_LETTER
SHELL=/bin/bash
.SHELLFLAGS=-euo pipefail -c
ADM?=bin/frostfs-adm-v$(FROSTFS_VERSION)
ADM_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v$(FROSTFS_VERSION)/frostfs-adm
CLI?=bin/frostfs-cli-v$(FROSTFS_VERSION)
CLI_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v$(FROSTFS_VERSION)/frostfs-cli
IR?=bin/frostfs-ir-v$(FROSTFS_VERSION)
IR_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v$(FROSTFS_VERSION)/frostfs-ir
NODE?=bin/frostfs-node-v$(FROSTFS_VERSION)
NODE_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-node/releases/download/v$(FROSTFS_VERSION)/frostfs-node
NEOGO?=bin/neo-go-v$(NEOGO_VERSION)
NEOGO_RELEASE_URL=https://github.com/nspcc-dev/neo-go/releases/download/v$(NEOGO_VERSION)/neo-go-linux-amd64
LOCODE?=bin/locode.db
LOCODE_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/releases/download/v$(FROSTFS_LOCODE_VERSION)/locode_db.gz
HTTP?=bin/frostfs-http-gw-v$(FROSTFS_HTTPGW_VERSION)
HTTP_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/releases/download/v$(FROSTFS_HTTPGW_VERSION)/frostfs-http-gw
S3?=bin/frostfs-s3-gw-v$(FROSTFS_S3GW_VERSION)
S3_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/releases/download/v$(FROSTFS_HTTPGW_VERSION)/frostfs-s3-gw
AUTHMATE?=bin/frostfs-s3-authmate-v$(FROSTFS_S3GW_VERSION)
AUTHMATE_RELEASE_URL=https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/releases/download/v$(FROSTFS_HTTPGW_VERSION)/frostfs-s3-authmate
bin/frostfs-adm-v$(FROSTFS_VERSION):
mkdir -p $(dir $@)
wget -q "$(ADM_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-cli-v$(FROSTFS_VERSION):
mkdir -p $(dir $@)
wget -q "$(CLI_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-node-v$(FROSTFS_VERSION):
mkdir -p $(dir $@)
wget -q "$(NODE_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-ir-v$(FROSTFS_VERSION):
mkdir -p $(dir $@)
wget -q "$(IR_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-http-gw-v$(FROSTFS_HTTPGW_VERSION):
mkdir -p $(dir $@)
wget -q "$(HTTP_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-s3-gw-v$(FROSTFS_S3GW_VERSION):
mkdir -p $(dir $@)
wget -q "$(S3_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/frostfs-s3-authmate-v$(FROSTFS_S3GW_VERSION):
mkdir -p $(dir $@)
wget -q "$(AUTHMATE_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/neo-go-v$(NEOGO_VERSION):
mkdir -p $(dir $@)
wget -q "$(NEOGO_RELEASE_URL)" -O "$@"
chmod +x "$@"
bin/locode.db:
mkdir -p $(dir $@)
wget -q "$(LOCODE_RELEASE_URL)" -O - | gunzip > $@-v$(FROSTFS_LOCODE_VERSION)
ln -sf $(notdir $@)-v$(FROSTFS_LOCODE_VERSION) $@
define math
$(shell bash -c "echo $$(($(1)))")
endef
define docker_ip
$(firstword $(shell docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}} {{end}}' $(1)))
endef
.PHONY: network-up
network-up:
-docker network create bringup
wallet/%.json: wallet/%.template | $(NEOGO)
mkdir -p $(dir $@)
$(NEOGO) wallet init --account --wallet-config $<