From 2edbfeec768751ff77fa3dec28719667d709e6d5 Mon Sep 17 00:00:00 2001 From: Ping-Lin Chang Date: Sun, 10 Mar 2024 15:29:28 +0000 Subject: [PATCH] ci(workflows): fix integration tests --- .env | 3 - .../helm-integration-test-backend.yml | 8 +- .../helm-integration-test-console.yml | 306 +++++------------- .../helm-integration-test-latest.yml | 6 +- .../workflows/integration-test-backend.yml | 20 +- .../workflows/integration-test-console.yml | 210 ++---------- .github/workflows/integration-test-latest.yml | 6 +- .github/workflows/make-latest.yml | 2 +- docker-compose.yml | 2 +- 9 files changed, 132 insertions(+), 431 deletions(-) diff --git a/.env b/.env index 819b40514..05bb8c830 100644 --- a/.env +++ b/.env @@ -31,9 +31,6 @@ INITMODEL_ENABLED=false # configuration directory path CONFIG_DIR_PATH=./configs -# Instill Core instance host -INSTILL_CORE_HOST=localhost - # container build DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 diff --git a/.github/workflows/helm-integration-test-backend.yml b/.github/workflows/helm-integration-test-backend.yml index 8b5e6123b..b682e05c4 100644 --- a/.github/workflows/helm-integration-test-backend.yml +++ b/.github/workflows/helm-integration-test-backend.yml @@ -40,8 +40,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 @@ -111,7 +109,7 @@ jobs: # disable the mac test temporary # if: inputs.target == 'latest' && github.ref == 'refs/heads/main' runs-on: [self-hosted, macOS, vdp] - timeout-minutes: 20 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -149,8 +147,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 @@ -226,7 +222,7 @@ jobs: # disable the mac test temporary # if: inputs.target == 'release' runs-on: [self-hosted, macOS, vdp] - timeout-minutes: 20 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 diff --git a/.github/workflows/helm-integration-test-console.yml b/.github/workflows/helm-integration-test-console.yml index 8179a4afc..a25ae971d 100644 --- a/.github/workflows/helm-integration-test-console.yml +++ b/.github/workflows/helm-integration-test-console.yml @@ -11,7 +11,7 @@ jobs: helm-integration-test-latest-linux: if: inputs.target == 'latest' runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -22,48 +22,67 @@ jobs: sudo kill -9 `sudo lsof -t -i:8084` sudo lsof -i -P -n | grep LISTEN - - name: Free disk space - run: | - df --human-readable - sudo apt clean - docker rmi $(docker image ls --all --quiet) - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df --human-readable + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + overprovision-lvm: "true" + remove-dotnet: "true" + build-mount-path: "/var/lib/docker/" + + - name: Restart docker + run: sudo service docker restart - name: Start Minikube - run: minikube start --cpus 2 --memory 6096 + run: minikube start --cpus 4 --memory 10485 - - name: Checkout repo (instill-core) + - name: Checkout repo uses: actions/checkout@v3 - - name: Load .env file (instill-core) + - name: Load .env file uses: cardinalby/export-env-action@v2 with: envFile: .env - - name: Install k6 - run: | - curl https://github.com/grafana/k6/releases/download/v${{ env.K6_VERSION }}/k6-v${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1 && sudo cp k6 /usr/bin - - - name: Launch Instill Core (latest) + - name: Launch Helm Instill Core (latest) run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set tags.observability=false \ - --set tags.prometheusStack=false \ + --set itMode.enabled=true \ --set apiGateway.image.tag=latest \ --set mgmtBackend.image.tag=latest \ + --set pipelineBackend.image.tag=latest \ + --set pipelineBackend.excludelocalconnector=false \ + --set modelBackend.image.tag=latest \ + --set controllerModel.image.tag=latest \ --set console.image.tag=latest \ - --set apiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ - --set console.serverApiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ - --set consoleURL=http://localhost:${CONSOLE_PORT} + --set rayService.image.tag=${RAY_SERVER_VERSION} \ + --set rayService.headGroupSpec.resources.limits.cpu=0 \ + --set rayService.headGroupSpec.resources.limits.memory=2Gi \ + --set rayService.headGroupSpec.resources.requests.cpu=0 \ + --set rayService.headGroupSpec.resources.requests.memory=2Gi \ + --set rayService.workerGroupSpecs[0].replicas=1 \ + --set rayService.workerGroupSpecs[0].minReplicas=1 \ + --set rayService.workerGroupSpecs[0].maxReplicas=1 \ + --set rayService.workerGroupSpecs[0].groupName=test-group \ + --set rayService.workerGroupSpecs[0].gpuWorkerGroup.enabled=false \ + --set rayService.workerGroupSpecs[0].resources.limits.cpu=1 \ + --set rayService.workerGroupSpecs[0].resources.limits.memory=2Gi \ + --set rayService.workerGroupSpecs[0].resources.requests.cpu=1 \ + --set rayService.workerGroupSpecs[0].resources.requests.memory=2Gi \ + --set tags.observability=false \ + --set tags.prometheusStack=false - - name: Wait for core pods up + - name: Wait for all pods up run: | while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do echo "$(kubectl get pods --namespace instill-ai)" sleep 10 done + while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=controller-model,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do + echo "$(kubectl get pods --namespace instill-ai)" + sleep 10 + done + echo "$(kubectl get pods --namespace instill-ai)" - name: Port-forward of core api-gateway and console run: | @@ -97,7 +116,7 @@ jobs: # disable the mac test temporary # if: inputs.target == 'latest' && github.ref == 'refs/heads/main' runs-on: [self-hosted, macOS, core] - timeout-minutes: 20 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -106,99 +125,10 @@ jobs: run: | brew install make - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Load .env file - uses: cardinalby/export-env-action@v2 - with: - envFile: .env - - - name: Check if Instill Core Helm release exists - id: check-core-helm-release - run: | - if helm ls -n instill-ai | grep -q 'core'; then - echo "Helm release 'core' found." - echo "release_exists=true" >> $GITHUB_OUTPUT - else - echo "Helm release 'core' not found." - fi - - - name: Uninstall Instill Core Helm Release - if: steps.check-core-helm-release.outputs.release_exists == 'true' - run: | - helm uninstall core --namespace instill-ai - kubectl delete namespace instill-ai - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - - - name: Install k6 - run: | - brew install k6 - - - name: Launch Instill Core (latest) - run: | - make build-latest - helm install core charts/core --namespace instill-ai --create-namespace \ - --set edition=k8s-ce:test \ - --set tags.observability=false \ - --set tags.prometheusStack=false \ - --set apiGateway.image.tag=latest \ - --set mgmtBackend.image.tag=latest \ - --set console.image.tag=latest \ - --set apiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ - --set console.serverApiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ - --set consoleURL=http://host.docker.internal:${CONSOLE_PORT} - - - name: Wait for core pods up - run: | - while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do - echo "$(kubectl get pods --namespace instill-ai)" - sleep 10 - done - - - name: Port-forward of core api-gateway and console - run: | - API_GATEWAY_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name') - kubectl --namespace instill-ai port-forward ${API_GATEWAY_POD_NAME} ${API_GATEWAY_PORT}:${API_GATEWAY_PORT} > /dev/null 2>&1 & - CONSOLE_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=console,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name') - kubectl --namespace instill-ai port-forward ${CONSOLE_POD_NAME} ${CONSOLE_PORT}:${CONSOLE_PORT} > /dev/null 2>&1 & - while ! nc -vz localhost ${API_GATEWAY_PORT} > /dev/null 2>&1; do sleep 1; done - while ! nc -vz localhost ${CONSOLE_PORT} > /dev/null 2>&1; do sleep 1; done - - - name: Run console integration test (latest) - run: | - git clone https://github.com/instill-ai/console.git - cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:latest . - docker run -t --rm \ - -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ - -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ - -e NEXT_PUBLIC_CONSOLE_EDITION=k8s-ce:test \ - -e NEXT_PUBLIC_CONSOLE_BASE_URL=http://host.docker.internal:${CONSOLE_PORT} \ - -e NEXT_PUBLIC_API_GATEWAY_URL=http://host.docker.internal:${API_GATEWAY_PORT} \ - -e NEXT_SERVER_API_GATEWAY_URL=http://host.docker.internal:${API_GATEWAY_PORT} \ - -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=false \ - -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME=instill-ai-user \ - --entrypoint ./entrypoint-playwright.sh \ - --name core-console-integration-test-latest \ - console-playwright:latest - - - name: Make down core helm chart - run: | - helm uninstall core --namespace instill-ai - kubectl delete namespace instill-ai - - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Make down build-latest - run: | - pkill -f "port-forward" - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - helm-integration-test-release-linux: if: inputs.target == 'release' runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -209,16 +139,18 @@ jobs: sudo kill -9 `sudo lsof -t -i:8084` sudo lsof -i -P -n | grep LISTEN - - name: Free disk space - run: | - df --human-readable - sudo apt clean - docker rmi $(docker image ls --all --quiet) - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df --human-readable + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + overprovision-lvm: "true" + remove-dotnet: "true" + build-mount-path: "/var/lib/docker/" + + - name: Restart docker + run: sudo service docker restart - name: Start Minikube - run: minikube start --cpus 2 --memory 6096 + run: minikube start --cpus 4 --memory 10485 - name: Checkout repo (instill-core) uses: actions/checkout@v3 @@ -228,29 +160,46 @@ jobs: with: envFile: .env - - name: Install k6 - run: | - curl https://github.com/grafana/k6/releases/download/v${{ env.K6_VERSION }}/k6-v${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1 && sudo cp k6 /usr/bin - - - name: Launch Instill Core (release) + - name: Launch Helm Instill Core (release) run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set tags.observability=false \ - --set tags.prometheusStack=false \ + --set itMode.enabled=true \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ --set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \ + --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set pipelineBackend.excludelocalconnector=false \ + --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set controllerModel.image.tag=${CONTROLLER_MODEL_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ - --set apiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ - --set console.serverApiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ - --set consoleURL=http://localhost:${CONSOLE_PORT} + --set rayService.image.tag=${RAY_SERVER_VERSION} \ + --set rayService.headGroupSpec.resources.limits.cpu=0 \ + --set rayService.headGroupSpec.resources.limits.memory=2Gi \ + --set rayService.headGroupSpec.resources.requests.cpu=0 \ + --set rayService.headGroupSpec.resources.requests.memory=2Gi \ + --set rayService.workerGroupSpecs[0].replicas=1 \ + --set rayService.workerGroupSpecs[0].minReplicas=1 \ + --set rayService.workerGroupSpecs[0].maxReplicas=1 \ + --set rayService.workerGroupSpecs[0].groupName=test-group \ + --set rayService.workerGroupSpecs[0].gpuWorkerGroup.enabled=false \ + --set rayService.workerGroupSpecs[0].resources.limits.cpu=1 \ + --set rayService.workerGroupSpecs[0].resources.limits.memory=2Gi \ + --set rayService.workerGroupSpecs[0].resources.requests.cpu=1 \ + --set rayService.workerGroupSpecs[0].resources.requests.memory=2Gi \ + --set tags.observability=false \ + --set tags.prometheusStack=false - - name: Wait for core pods up + - name: Wait for all pods up run: | while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do echo "$(kubectl get pods --namespace instill-ai)" sleep 10 done + while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=controller-model,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do + echo "$(kubectl get pods --namespace instill-ai)" + sleep 10 + done + echo "$(kubectl get pods --namespace instill-ai)" - name: Port-forward of core api-gateway and console run: | @@ -281,10 +230,10 @@ jobs: helm-integration-test-release-mac: if: false - # disable the mac test temporary + # disable the mac test temporary # if: inputs.target == 'release' runs-on: [self-hosted, macOS, core] - timeout-minutes: 30 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -292,92 +241,3 @@ jobs: - name: Set up environment run: | brew install make - - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Load .env file - uses: cardinalby/export-env-action@v2 - with: - envFile: .env - - - name: Check if Instill Core Helm release exists - id: check-core-helm-release - run: | - if helm ls -n instill-ai | grep -q 'core'; then - echo "Helm release 'core' found." - echo "release_exists=true" >> $GITHUB_OUTPUT - else - echo "Helm release 'core' not found." - fi - - - name: Uninstall Instill Core Helm Release - if: steps.check-core-helm-release.outputs.release_exists == 'true' - run: | - helm uninstall core --namespace instill-ai - kubectl delete namespace instill-ai - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - - - name: Install k6 - run: | - brew install k6 - - - name: Launch Instill Core (release) - run: | - make build-release - helm install core charts/core --namespace instill-ai --create-namespace \ - --set edition=k8s-ce:test \ - --set tags.observability=false \ - --set tags.prometheusStack=false \ - --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ - --set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \ - --set console.image.tag=${CONSOLE_VERSION} \ - --set apiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ - --set console.serverApiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ - --set consoleURL=http://host.docker.internal:${CONSOLE_PORT} - - - name: Wait for core pods up - run: | - while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do - echo "$(kubectl get pods --namespace instill-ai)" - sleep 10 - done - - - name: Port-forward of core api-gateway and console - run: | - API_GATEWAY_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name') - kubectl --namespace instill-ai port-forward ${API_GATEWAY_POD_NAME} ${API_GATEWAY_PORT}:${API_GATEWAY_PORT} > /dev/null 2>&1 & - CONSOLE_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=console,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name') - kubectl --namespace instill-ai port-forward ${CONSOLE_POD_NAME} ${CONSOLE_PORT}:${CONSOLE_PORT} > /dev/null 2>&1 & - while ! nc -vz localhost ${API_GATEWAY_PORT} > /dev/null 2>&1; do sleep 1; done - while ! nc -vz localhost ${CONSOLE_PORT} > /dev/null 2>&1; do sleep 1; done - - - name: Run console integration test (release) - run: | - git clone -b v$CONSOLE_VERSION https://github.com/instill-ai/console.git - cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:${{ env.CONSOLE_VERSION }} . - docker run -t --rm \ - -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ - -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ - -e NEXT_PUBLIC_CONSOLE_EDITION=k8s-ce:test \ - -e NEXT_PUBLIC_CONSOLE_BASE_URL=http://host.docker.internal:${CONSOLE_PORT} \ - -e NEXT_PUBLIC_API_GATEWAY_URL=http://host.docker.internal:${API_GATEWAY_PORT} \ - -e NEXT_SERVER_API_GATEWAY_URL=http://host.docker.internal:${API_GATEWAY_PORT} \ - -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=false \ - -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME=instill-ai-user \ - --entrypoint ./entrypoint-playwright.sh \ - --name core-console-integration-test-release \ - console-playwright:${{ env.CONSOLE_VERSION }} - - - name: Make down core helm chart - run: | - helm uninstall core --namespace instill-ai - kubectl delete namespace instill-ai - - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Make down build-release - run: | - pkill -f "port-forward" - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v diff --git a/.github/workflows/helm-integration-test-latest.yml b/.github/workflows/helm-integration-test-latest.yml index c914a1075..270b5dc92 100644 --- a/.github/workflows/helm-integration-test-latest.yml +++ b/.github/workflows/helm-integration-test-latest.yml @@ -13,11 +13,13 @@ jobs: matrix: component: [mgmt-backend, pipeline-backend, model-backend, controller-model] - uses: instill-ai/instill-core/.github/workflows/helm-integration-test-backend.yml@main + # uses: instill-ai/instill-core/.github/workflows/helm-integration-test-backend.yml@main + uses: instill-ai/instill-core/.github/workflows/integration-test-backend.yml@pinglin/ci-fix-test with: component: ${{ matrix.component }} target: latest console: - uses: instill-ai/instill-core/.github/workflows/helm-integration-test-console.yml@main + # uses: instill-ai/instill-core/.github/workflows/helm-integration-test-console.yml@main + uses: instill-ai/instill-core/.github/workflows/integration-test-console.yml@pinglin/ci-fix-test with: target: latest diff --git a/.github/workflows/integration-test-backend.yml b/.github/workflows/integration-test-backend.yml index ecfa83808..9dbd1c4a9 100644 --- a/.github/workflows/integration-test-backend.yml +++ b/.github/workflows/integration-test-backend.yml @@ -37,8 +37,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 @@ -51,7 +49,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest EDITION=local-ce:test ITMODE_ENABLED=true + make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true - name: Uppercase component name id: uppercase @@ -95,8 +93,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 @@ -105,7 +101,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest EDITION=local-ce:test ITMODE_ENABLED=true + make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true - name: Uppercase component name id: uppercase @@ -148,8 +144,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 @@ -160,14 +154,6 @@ jobs: run: | curl https://github.com/grafana/k6/releases/download/v${{ env.K6_VERSION }}/k6-v${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1 && sudo cp k6 /usr/bin - - name: Free disk space - run: | - df --human-readable - sudo apt clean - docker rmi $(docker image ls --all --quiet) - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df --human-readable - - name: Launch Instill Core (release) run: | make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true @@ -216,8 +202,6 @@ jobs: - name: Checkout repo uses: actions/checkout@v3 - with: - repository: instill-ai/core - name: Load .env file uses: cardinalby/export-env-action@v2 diff --git a/.github/workflows/integration-test-console.yml b/.github/workflows/integration-test-console.yml index 2711a50a3..8bb2bbcdc 100644 --- a/.github/workflows/integration-test-console.yml +++ b/.github/workflows/integration-test-console.yml @@ -11,7 +11,7 @@ jobs: integration-test-latest-linux: if: inputs.target == 'latest' runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -22,41 +22,27 @@ jobs: sudo kill -9 `sudo lsof -t -i:8084` sudo lsof -i -P -n | grep LISTEN - - name: Pre Free Disk Space (Ubuntu) - run: | - df --human-readable - sudo apt clean - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main + - name: Maximize build space + uses: easimon/maximize-build-space@master with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: true - swap-storage: true + overprovision-lvm: "true" + remove-dotnet: "true" + build-mount-path: "/var/lib/docker/" + + - name: Restart docker + run: sudo service docker restart - - name: Checkout repo (instill-core) + - name: Checkout repo uses: actions/checkout@v3 - - name: Load .env file (instill-core) + - name: Load .env file uses: cardinalby/export-env-action@v2 with: envFile: .env - name: Launch Instill Core (latest) run: | - INSTILL_CORE_HOST=api-gateway \ - COMPOSE_PROFILES=all \ - EDITION=local-ce:test \ - RAY_LATEST_TAG=latest \ - docker compose -f docker-compose.yml -f docker-compose-latest.yml up -d --quiet-pull - COMPOSE_PROFILES=all \ - EDITION=local-ce:test \ - docker compose -f docker-compose.yml -f docker-compose-latest.yml rm -f + make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true - name: Run console integration test (latest) run: | @@ -76,12 +62,16 @@ jobs: --name console-integration-test \ console-playwright:latest + - name: Make down Instill Core + run: | + make down + integration-test-latest-mac: if: false # disable the mac test temporary - # if: inputs.target == 'latest' && github.ref == 'refs/heads/main' + # if: inputs.target == 'latest' runs-on: [self-hosted, macOS, core] - timeout-minutes: 20 + timeout-minutes: 120 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -94,72 +84,10 @@ jobs: run: | brew install make - - name: Checkout repo (instill-core) - uses: actions/checkout@v3 - - - name: Load .env file (instill-core) - uses: cardinalby/export-env-action@v2 - with: - envFile: .env - - - name: Make down core - run: | - docker rm -f core-build-latest >/dev/null 2>&1 - docker rm -f core-backend-integration-test-latest >/dev/null 2>&1 - docker rm -f core-console-integration-test-latest >/dev/null 2>&1 - docker rm -f core-backend-integration-test-helm-latest >/dev/null 2>&1 - docker rm -f core-console-integration-test-helm-latest >/dev/null 2>&1 - docker rm -f core-dind-latest >/dev/null 2>&1 - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - sleep 60 - - - name: Launch Instill Core (latest) - run: | - INSTILL_CORE_HOST=api-gateway \ - COMPOSE_PROFILES=all \ - EDITION=local-ce:test \ - RAY_LATEST_TAG=latest \ - docker compose -f docker-compose.yml -f docker-compose-latest.yml up -d --quiet-pull - COMPOSE_PROFILES=all \ - EDITION=local-ce:test \ - docker compose -f docker-compose.yml -f docker-compose-latest.yml rm -f - - - name: Run console integration test (latest) - run: | - git clone https://github.com/instill-ai/console.git - cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:latest . - docker run -t --rm \ - -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ - -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ - -e NEXT_PUBLIC_CONSOLE_EDITION=local-ce:test \ - -e NEXT_PUBLIC_CONSOLE_BASE_URL=http://console:3000 \ - -e NEXT_PUBLIC_API_GATEWAY_URL=http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} \ - -e NEXT_SERVER_API_GATEWAY_URL=http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} \ - -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=false \ - -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME=instill-ai-user \ - --network instill-network \ - --entrypoint ./entrypoint-playwright.sh \ - --name console-integration-test \ - console-playwright:latest - - - name: Checkout repo (instill-core) - uses: actions/checkout@v3 - - - name: Make down core - run: | - docker rm -f core-build-latest >/dev/null 2>&1 - docker rm -f core-backend-integration-test-latest >/dev/null 2>&1 - docker rm -f core-console-integration-test-latest >/dev/null 2>&1 - docker rm -f core-backend-integration-test-helm-latest >/dev/null 2>&1 - docker rm -f core-console-integration-test-helm-latest >/dev/null 2>&1 - docker rm -f core-dind-latest >/dev/null 2>&1 - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - sleep 60 - integration-test-release-linux: if: inputs.target == 'release' runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -170,39 +98,27 @@ jobs: sudo kill -9 `sudo lsof -t -i:8084` sudo lsof -i -P -n | grep LISTEN - - name: Pre Free Disk Space (Ubuntu) - run: | - df --human-readable - sudo apt clean - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main + - name: Maximize build space + uses: easimon/maximize-build-space@master with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: false - docker-images: true - swap-storage: true + overprovision-lvm: "true" + remove-dotnet: "true" + build-mount-path: "/var/lib/docker/" + + - name: Restart docker + run: sudo service docker restart - - name: Checkout repo (instill-core) + - name: Checkout repo uses: actions/checkout@v3 - - name: Load .env file (instill-core) + - name: Load .env file uses: cardinalby/export-env-action@v2 with: envFile: .env - name: Launch Instill Core (release) run: | - INSTILL_CORE_HOST=api-gateway \ - EDITION=local-ce:test \ - RAY_LATEST_TAG=latest \ - docker compose up -d --quiet-pull - EDITION=local-ce:test \ - docker compose rm -f + make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true - name: Run console integration test (release) run: | @@ -222,12 +138,16 @@ jobs: --name console-integration-test \ console-playwright:${{ env.CONSOLE_VERSION }} + - name: Make down Instill Core + run: | + make down + integration-test-release-mac: if: false # disable the mac test temporary # if: inputs.target == 'release' runs-on: [self-hosted, macOS, core] - timeout-minutes: 30 + timeout-minutes: 60 steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.12.0 @@ -239,63 +159,3 @@ jobs: - name: Set up environment run: | brew install make - - - name: Checkout repo (instill-core) - uses: actions/checkout@v3 - - - name: Load .env file (instill-core) - uses: cardinalby/export-env-action@v2 - with: - envFile: .env - - - name: Make down core - run: | - docker rm -f core-build-release >/dev/null 2>&1 - docker rm -f core-backend-integration-test-release >/dev/null 2>&1 - docker rm -f core-console-integration-test-release >/dev/null 2>&1 - docker rm -f core-backend-integration-test-helm-release >/dev/null 2>&1 - docker rm -f core-console-integration-test-helm-release >/dev/null 2>&1 - docker rm -f core-dind-release >/dev/null 2>&1 - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - sleep 60 - - - name: Launch Instill Core (release) - run: | - INSTILL_CORE_HOST=api-gateway \ - EDITION=local-ce:test \ - RAY_LATEST_TAG=latest \ - docker compose up -d --quiet-pull - EDITION=local-ce:test \ - docker compose rm -f - - - name: Run console integration test (release) - run: | - git clone -b v$CONSOLE_VERSION https://github.com/instill-ai/console.git - cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:${{ env.CONSOLE_VERSION }} . - docker run -t --rm \ - -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ - -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ - -e NEXT_PUBLIC_CONSOLE_EDITION=local-ce:test \ - -e NEXT_PUBLIC_CONSOLE_BASE_URL=http://console:3000 \ - -e NEXT_PUBLIC_API_GATEWAY_URL=http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} \ - -e NEXT_SERVER_API_GATEWAY_URL=http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} \ - -e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=false \ - -e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME=instill-ai-user \ - --network instill-network \ - --entrypoint ./entrypoint-playwright.sh \ - --name console-integration-test \ - console-playwright:${{ env.CONSOLE_VERSION }} - - - name: Checkout repo (instill-core) - uses: actions/checkout@v3 - - - name: Make down core - run: | - docker rm -f core-build-release >/dev/null 2>&1 - docker rm -f core-backend-integration-test-release >/dev/null 2>&1 - docker rm -f core-console-integration-test-release >/dev/null 2>&1 - docker rm -f core-backend-integration-test-helm-release >/dev/null 2>&1 - docker rm -f core-console-integration-test-helm-release >/dev/null 2>&1 - docker rm -f core-dind-release >/dev/null 2>&1 - EDITION=NULL docker compose -f docker-compose.yml -f docker-compose-observe.yml down -v - sleep 60 diff --git a/.github/workflows/integration-test-latest.yml b/.github/workflows/integration-test-latest.yml index 9876d8c13..125251bcd 100644 --- a/.github/workflows/integration-test-latest.yml +++ b/.github/workflows/integration-test-latest.yml @@ -13,11 +13,13 @@ jobs: matrix: component: [mgmt-backend, pipeline-backend, model-backend, controller-model] - uses: instill-ai/instill-core/.github/workflows/integration-test-backend.yml@main + # uses: instill-ai/instill-core/.github/workflows/integration-test-backend.yml@main + uses: instill-ai/instill-core/.github/workflows/integration-test-backend.yml@pinglin/ci-fix-test with: component: ${{ matrix.component }} target: latest console: - uses: instill-ai/instill-core/.github/workflows/integration-test-console.yml@main + # uses: instill-ai/instill-core/.github/workflows/integration-test-console.yml@main + uses: instill-ai/instill-core/.github/workflows/integration-test-console.yml@pinglin/ci-fix-test with: target: latest diff --git a/.github/workflows/make-latest.yml b/.github/workflows/make-latest.yml index d13a6c5f5..991ad74e7 100644 --- a/.github/workflows/make-latest.yml +++ b/.github/workflows/make-latest.yml @@ -51,7 +51,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest PROFILE=exclude-console EDITION=local-ce:test + make latest BUILD=true EDITION=local-ce:test - name: List all docker containers run: | diff --git a/docker-compose.yml b/docker-compose.yml index f09693a6a..05503c5ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -358,7 +358,7 @@ services: NEXT_PUBLIC_USAGE_COLLECTION_ENABLED: ${USAGE_ENABLED} NEXT_PUBLIC_CONSOLE_EDITION: ${EDITION} NEXT_PUBLIC_CONSOLE_BASE_URL: http://${CONSOLE_HOST}:${CONSOLE_PORT} - NEXT_PUBLIC_API_GATEWAY_URL: http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} + NEXT_PUBLIC_API_GATEWAY_URL: http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} NEXT_SERVER_API_GATEWAY_URL: http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT} NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME: instill-ai-user NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION: "false"