Skip to content

Commit

Permalink
feat(ci): build k6 with sql plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallesm committed Sep 4, 2024
1 parent e6b6ea6 commit ef256b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:1.19-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
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .; \
Expand All @@ -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} \
Expand Down
4 changes: 0 additions & 4 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ services:
args:
SERVICE_NAME: ${MGMT_BACKEND_HOST}
GOLANG_VERSION: ${GOLANG_VERSION}
K6_VERSION: ${K6_VERSION}

pipeline_backend:
profiles:
Expand All @@ -46,7 +45,6 @@ services:
args:
SERVICE_NAME: ${PIPELINE_BACKEND_HOST}
GOLANG_VERSION: ${GOLANG_VERSION}
K6_VERSION: ${K6_VERSION}

model_backend:
profiles:
Expand All @@ -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}

Expand Down Expand Up @@ -106,4 +103,3 @@ services:
args:
SERVICE_NAME: ${ARTIFACT_BACKEND_HOST}
GOLANG_VERSION: ${GOLANG_VERSION}
K6_VERSION: ${K6_VERSION}

0 comments on commit ef256b1

Please sign in to comment.