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

fix(ci): use xk6-sql driver and pin down versions #1159

Merged
merged 1 commit into from
Nov 26, 2024
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
6 changes: 4 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/helm-integration-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/integration-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/make-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donch1989 do the make-* workflows need this step? I don't see where they are referenced and the workflow itself doesn't need k6

--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: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/make-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .; \
Expand Down Expand Up @@ -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} \
Expand Down