Skip to content

Commit

Permalink
chore: migrate from docker-compose v1 to docker compose v2 (#1522)
Browse files Browse the repository at this point in the history
* chore: migrate from docker-compose v1 to docker compose v2

* fix: move --log-level option to docker command
  • Loading branch information
reakaleek authored Aug 5, 2024
1 parent 51a9fb8 commit 8161234
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .ci/scripts/benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ NODEJS_VERSION=14

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
docker-compose -f ./dev-utils/docker-compose.yml down \
docker compose -f ./dev-utils/docker-compose.yml down \
--remove-orphans \
--volumes || true

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
docker-compose -f ./dev-utils/docker-compose.yml up \
docker compose -f ./dev-utils/docker-compose.yml up \
--build \
--abort-on-container-exit \
--exit-code-from node-benchmark \
Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/load-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ NODEJS_VERSION=14
USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker-compose -f ./dev-utils/docker-compose.yml down \
docker compose -f ./dev-utils/docker-compose.yml down \
--remove-orphans \
--volumes || true

USER_ID="${USER_ID}" \
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker-compose -f ./dev-utils/docker-compose.yml up \
docker compose -f ./dev-utils/docker-compose.yml up \
--build \
--exit-code-from load-testing \
load-testing
4 changes: 2 additions & 2 deletions .ci/scripts/pull_and_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ export NODEJS_VERSION=$(cat .nvmrc)
export STACK_VERSION=${STACK_VERSION:-8.6.1}

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

# We are building the images here even though the Docker images are already cached in Packer.
# This is because there could be changes in the PR affecting the files copied to the Docker image,
# which we want to test in the current build.
NODEJS_VERSION="${NODEJS_VERSION}" \
STACK_VERSION=${STACK_VERSION} \
docker-compose -f ./dev-utils/docker-compose.yml --log-level INFO build >docker-compose.log 2>docker-compose.err
docker --log-level INFO compose -f ./dev-utils/docker-compose.yml build >docker-compose.log 2>docker-compose.err
if [ $? -gt 0 ] ; then
echo "Docker compose failed, see the below log output"
cat docker-compose.log && rm docker-compose.log
Expand Down
5 changes: 2 additions & 3 deletions .ci/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ do
APM_SERVER_PORT=${APM_SERVER_PORT} \
APM_SERVER_URL=${APM_SERVER_URL} \
KIBANA_URL=${KIBANA_URL} \
docker-compose \
docker --log-level INFO compose \
-f ./dev-utils/docker-compose.yml \
--log-level INFO \
up \
--quiet-pull \
--exit-code-from node-puppeteer \
Expand All @@ -42,5 +41,5 @@ do
fi
sleep 5;
done
echo "Exit code from docker-compose ${status}"
echo "Exit code from docker compose ${status}"
exit ${status}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $ npx lerna bootstrap
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.

```sh
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker-compose -f ./dev-utils/docker-compose.yml up -d apm-server
NODEJS_VERSION=<nodeVersion> STACK_VERSION=<version> docker compose -f ./dev-utils/docker-compose.yml up -d apm-server
# nodeVersion - corresponds to NodeJS version to be used when building the test images
# version - corresponds to Elastic Stack versions
```
Expand Down
2 changes: 1 addition & 1 deletion packages/rum-core/test/run-apm-server.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ELASTICSEARCH_PORT=9201 STACK_VERSION=6.4.0 APM_SERVER_PORT=8001 docker-compose up apm-server kibana
ELASTICSEARCH_PORT=9201 STACK_VERSION=6.4.0 APM_SERVER_PORT=8001 docker compose up apm-server kibana
4 changes: 2 additions & 2 deletions packages/rum/test/run-apm-server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#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"
STACK_VERSION=6.2.4 APM_SERVER_PORT=8001 docker-compose up apm-server
#STACK_VERSION=6.2.4 docker-compose -f ./test/docker-compose.yml start apm-server
STACK_VERSION=6.2.4 APM_SERVER_PORT=8001 docker compose up apm-server
#STACK_VERSION=6.2.4 docker compose -f ./test/docker compose.yml start apm-server

0 comments on commit 8161234

Please sign in to comment.