Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(Makefile): fix make stop and start #365

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down