From 3348ebbfe0d3b09c28f732b66842fbd83be2df66 Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Fri, 4 Feb 2022 18:27:49 +0300 Subject: [PATCH] `Make up/down` for services (#155) * [#155] s3_gate: Service name in docker-compose.yml Signed-off-by: Elizaveta Chichindaeva * [#155] Makefile: Make Up/Down certain services Signed-off-by: Elizaveta Chichindaeva * [#155] Makefile: minor fixes Signed-off-by: Stanislav Bogatyrev Co-authored-by: Stanislav Bogatyrev --- .basic_services | 7 ++++++ .services | 5 ----- Makefile | 34 ++++++++++++++++++++++++++--- services/s3_gate/docker-compose.yml | 2 +- 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 .basic_services diff --git a/.basic_services b/.basic_services new file mode 100644 index 0000000..b9134b7 --- /dev/null +++ b/.basic_services @@ -0,0 +1,7 @@ +# Services start/stop order +# Will start from top to bottom and stop in reverse +basenet +chain +morph_chain +ir +storage diff --git a/.services b/.services index 7d10d26..2c165fa 100644 --- a/.services +++ b/.services @@ -1,10 +1,5 @@ # Services start/stop order # Will start from top to bottom and stop in reverse -basenet -chain -morph_chain -ir -storage http_gate s3_gate coredns diff --git a/Makefile b/Makefile index 288b485..79cfb08 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,9 @@ PULL_SVCS = $(shell find ./services -type f -name 'docker-compose.yml' | sort -u # List of services to run START_SVCS = $(shell cat .services | grep -v \\\#) +START_BASIC = $(shell cat .basic_services | grep -v \\\#) STOP_SVCS = $(shell tac .services | grep -v \\\#) +STOP_BASIC = $(shell tac .basic_services | grep -v \\\#) # List of hosts available in devenv HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) @@ -52,17 +54,43 @@ get: $(foreach SVC, $(GET_SVCS), get.$(SVC)) # Start environment .PHONY: up -up: get vendor/hosts +up: up/basic @$(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) + @echo "Full NeoFS Developer Environment is ready" + +# Build up NeoFS +.PHONY: up/basic +up/basic: get vendor/hosts + @$(foreach SVC, $(START_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) @./bin/tick.sh @./bin/config.sh string SystemDNS container - @echo "NeoFS Developer Environment is ready" + @echo "Basic NeoFS Developer Environment is ready" + +# Build up certain service +.PHONY: up/% +up/%: get vendor/hosts + @docker-compose -f services/$*/docker-compose.yml up -d + @echo "Developer Environment for $* service is ready" # Stop environment .PHONY: down -down: +down: down/add down/basic + @echo "Full NeoFS Developer Environment is down" + +.PHONY: down/add +down/add: $(foreach SVC, $(STOP_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) +# Stop basic environment +.PHONY: down/basic +down/basic: + $(foreach SVC, $(STOP_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) + +# Stop certain service +.PHONY: down/% +down/%: + @docker-compose -f services/$*/docker-compose.yml down + .PHONY: vendor/hosts .ONESHELL: vendor/hosts: diff --git a/services/s3_gate/docker-compose.yml b/services/s3_gate/docker-compose.yml index cdad241..8d1458d 100644 --- a/services/s3_gate/docker-compose.yml +++ b/services/s3_gate/docker-compose.yml @@ -2,7 +2,7 @@ version: "2.4" services: - http_gate: + s3_gate: image: ${S3_GW_IMAGE}:${S3_GW_VERSION} domainname: ${LOCAL_DOMAIN} hostname: s3_gate