mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
VERSION --arg-scope-and-set --pass-args --use-function-keyword 0.7
|
|
|
|
ARG core=github.com/formancehq/earthly:v0.9.0
|
|
IMPORT $core AS core
|
|
|
|
IMPORT ../.. AS stack
|
|
|
|
FROM core+base-image
|
|
|
|
k6:
|
|
FROM core+builder-image
|
|
DO --pass-args core+GO_INSTALL --package=go.k6.io/xk6/cmd/xk6@latest
|
|
COPY extension extension
|
|
ARG GOPROXY
|
|
RUN --mount type=cache,id=gopkgcache,target=$GOPATH/pkg/mod \
|
|
--mount type=cache,id=gobuild,target=/root/.cache/go-build \
|
|
xk6 build --with extension=/extension --with github.com/grafana/[email protected]
|
|
SAVE ARTIFACT /k6
|
|
|
|
run:
|
|
RUN apk update && apk add nodejs npm
|
|
COPY --pass-args +k6/k6 /bin/k6
|
|
COPY --dir scripts .
|
|
WORKDIR ./scripts
|
|
RUN npm install
|
|
RUN npm run build
|
|
WORKDIR /
|
|
COPY --dir tools .
|
|
WITH DOCKER \
|
|
--compose tools/docker-compose-simple.yml \
|
|
--load ghcr.io/formancehq/ledger:latest=../../components/ledger+build-image
|
|
RUN TEST_ID=$(date +%s)-v2 \
|
|
K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true \
|
|
K6_PROMETHEUS_RW_SERVER_URL=http://127.0.0.1:9090/api/v1/write \
|
|
POSTGRES_DSN=postgresql://ledger:ledger@postgres:5432/ledger?sslmode=disable \
|
|
DOCKER_NETWORK=default_benchmarks \
|
|
LEDGER_VERSION=latest \
|
|
sh -c 'sleep 10s && k6 run --summary-trend-stats="avg,min,med,max,p(90),p(95),p(99)" --out xk6-prometheus-rw scripts/dist/ledger-v2.js'
|
|
END |