From 17f1b65e9a79bbbebdaaa7b9b6331c9e3c740ffa Mon Sep 17 00:00:00 2001 From: Ping-Lin Chang Date: Wed, 27 Sep 2023 00:00:02 +0100 Subject: [PATCH 1/2] ci(Makefile): fix make stop and start --- Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9b090e7a..23c26a52 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,6 @@ all: ## Launch all services with their up-to-date release version rm -rf $${TMP_CONFIG_DIR}; \ fi @EDITION=$${EDITION:=local-ce} docker compose -f docker-compose.yml up -d --quiet-pull - @EDITION=$${EDITION:=local-ce} docker compose -f docker-compose.yml rm -f .PHONY: latest latest: ## Lunch all dependent services with their latest codebase @@ -62,7 +61,6 @@ latest: ## Lunch all dependent services with their latest codebase rm -rf $${TMP_CONFIG_DIR}; \ fi @COMPOSE_PROFILES=$(PROFILE) EDITION=$${EDITION:=local-ce:latest} docker compose -f docker-compose.yml -f docker-compose.latest.yml up -d --quiet-pull - @COMPOSE_PROFILES=$(PROFILE) EDITION=$${EDITION:=local-ce:latest} docker compose -f docker-compose.yml -f docker-compose.latest.yml rm -f .PHONY: logs logs: ## Tail all logs with -n 10 @@ -74,19 +72,23 @@ pull: ## Pull all service images .PHONY: stop stop: ## Stop all components - @docker compose stop + @EDITION= docker compose stop + @docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --name ${CONTAINER_COMPOSE_NAME}-latest \ + ${CONTAINER_COMPOSE_IMAGE_NAME}:latest /bin/sh -c " \ + /bin/sh -c 'cd /instill-ai/base && make stop' \ + " .PHONY: start -start: ## Start all stopped services - @docker compose start - -.PHONY: restart -restart: ## Restart all services - @docker compose restart - -.PHONY: rm -rm: ## Remove all stopped service containers - @docker compose rm -f +start: ## Start all stopped components + @docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --name ${CONTAINER_COMPOSE_NAME}-latest \ + ${CONTAINER_COMPOSE_IMAGE_NAME}:latest /bin/sh -c " \ + /bin/sh -c 'cd /instill-ai/base && make start' \ + " + @EDITION= docker compose start .PHONY: down down: ## Stop all services and remove all service containers and volumes From b2647a87305a9669dd7dcde6f4d2c9059cf837c6 Mon Sep 17 00:00:00 2001 From: Ping-Lin Chang Date: Wed, 27 Sep 2023 00:01:54 +0100 Subject: [PATCH 2/2] ci(docker-compose): set EDITION explicitly --- docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bb25b1b2..f348b987 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: CFG_SERVER_DEBUG: "false" CFG_SERVER_MAXDATASIZE: ${MAX_DATA_SIZE} CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED} - CFG_SERVER_EDITION: ${EDITION:-} + CFG_SERVER_EDITION: ${EDITION} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} CFG_DATABASE_USERNAME: postgres @@ -62,7 +62,7 @@ services: CFG_SERVER_DEBUG: "false" CFG_SERVER_MAXDATASIZE: ${MAX_DATA_SIZE} CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED} - CFG_SERVER_EDITION: ${EDITION:-} + CFG_SERVER_EDITION: ${EDITION} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} CFG_DATABASE_USERNAME: postgres @@ -121,7 +121,7 @@ services: CFG_SERVER_PUBLICPORT: ${CONNECTOR_BACKEND_PUBLICPORT} CFG_SERVER_DEBUG: "false" CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED} - CFG_SERVER_EDITION: ${EDITION:-} + CFG_SERVER_EDITION: ${EDITION} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} CFG_DATABASE_USERNAME: postgres @@ -147,7 +147,7 @@ services: restart: unless-stopped environment: CFG_SERVER_DEBUG: "false" - CFG_SERVER_EDITION: ${EDITION:-} + CFG_SERVER_EDITION: ${EDITION} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} CFG_DATABASE_USERNAME: postgres @@ -169,7 +169,7 @@ services: target: /var/run/docker.sock temporal_admin_tools: - container_name: ${TEMPORAL_HOST}-admin-tools + container_name: temporal-admin-tools image: ${TEMPORAL_ADMIN_TOOLS_IMAGE}:${TEMPORAL_ADMIN_TOOLS_VERSION} restart: on-failure environment: