From dff6b86f96fa38c5c5897aae2cb48abe56784872 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 8 Sep 2022 18:04:44 +0300 Subject: [PATCH] [#208] Split basic services into basic and essential Essential services run chains. Between basic and essential runs adm tool can deploy environment. Signed-off-by: Alex Vanin --- .basic_services | 3 --- .essential_services | 5 +++++ Makefile | 16 ++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .essential_services diff --git a/.basic_services b/.basic_services index c497972..201ea70 100644 --- a/.basic_services +++ b/.basic_services @@ -1,8 +1,5 @@ # Services start/stop order # Will start from top to bottom and stop in reverse -basenet -chain -morph_chain nats ir storage diff --git a/.essential_services b/.essential_services new file mode 100644 index 0000000..3d2562c --- /dev/null +++ b/.essential_services @@ -0,0 +1,5 @@ +# Services start/stop order +# Will start from top to bottom and stop in reverse +basenet +chain +morph_chain diff --git a/Makefile b/Makefile index 0a98bfd..4d234f1 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,10 @@ 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 \\\#) +START_ESSENTIAL = $(shell cat .essential_services | grep -v \\\#) STOP_SVCS = $(shell tac .services | grep -v \\\#) STOP_BASIC = $(shell tac .basic_services | grep -v \\\#) +STOP_ESSENTIAL = $(shell tac .essential_services | grep -v \\\#) # List of hosts available in devenv HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) @@ -60,12 +62,17 @@ up: up/basic # Build up NeoFS .PHONY: up/basic -up/basic: get vendor/hosts +up/basic: up/essential @$(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 "Basic NeoFS Developer Environment is ready" +# Start essential services +.PHONY: up/essential +up/essential: get vendor/hosts + @$(foreach SVC, $(START_ESSENTIAL), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) + # Build up certain service .PHONY: up/% up/%: get vendor/hosts @@ -74,7 +81,7 @@ up/%: get vendor/hosts # Stop environment .PHONY: down -down: down/add down/basic +down: down/add down/basic down/essential @echo "Full NeoFS Developer Environment is down" .PHONY: down/add @@ -86,6 +93,11 @@ down/add: down/basic: $(foreach SVC, $(STOP_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) +# Stop essential services +.PHONY: down/essential +down/essential: + $(foreach SVC, $(STOP_ESSENTIAL), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) + # Stop certain service .PHONY: down/% down/%: