Skip to content

Commit 8161234

Browse files
authored
chore: migrate from docker-compose v1 to docker compose v2 (#1522)
* chore: migrate from docker-compose v1 to docker compose v2 * fix: move --log-level option to docker command
1 parent 51a9fb8 commit 8161234

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

.ci/scripts/benchmarks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ NODEJS_VERSION=14
88

99
USER_ID="${USER_ID}" \
1010
NODEJS_VERSION="${NODEJS_VERSION}" \
11-
docker-compose -f ./dev-utils/docker-compose.yml down \
11+
docker compose -f ./dev-utils/docker-compose.yml down \
1212
--remove-orphans \
1313
--volumes || true
1414

1515
USER_ID="${USER_ID}" \
1616
NODEJS_VERSION="${NODEJS_VERSION}" \
17-
docker-compose -f ./dev-utils/docker-compose.yml up \
17+
docker compose -f ./dev-utils/docker-compose.yml up \
1818
--build \
1919
--abort-on-container-exit \
2020
--exit-code-from node-benchmark \

.ci/scripts/load-testing.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ NODEJS_VERSION=14
1010
USER_ID="${USER_ID}" \
1111
NODEJS_VERSION="${NODEJS_VERSION}" \
1212
STACK_VERSION=${STACK_VERSION} \
13-
docker-compose -f ./dev-utils/docker-compose.yml down \
13+
docker compose -f ./dev-utils/docker-compose.yml down \
1414
--remove-orphans \
1515
--volumes || true
1616

1717
USER_ID="${USER_ID}" \
1818
NODEJS_VERSION="${NODEJS_VERSION}" \
1919
STACK_VERSION=${STACK_VERSION} \
20-
docker-compose -f ./dev-utils/docker-compose.yml up \
20+
docker compose -f ./dev-utils/docker-compose.yml up \
2121
--build \
2222
--exit-code-from load-testing \
2323
load-testing

.ci/scripts/pull_and_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ export NODEJS_VERSION=$(cat .nvmrc)
33
export STACK_VERSION=${STACK_VERSION:-8.6.1}
44

55
STACK_VERSION=${STACK_VERSION} \
6-
docker-compose -f ./dev-utils/docker-compose.yml --log-level INFO pull --quiet --ignore-pull-failures
6+
docker --log-level INFO compose -f ./dev-utils/docker-compose.yml pull --quiet --ignore-pull-failures
77

88
# We are building the images here even though the Docker images are already cached in Packer.
99
# This is because there could be changes in the PR affecting the files copied to the Docker image,
1010
# which we want to test in the current build.
1111
NODEJS_VERSION="${NODEJS_VERSION}" \
1212
STACK_VERSION=${STACK_VERSION} \
13-
docker-compose -f ./dev-utils/docker-compose.yml --log-level INFO build >docker-compose.log 2>docker-compose.err
13+
docker --log-level INFO compose -f ./dev-utils/docker-compose.yml build >docker-compose.log 2>docker-compose.err
1414
if [ $? -gt 0 ] ; then
1515
echo "Docker compose failed, see the below log output"
1616
cat docker-compose.log && rm docker-compose.log

.ci/scripts/test.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ do
2828
APM_SERVER_PORT=${APM_SERVER_PORT} \
2929
APM_SERVER_URL=${APM_SERVER_URL} \
3030
KIBANA_URL=${KIBANA_URL} \
31-
docker-compose \
31+
docker --log-level INFO compose \
3232
-f ./dev-utils/docker-compose.yml \
33-
--log-level INFO \
3433
up \
3534
--quiet-pull \
3635
--exit-code-from node-puppeteer \
@@ -42,5 +41,5 @@ do
4241
fi
4342
sleep 5;
4443
done
45-
echo "Exit code from docker-compose ${status}"
44+
echo "Exit code from docker compose ${status}"
4645
exit ${status}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $ npx lerna bootstrap
8686
Tests fall under unit, integration and end-to-end tests. Before running the test, we have to start the APM server manually since all the APM payload data are sent to the server.
8787

8888
```sh
89-
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker-compose -f ./dev-utils/docker-compose.yml up -d apm-server
89+
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker compose -f ./dev-utils/docker-compose.yml up -d apm-server
9090
# nodeVersion - corresponds to NodeJS version to be used when building the test images
9191
# version - corresponds to Elastic Stack versions
9292
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ELASTICSEARCH_PORT=9201 STACK_VERSION=6.4.0 APM_SERVER_PORT=8001 docker-compose up apm-server kibana
1+
ELASTICSEARCH_PORT=9201 STACK_VERSION=6.4.0 APM_SERVER_PORT=8001 docker compose up apm-server kibana
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#docker run -p 127.0.0.1:8200:8201 elastic/apm-server:6.2.4 /bin/sh -c "apm-server -e -E output.elasticsearch.password=$(ELASTICSEARCH_PASSWORD) -E output.elasticsearch.username=$(ELASTICSEARCH_USERNAME) -E output.elasticsearch.hosts=['$(ELASTICSEARCH_SERVICE_HOST):$(ELASTICSEARCH_SERVICE_PORT)'] -E apm-server.expvar.enabled=true -E apm-server.frontend.enabled=true -E apm-server.frontend.rate_limit=100000 -E apm-server.host=0.0.0.0:8200 -E apm-server.read_timeout=1m -E apm-server.shutdown_timeout=2m -E apm-server.write_timeout=1m"
2-
STACK_VERSION=6.2.4 APM_SERVER_PORT=8001 docker-compose up apm-server
3-
#STACK_VERSION=6.2.4 docker-compose -f ./test/docker-compose.yml start apm-server
2+
STACK_VERSION=6.2.4 APM_SERVER_PORT=8001 docker compose up apm-server
3+
#STACK_VERSION=6.2.4 docker compose -f ./test/docker compose.yml start apm-server

0 commit comments

Comments
 (0)