diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 12ed82dc28..4c5f9abc26 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -183,16 +183,27 @@ steps: - |- make clean test-ci-test-harness <<: *common -# - name: "Prometheus compatibility (:docker:)" -# command: make clean install-vendor-m3 docker-compatibility-test -# parallelism: 1 -# env: -# CGO_ENABLED: 0 -# GIMME_GO_VERSION: 1.22.x -# plugins: -# gopath-checkout#v1.0.1: -# import: github.com/m3db/m3 -# <<: *common + - name: "Prometheus compatibility (:docker:)" + parallelism: 1 + env: + CGO_ENABLED: 0 + GIMME_GO_VERSION: 1.22.x + plugins: + gopath-checkout#v1.0.1: + import: github.com/m3db/m3 + 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-compatibility-test + <<: *common - name: "Integration (dbnode Recently Read) %n" parallelism: 2 plugins: diff --git a/Dockerfile b/Dockerfile index 98b67e1b25..66e5c81d6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM golang:1.22-bullseye -RUN apt-get update && apt-get install -y lsof netcat-openbsd docker.io jq +RUN apt-get update && apt-get install -y lsof netcat-openbsd docker.io jq docker-compose diff --git a/scripts/comparator/compare.go b/scripts/comparator/compare.go index 9ebbc38a06..8ea99a1e47 100644 --- a/scripts/comparator/compare.go +++ b/scripts/comparator/compare.go @@ -52,8 +52,8 @@ func main() { now = time.Now() pQueryFile = flag.String("input", "", "the query file") - pPromAddress = flag.String("promAdress", "0.0.0.0:9090", "prom address") - pQueryAddress = flag.String("queryAddress", "0.0.0.0:7201/m3query", "M3 query address") + pPromAddress = flag.String("promAdress", "host.docker.internal:7201/m3query", "prom address") + pQueryAddress = flag.String("queryAddress", "host.docker.internal:7201/m3query", "M3 query address") pComparatorAddress = flag.String("comparator", "", "comparator address") pRegressionDir = flag.String("regressionDir", "", "optional directory for regression tests") diff --git a/scripts/comparator/docker-compose.yml b/scripts/comparator/docker-compose.yml index 79bd8d4f2a..c30b99715a 100755 --- a/scripts/comparator/docker-compose.yml +++ b/scripts/comparator/docker-compose.yml @@ -21,7 +21,7 @@ services: - backend image: "m3query:${REVISION}" volumes: - - "./m3query.yml:/etc/m3query/m3query.yml" + - .:/go/src/github.com/m3db/m3 prometheus: expose: - "9090" @@ -31,7 +31,7 @@ services: - backend image: prom/prometheus:v2.31.2 volumes: - - "./:/etc/prometheus/" + - .:/go/src/github.com/m3db/m3 grafana: build: context: ./grafana diff --git a/scripts/comparator/docker-setup.sh b/scripts/comparator/docker-setup.sh index 0fe3c9e0ce..f61c9db922 100755 --- a/scripts/comparator/docker-setup.sh +++ b/scripts/comparator/docker-setup.sh @@ -10,8 +10,8 @@ function setup_docker { echo "Run m3query, m3comparator, and prometheus containers" docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes m3comparator docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes prometheus - docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes m3query - + docker-compose -f ${COMPOSE_FILE} up -d --build --renew-anon-volumes m3query + CI=$1 if [[ "$CI" != "true" ]] then diff --git a/scripts/comparator/run.sh b/scripts/comparator/run.sh index ea5c05d781..cc45035ee3 100755 --- a/scripts/comparator/run.sh +++ b/scripts/comparator/run.sh @@ -17,7 +17,7 @@ export DASHBOARD=$GRAFANA_PATH/dash.json.out export END=${END:-$(date +%s)} export START=${START:-$(( $END - 10800 ))} # TODO: make this a bit less hacky in the future; e.g. take from config. -export COMPARATOR_WRITE="localhost:9001" +export COMPARATOR_WRITE="host.docker.internal:9001" function generate_dash { TEMPLATE=$GRAFANA_PATH/dashboard.tmpl @@ -65,7 +65,7 @@ function defer { if [[ "$RUN_ONLY" == "false" ]] then - trap defer EXIT + trap defer EXIT fi $comparator -input=$QUERY_FILE \ diff --git a/src/query/config/m3query-dev-remote.yml b/src/query/config/m3query-dev-remote.yml index 560830e9fd..1f9c91596f 100644 --- a/src/query/config/m3query-dev-remote.yml +++ b/src/query/config/m3query-dev-remote.yml @@ -5,7 +5,7 @@ backend: grpc rpc: remotes: - name: "remote" - remoteListenAddresses: ["localhost:9000"] + remoteListenAddresses: ["m3comparator:9000"] metrics: scope: diff --git a/src/query/test/compatibility/test.go b/src/query/test/compatibility/test.go index d6ae66954c..92df93ea85 100644 --- a/src/query/test/compatibility/test.go +++ b/src/query/test/compatibility/test.go @@ -90,7 +90,7 @@ func NewTest(t testutil.T, input string) (*Test, error) { test := &Test{ T: t, cmds: []testCommand{}, - m3comparator: newM3ComparatorClient("localhost", 9001), + m3comparator: newM3ComparatorClient("host.docker.internal", 9001), } err := test.parse(input) if err != nil { @@ -371,7 +371,7 @@ func newEvalCmd(expr string, start time.Time, line int) *evalCmd { metrics: map[uint64]labels.Labels{}, expected: map[uint64]entry{}, - m3query: newM3QueryClient("localhost", 7201), + m3query: newM3QueryClient("host.docker.internal", 7201), } }