From c81f1ead06032050a18ba05e1d53125acc4f33aa Mon Sep 17 00:00:00 2001 From: kentzeng12 <114431467+kentzeng12@users.noreply.github.com> Date: Thu, 25 Jul 2024 10:37:49 -0700 Subject: [PATCH] [buildkite] Fix integration docker test in buildkite pipeline (#4281) * uncomment integration docker test in pipeline * change name to label * fix indent --- .buildkite/pipeline.yml | 28 ++++++++++++++++--------- Dockerfile | 2 +- docker-compose.yml | 3 +++ scripts/docker-integration-tests/run.sh | 23 -------------------- 4 files changed, 22 insertions(+), 34 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d2e8e5d92f..605e114cfe 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -139,16 +139,24 @@ steps: - |- make clean lint <<: *common -# - name: "Integration (:docker:)" -# command: make clean install-vendor-m3 docker-integration-test -# parallelism: 2 -# env: -# CGO_ENABLED: 0 -# GIMME_GO_VERSION: 1.18.x -# plugins: -# gopath-checkout#v1.0.1: -# import: github.com/m3db/m3 -# <<: *common + - label: "Integration (:docker:)" + env: + CGO_ENABLED: 0 + GIMME_GO_VERSION: 1.18.x + plugins: + docker-compose#v2.5.1: + run: app + workdir: /go/src/github.com/m3db/m3 + kubernetes: + <<: *kubernetes + podSpec: + <<: *podSpec + containers: + - <<: *commandContainer + command: + - |- + make clean install-vendor-m3 docker-integration-test + <<: *common - label: "M3 Cluster Integration Tests" env: CGO_ENABLED: 0 diff --git a/Dockerfile b/Dockerfile index fdf0bb22bc..37e546ed53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM golang:1.18-bullseye -RUN apt-get update && apt-get install -y lsof +RUN apt-get update && apt-get install -y lsof netcat-openbsd docker.io jq diff --git a/docker-compose.yml b/docker-compose.yml index b45b16aea8..26a76cdbe5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,9 @@ services: - BUILDKITE_COMMIT - BUILDKITE_PULL_REQUEST - BUILDKITE_TAG + - BUILDKITE_PARALLEL_JOB=4 + - BUILDKITE_PARALLEL_JOB_COUNT=4 - CODECOV_TOKEN - SPLIT_IDX - TOTAL_SPLITS + - GOPATH=/go diff --git a/scripts/docker-integration-tests/run.sh b/scripts/docker-integration-tests/run.sh index bead15b207..bf1cb9bf8f 100755 --- a/scripts/docker-integration-tests/run.sh +++ b/scripts/docker-integration-tests/run.sh @@ -17,29 +17,6 @@ TESTS=( scripts/docker-integration-tests/prom_remote_write_backend/test.sh ) -# Some systems, including our default Buildkite hosts, don't come with netcat -# installed and we may not have perms to install it. "Install" it in the worst -# possible way. -if ! command -v nc && [[ "$BUILDKITE" == "true" ]]; then - echo "installing netcat" - NCDIR="$(mktemp -d)" - - yumdownloader -y --destdir "$NCDIR" --resolve nc - ( - cd "$NCDIR" - RPM=$(find . -maxdepth 1 -name '*.rpm' | tail -n1) - rpm2cpio "$RPM" | cpio -id - ) - - export PATH="$PATH:$NCDIR/usr/bin" - - function cleanup_nc() { - rm -rf "$NCDIR" - } - - trap cleanup_nc EXIT -fi - if [[ -z "$SKIP_SETUP" ]] || [[ "$SKIP_SETUP" == "false" ]]; then scripts/docker-integration-tests/setup.sh fi