Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buildkite] Fix "Prometheus compatibility (:docker:)" test in buildkite pipeline #4295

Merged
merged 93 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
301446f
comment out other tests
kentzeng12 Aug 26, 2024
3e0fe68
add make to dockerfile
kentzeng12 Aug 26, 2024
ea440fb
remove make, and add kubernetes plugin
kentzeng12 Aug 26, 2024
9f722d7
add docker-compose
kentzeng12 Aug 26, 2024
c4c6b12
add docker-compose to dockerfile
kentzeng12 Aug 26, 2024
c67f91d
update m3query volumes in docker-compose
kentzeng12 Aug 26, 2024
d922e6c
comment out trap defer EXIT command in run.sh
kentzeng12 Aug 26, 2024
c10fd72
uncomment previous code
kentzeng12 Aug 26, 2024
fc865d8
experimenting with commenting out rest of run.sh
kentzeng12 Aug 26, 2024
66e7dc7
comment out everything except for line 51 and 52 at the end of run.sh
kentzeng12 Aug 26, 2024
52281cf
uncomment lines 53-69
kentzeng12 Aug 26, 2024
c907f2a
uncomment lines 71-75
kentzeng12 Aug 26, 2024
ead72c2
comment out lines 71 to 75 and uncomment go test in run.sh
kentzeng12 Aug 26, 2024
055b09a
check if prometheus container is running
kentzeng12 Aug 26, 2024
40dd69d
adding logs to check prometheus container not running
kentzeng12 Aug 26, 2024
d016524
update volume mount for prometheus in docker-compose
kentzeng12 Aug 26, 2024
dff9a73
modify right hand side of volume mount for prometheus in docker-compose
kentzeng12 Aug 26, 2024
6ada8c5
try another volume mount for prometheus
kentzeng12 Aug 26, 2024
b91746f
remove volume mounts to see what happens in docker-compose
kentzeng12 Aug 26, 2024
b9ea790
add back logs in docker-setup
kentzeng12 Aug 26, 2024
fc8e967
try adding prometheusURL to run.sh
kentzeng12 Aug 26, 2024
4790b1e
change localhost to host.docker.internal
kentzeng12 Aug 27, 2024
31f1737
check for firewall
kentzeng12 Aug 27, 2024
af547b8
add sudo to dockerfile
kentzeng12 Aug 27, 2024
12c6f20
add ufw to dockerfile
kentzeng12 Aug 27, 2024
63956f4
inspect prometheus docker container for network issues
kentzeng12 Aug 27, 2024
c7e5209
modify docker inspect command
kentzeng12 Aug 27, 2024
5d0d90d
add back volume mount for prometheus
kentzeng12 Aug 27, 2024
71d5c5d
fix typo in volume mount
kentzeng12 Aug 27, 2024
099edb8
fix another typo in volume mount for prometheus
kentzeng12 Aug 27, 2024
dc39fcc
find the current directory to fix volume mount
kentzeng12 Aug 27, 2024
cb173ac
update volume mount for prometheus with new directory
kentzeng12 Aug 27, 2024
033e0fd
fix typo
kentzeng12 Aug 27, 2024
9b10e0c
rewrite volume mount
kentzeng12 Aug 27, 2024
7257065
list out contents in host machine
kentzeng12 Aug 27, 2024
74650d9
move ls, and pwd
kentzeng12 Aug 27, 2024
38cb15d
use absolute path for volume mount
kentzeng12 Aug 27, 2024
6814f39
add volume mount for m3query
kentzeng12 Aug 27, 2024
91c406d
update m3query volume mount
kentzeng12 Aug 27, 2024
43da619
update volume mount again for prometheus
kentzeng12 Aug 27, 2024
aba59e2
another volume mount configuration
kentzeng12 Aug 27, 2024
5575430
another volume mount configuration
kentzeng12 Aug 27, 2024
10520cd
try another way to volume mount
kentzeng12 Aug 27, 2024
3a3fd3b
add m3query.yml
kentzeng12 Aug 27, 2024
a70f7d9
add external:true
kentzeng12 Aug 27, 2024
94a1a56
try using quotes
kentzeng12 Aug 27, 2024
014c46d
remove volume mount for m3query
kentzeng12 Aug 27, 2024
faf9a34
add docker inspect for m3query
kentzeng12 Aug 27, 2024
a7bb0ab
try adding another app
kentzeng12 Aug 27, 2024
076044d
change to localhost
kentzeng12 Aug 28, 2024
121cb62
use external to create volume mounts
kentzeng12 Aug 28, 2024
ca242de
add pwd to see why we can't find run.sh
kentzeng12 Aug 28, 2024
6230a00
try another volume mount
kentzeng12 Aug 28, 2024
cb5b41b
use host docker internal
kentzeng12 Aug 28, 2024
5c5dbe5
add host.docker.internal to queryaddress
kentzeng12 Aug 28, 2024
69d9dc7
did we get here?
kentzeng12 Aug 28, 2024
475b747
add logging for response body
kentzeng12 Aug 28, 2024
d2bdff2
test
kentzeng12 Aug 28, 2024
ca574ac
update volume mount for m3query
kentzeng12 Aug 28, 2024
ab8fe4e
add slash to volume mount
kentzeng12 Aug 28, 2024
4b0174f
comment out volume mount to see what happens
kentzeng12 Aug 28, 2024
ab35f11
try deleting random CMD in m3comparator
kentzeng12 Aug 28, 2024
5dd2f18
add m3comparator
kentzeng12 Aug 28, 2024
6eb180f
add logs to see promResult and queryResult
kentzeng12 Aug 28, 2024
3d0751b
don't use deprecated readall
kentzeng12 Aug 28, 2024
37155fd
add log for querygroups
kentzeng12 Aug 28, 2024
bc23d99
remove fetch querygroup
kentzeng12 Aug 28, 2024
6448287
add back fetch query group
kentzeng12 Aug 28, 2024
d93e50f
change comparator_write
kentzeng12 Aug 28, 2024
bd1225f
add log to find endpoint
kentzeng12 Aug 28, 2024
05db6e2
only log the promResult
kentzeng12 Aug 29, 2024
77ead0d
only log the prometheus result actually
kentzeng12 Aug 29, 2024
c338de8
log queries
kentzeng12 Sep 11, 2024
a9a6819
switch to using ioutil, and remove some logs
kentzeng12 Sep 11, 2024
0302873
test revert back to localhost:9000 for m3query-dev-remote
kentzeng12 Sep 11, 2024
5fbef1d
revert back to m3comparator:9000, else we get 500 error
kentzeng12 Sep 11, 2024
640eb7e
revert back to localhost for comparator in run.sh to test
kentzeng12 Sep 11, 2024
1f0f2cd
revert promAddress to 0.0.0.0 to test
kentzeng12 Sep 11, 2024
2b8907f
add back volume mount to m3query container
kentzeng12 Sep 11, 2024
562715c
update volume mount for m3query
kentzeng12 Sep 11, 2024
62fae3f
change promAddress to queryAddress
kentzeng12 Sep 11, 2024
85b2354
add comparator address
kentzeng12 Sep 11, 2024
1aeba01
change to m3comparator:9001
kentzeng12 Sep 11, 2024
a9b9396
change to host.docker.internal instead of m3comparator
kentzeng12 Sep 11, 2024
721609e
uncomment last command in run.sh
kentzeng12 Sep 11, 2024
7e135a2
change test to host.docker.internal
kentzeng12 Sep 11, 2024
afb11c6
change m3query to host.docker.internal
kentzeng12 Sep 11, 2024
0777c6e
uncomment rest of pipeline tests
kentzeng12 Sep 11, 2024
943d190
comment out documentation tests
kentzeng12 Sep 11, 2024
4d5c8c0
add back CMD in m3comparator.dockerfile
kentzeng12 Sep 11, 2024
28a8364
add space in dockerfile
kentzeng12 Sep 11, 2024
31f1846
remove logs and clean up temp code
kentzeng12 Sep 11, 2024
7bb9923
Merge branch 'master' into zengk/prometheus
kentzeng12 Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions scripts/comparator/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions scripts/comparator/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/comparator/docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/comparator/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,7 +65,7 @@ function defer {

if [[ "$RUN_ONLY" == "false" ]]
then
trap defer EXIT
trap defer EXIT
fi

$comparator -input=$QUERY_FILE \
Expand Down
2 changes: 1 addition & 1 deletion src/query/config/m3query-dev-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ backend: grpc
rpc:
remotes:
- name: "remote"
remoteListenAddresses: ["localhost:9000"]
remoteListenAddresses: ["m3comparator:9000"]

metrics:
scope:
Expand Down
4 changes: 2 additions & 2 deletions src/query/test/compatibility/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kentzeng12 is this only called from a docker context? (afaict answer is yes, so this is okay).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's being run in the buildkite, which runs the test in a docker container, yes it's called in a docker context, but like you mentioned if you run this locally we run into issues.

}
}

Expand Down