diff --git a/.env b/.env index c539d65a..93480029 100644 --- a/.env +++ b/.env @@ -43,6 +43,7 @@ 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 # api-gateway API_GATEWAY_IMAGE=instill/api-gateway diff --git a/Dockerfile b/Dockerfile index 58a2036b..1fa22747 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,11 @@ FROM 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 # Install k6 -ARG TARGETARCH K6_VERSION -ADD https://github.com/grafana/k6/releases/download/v${K6_VERSION}/k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz -RUN tar -xf k6-v${K6_VERSION}-linux-$TARGETARCH.tar.gz --strip-components 1 -C /usr/bin +ARG TARGETARCH K6_VERSION XK6_VERSION + +FROM golang:alpine${ALPINE_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 --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 9c36fc19..fe294df7 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ build-latest: ## Build latest images for all Instill Core components --build-arg ALPINE_VERSION=${ALPINE_VERSION} \ --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ --build-arg K6_VERSION=${K6_VERSION} \ + --build-arg XK6_VERSION=${XK6_VERSION} \ --build-arg CACHE_DATE="$(shell date)" \ --target latest \ -t ${INSTILL_CORE_IMAGE_NAME}:latest .; \ @@ -108,6 +109,7 @@ build-release: ## Build release images for all Instill Core components --build-arg ALPINE_VERSION=${ALPINE_VERSION} \ --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ --build-arg K6_VERSION=${K6_VERSION} \ + --build-arg XK6_VERSION=${XK6_VERSION} \ --build-arg CACHE_DATE="$(shell date)" \ --build-arg API_GATEWAY_VERSION=${API_GATEWAY_VERSION} \ --build-arg MGMT_BACKEND_VERSION=${MGMT_BACKEND_VERSION} \ diff --git a/docker-compose-build.yml b/docker-compose-build.yml index 801d48de..e8724d6d 100644 --- a/docker-compose-build.yml +++ b/docker-compose-build.yml @@ -30,7 +30,6 @@ services: args: SERVICE_NAME: ${MGMT_BACKEND_HOST} GOLANG_VERSION: ${GOLANG_VERSION} - K6_VERSION: ${K6_VERSION} pipeline_backend: profiles: @@ -46,7 +45,6 @@ services: args: SERVICE_NAME: ${PIPELINE_BACKEND_HOST} GOLANG_VERSION: ${GOLANG_VERSION} - K6_VERSION: ${K6_VERSION} model_backend: profiles: @@ -62,7 +60,6 @@ services: args: SERVICE_NAME: ${MODEL_BACKEND_HOST} GOLANG_VERSION: ${GOLANG_VERSION} - K6_VERSION: ${K6_VERSION} UBUNTU_VERSION: ${UBUNTU_VERSION} ARTIVC_VERSION: ${ARTIVC_VERSION} @@ -106,4 +103,3 @@ services: args: SERVICE_NAME: ${ARTIFACT_BACKEND_HOST} GOLANG_VERSION: ${GOLANG_VERSION} - K6_VERSION: ${K6_VERSION}