From 3c15a0cca1dfd67dde79e0f843ac160d9cb8680c Mon Sep 17 00:00:00 2001 From: Ping-Lin Chang Date: Tue, 23 Jan 2024 21:45:39 +0000 Subject: [PATCH] ci(core): fix make build-latest PROFILE --- .github/CONTRIBUTING.md | 2 +- .github/workflows/make-latest.yml | 5 +++-- Makefile | 10 +++++----- docker-compose.build.yml | 15 +++++++-------- docker-compose.yml | 6 ++++-- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 38d6224ac..ad3b80f19 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -31,7 +31,7 @@ $ make latest PROFILE=all The env variable `PROFILE` is intended to specify which service component you want to develop on - `all` - When you set `PROFILE=all`, the whole `Instill Core` and `Instill VDP` stack will be launched, meaning you want to test the system as a whole + When you set `PROFILE=all`, the whole `Instill Core` and `Instill VDP` stack will be launched, meaning you want to test the system as a whole. - `{service}` diff --git a/.github/workflows/make-latest.yml b/.github/workflows/make-latest.yml index 84a9fd527..e0022058f 100644 --- a/.github/workflows/make-latest.yml +++ b/.github/workflows/make-latest.yml @@ -50,8 +50,9 @@ jobs: envFile: .env - name: Launch Instill VDP (latest) - run: make latest PROFILE=exclude-console EDITION=local-ce:test - + run: | + make latest PROFILE=exclude-console EDITION=local-ce:test + - name: List all docker containers run: | docker ps -a diff --git a/Makefile b/Makefile index e68cee9c3..fadd5b85d 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ all: ## Launch all services with their up-to-date release version .PHONY: latest latest: ## Lunch all dependent services with their latest codebase - @make build-latest + @make build-latest PROFILE=${PROFILE} @if ! docker compose ls -q | grep -q "instill-core"; then \ export TMP_CONFIG_DIR=$(shell mktemp -d) && \ export SYSTEM_CONFIG_PATH=$(shell eval echo ${SYSTEM_CONFIG_PATH}) && \ @@ -67,11 +67,11 @@ latest: ## Lunch all dependent services with their latest codebase cp /instill-ai/core/.env $${TMP_CONFIG_DIR}/.env && \ cp /instill-ai/core/docker-compose.build.yml $${TMP_CONFIG_DIR}/docker-compose.build.yml && \ cp -r /instill-ai/core/configs/influxdb $${TMP_CONFIG_DIR} && \ - /bin/sh -c 'cd /instill-ai/core && make latest PROJECT=core PROFILE=$${PROFILE} EDITION=$${EDITION:=local-ce:latest} INSTILL_CORE_HOST=$${INSTILL_CORE_HOST} SYSTEM_CONFIG_PATH=$${SYSTEM_CONFIG_PATH} BUILD_CONFIG_DIR_PATH=$${TMP_CONFIG_DIR} OBSERVE_CONFIG_DIR_PATH=$${TMP_CONFIG_DIR}'&& \ + /bin/sh -c 'cd /instill-ai/core && make latest PROFILE=${PROFILE} PROJECT=core EDITION=$${EDITION:=local-ce:latest} INSTILL_CORE_HOST=$${INSTILL_CORE_HOST} SYSTEM_CONFIG_PATH=$${SYSTEM_CONFIG_PATH} BUILD_CONFIG_DIR_PATH=$${TMP_CONFIG_DIR} OBSERVE_CONFIG_DIR_PATH=$${TMP_CONFIG_DIR}'&& \ rm -rf $${TMP_CONFIG_DIR}/* \ " && 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 up -d --quiet-pull .PHONY: logs logs: ## Tail all logs with -n 10 @@ -160,7 +160,7 @@ build-latest: ## Build latest images for all VDP components --name ${CONTAINER_BUILD_NAME}-latest \ ${CONTAINER_COMPOSE_IMAGE_NAME}:latest /bin/sh -c " \ PIPELINE_BACKEND_VERSION=latest \ - docker compose -f docker-compose.build.yml build --progress plain \ + COMPOSE_PROFILES=${PROFILE} docker compose -f docker-compose.build.yml build --progress plain \ " .PHONY: build-release @@ -187,7 +187,7 @@ build-release: ## Build release images for all VDP components .PHONY: integration-test-latest integration-test-latest: ## Run integration test on the latest VDP - @make latest BUILD=true PROFILE=all EDITION=local-ce:test + @make latest EDITION=local-ce:test @docker run --rm \ --network instill-network \ --name ${CONTAINER_BACKEND_INTEGRATION_TEST_NAME}-latest \ diff --git a/docker-compose.build.yml b/docker-compose.build.yml index 6f1cbb546..862ca67a2 100644 --- a/docker-compose.build.yml +++ b/docker-compose.build.yml @@ -1,15 +1,7 @@ version: "3.9" services: - pipeline_backend: - image: ${PIPELINE_BACKEND_IMAGE}:${PIPELINE_BACKEND_VERSION} - build: - context: ./${PIPELINE_BACKEND_HOST} - args: - SERVICE_NAME: ${PIPELINE_BACKEND_HOST} - GOLANG_VERSION: ${GOLANG_VERSION} - K6_VERSION: ${K6_VERSION} profiles: - all - exclude-api-gateway @@ -17,3 +9,10 @@ services: - exclude-console - exclude-model - exclude-controller-model + image: ${PIPELINE_BACKEND_IMAGE}:${PIPELINE_BACKEND_VERSION} + build: + context: ./${PIPELINE_BACKEND_HOST} + args: + SERVICE_NAME: ${PIPELINE_BACKEND_HOST} + GOLANG_VERSION: ${GOLANG_VERSION} + K6_VERSION: ${K6_VERSION} diff --git a/docker-compose.yml b/docker-compose.yml index 588611cc5..5e6461b5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,6 +107,8 @@ services: depends_on: pipeline_backend_migrate: condition: service_completed_successfully + temporal_admin_tools_pipeline: + condition: service_completed_successfully socat: container_name: ${SOCAT_HOST} @@ -119,8 +121,8 @@ services: source: /var/run/docker.sock target: /var/run/docker.sock - temporal_admin_tools_vdp: - container_name: temporal-admin-tools-vdp + temporal_admin_tools_pipeline: + container_name: temporal-admin-tools-pipeline image: ${TEMPORAL_ADMIN_TOOLS_IMAGE}:${TEMPORAL_ADMIN_TOOLS_VERSION} restart: on-failure environment: