From 2df538231b2c1378afd374ae3d41b4eb100489c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Vall=C3=A9s?= Date: Tue, 26 Nov 2024 15:53:55 +0100 Subject: [PATCH] fix(ci): use xk6-sql driver and pin down versions --- .env | 6 ++++-- .github/workflows/helm-integration-test-backend.yml | 5 ++++- .github/workflows/integration-test-backend.yml | 5 ++++- .github/workflows/make-all.yml | 7 +++++-- .github/workflows/make-latest.yml | 7 +++++-- Dockerfile | 7 +++++-- Makefile | 4 ++++ 7 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 765548a3..3a11acbe 100644 --- a/.env +++ b/.env @@ -43,8 +43,10 @@ UBUNTU_VERSION=20.04 # for model-backend GOLANG_VERSION=1.22.5 KRAKEND_CE_VERSION=2.6.2 ARTIVC_VERSION=0.10.0 -K6_VERSION=0.44.0 -XK6_VERSION=0.11.0 +K6_VERSION=0.55.0 +XK6_VERSION=0.13.3 +XK6_SQL_VERSION=1.0.0 +XK6_SQL_POSTGRES_VERSION=0.1.0 # api-gateway API_GATEWAY_IMAGE=instill/api-gateway diff --git a/.github/workflows/helm-integration-test-backend.yml b/.github/workflows/helm-integration-test-backend.yml index c734f353..ef6f9751 100644 --- a/.github/workflows/helm-integration-test-backend.yml +++ b/.github/workflows/helm-integration-test-backend.yml @@ -49,7 +49,10 @@ jobs: - name: Install k6 run: | go install go.k6.io/xk6/cmd/xk6@v${{ env.XK6_VERSION }} - xk6 build v${{ env.K6_VERSION }} --with github.com/grafana/xk6-sql@v0.4.1 && sudo cp k6 /usr/bin + xk6 build v${{ env.K6_VERSION }} \ + --with github.com/grafana/xk6-sql@v${{ env.XK6_SQL_VERSION }} \ + --with github.com/grafana/xk6-sql-driver-postgres@v${{ env.XK6_SQL_POSTGRES_VERSION }} && \ + sudo cp k6 /usr/bin - name: Launch Helm Instill Core (${{ inputs.target }}) # Dummy GitHub OAuth configuration variables are inserted on diff --git a/.github/workflows/integration-test-backend.yml b/.github/workflows/integration-test-backend.yml index c313de0a..4d8ca3da 100644 --- a/.github/workflows/integration-test-backend.yml +++ b/.github/workflows/integration-test-backend.yml @@ -48,7 +48,10 @@ jobs: - name: Install k6 run: | go install go.k6.io/xk6/cmd/xk6@v${{ env.XK6_VERSION }} - xk6 build v${{ env.K6_VERSION }} --with github.com/grafana/xk6-sql@v0.4.1 && sudo cp k6 /usr/bin + xk6 build v${{ env.K6_VERSION }} \ + --with github.com/grafana/xk6-sql@v${{ env.XK6_SQL_VERSION }} \ + --with github.com/grafana/xk6-sql-driver-postgres@v${{ env.XK6_SQL_POSTGRES_VERSION }} && \ + sudo cp k6 /usr/bin - name: Launch Instill Core (${{ inputs.target }}) # CFG_COMPONENT_SECRETS_GITHUB* variables are injected to test OAuth diff --git a/.github/workflows/make-all.yml b/.github/workflows/make-all.yml index f6ddd79a..b936a3f6 100644 --- a/.github/workflows/make-all.yml +++ b/.github/workflows/make-all.yml @@ -36,11 +36,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version: ${{ env.GOLANG_VERSION }} - + - name: Install k6 run: | go install go.k6.io/xk6/cmd/xk6@v${{ env.XK6_VERSION }} - xk6 build v${{ env.K6_VERSION }} --with github.com/grafana/xk6-sql@v0.4.1 && sudo cp k6 /usr/bin + xk6 build v${{ env.K6_VERSION }} \ + --with github.com/grafana/xk6-sql@v${{ env.XK6_SQL_VERSION }} \ + --with github.com/grafana/xk6-sql-driver-postgres@v${{ env.XK6_SQL_POSTGRES_VERSION }} && \ + sudo cp k6 /usr/bin - name: Launch Instill Core (release) run: | diff --git a/.github/workflows/make-latest.yml b/.github/workflows/make-latest.yml index 89acc444..e0e612d5 100644 --- a/.github/workflows/make-latest.yml +++ b/.github/workflows/make-latest.yml @@ -40,11 +40,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version: ${{ env.GOLANG_VERSION }} - + - name: Install k6 run: | go install go.k6.io/xk6/cmd/xk6@v${{ env.XK6_VERSION }} - xk6 build v${{ env.K6_VERSION }} --with github.com/grafana/xk6-sql@v0.4.1 && sudo cp k6 /usr/bin + xk6 build v${{ env.K6_VERSION }} \ + --with github.com/grafana/xk6-sql@v${{ env.XK6_SQL_VERSION }} \ + --with github.com/grafana/xk6-sql-driver-postgres@v${{ env.XK6_SQL_POSTGRES_VERSION }} && \ + sudo cp k6 /usr/bin - name: Launch Instill Core (latest) run: | diff --git a/Dockerfile b/Dockerfile index ef8a5ed7..f7f2b613 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,12 @@ FROM golang:alpine${ALPINE_VERSION} AS base RUN apk add --update docker docker-compose docker-cli-compose docker-cli-buildx openrc containerd git bash make wget vim curl openssl util-linux -ARG XK6_VERSION K6_VERSION +ARG K6_VERSION XK6_VERSION XK6_SQL_VERSION XK6_SQL_POSTGRES_VERSION RUN go install go.k6.io/xk6/cmd/xk6@v${XK6_VERSION} -RUN xk6 build v${K6_VERSION} --with github.com/grafana/xk6-sql@v0.4.1 --output /usr/bin/k6 +RUN xk6 build v${K6_VERSION} \ + --with github.com/grafana/xk6-sql@v${XK6_SQL_VERSION} \ + --with github.com/grafana/xk6-sql-driver-postgres@v${XK6_SQL_POSTGRES_VERSION} \ + --output /usr/bin/k6 # Install Helm RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash diff --git a/Makefile b/Makefile index 6526acc7..60f4eea8 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,8 @@ build-latest: ## Build latest images for all services --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ --build-arg K6_VERSION=${K6_VERSION} \ --build-arg XK6_VERSION=${XK6_VERSION} \ + --build-arg XK6_SQL_VERSION=${XK6_SQL_VERSION} \ + --build-arg XK6_SQL_POSTGRES_VERSION=${XK6_SQL_POSTGRES_VERSION} \ --build-arg CACHE_DATE="$(shell date)" \ --target latest \ -t ${INSTILL_CORE_IMAGE_NAME}:latest .; \ @@ -112,6 +114,8 @@ build-release: ## Build release images for all services --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ --build-arg K6_VERSION=${K6_VERSION} \ --build-arg XK6_VERSION=${XK6_VERSION} \ + --build-arg XK6_SQL_VERSION=${XK6_SQL_VERSION} \ + --build-arg XK6_SQL_POSTGRES_VERSION=${XK6_SQL_POSTGRES_VERSION} \ --build-arg CACHE_DATE="$(shell date)" \ --build-arg API_GATEWAY_VERSION=${API_GATEWAY_VERSION} \ --build-arg MGMT_BACKEND_VERSION=${MGMT_BACKEND_VERSION} \