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

ci(fix): use docker compose v2 instead of v1 #1146

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export ELASTIC_APM_PHP_TESTS_MYSQL_PORT=43306

dockerComposeCmdFilesPart="-f ${thisScriptDir}/docker-compose_external_services_for_component_tests.yml"
dockerComposeCmdFilesPart="${dockerComposeCmdFilesPart} -f ${thisScriptDir}/docker-compose_external_services_for_component_tests_on_host.yml"
export ELASTIC_APM_PHP_TESTS_EXTERNAL_SERVICES_START_CMD="docker-compose ${dockerComposeCmdFilesPart} up -d"
export ELASTIC_APM_PHP_TESTS_EXTERNAL_SERVICES_START_CMD="docker compose ${dockerComposeCmdFilesPart} up -d"
2 changes: 1 addition & 1 deletion .ci/start_external_services_for_component_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ thisScriptDir="$( dirname "${BASH_SOURCE[0]}" )"
thisScriptDir="$( realpath "${thisScriptDir}" )"

if [ -z "${ELASTIC_APM_PHP_TESTS_EXTERNAL_SERVICES_START_CMD}" ] ; then
export ELASTIC_APM_PHP_TESTS_EXTERNAL_SERVICES_START_CMD="docker-compose -f ${thisScriptDir}/docker-compose_external_services_for_component_tests.yml up -d"
export ELASTIC_APM_PHP_TESTS_EXTERNAL_SERVICES_START_CMD="docker compose -f ${thisScriptDir}/docker-compose_external_services_for_component_tests.yml up -d"
fi

run_command_with_timeout_and_retries_args=(--retry-on-error=yes)
Expand Down
2 changes: 1 addition & 1 deletion .ci/stop_external_services_for_component_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -xe
thisScriptDir="$( dirname "${BASH_SOURCE[0]}" )"
thisScriptDir="$( realpath "${thisScriptDir}" )"

docker-compose -f "${thisScriptDir}/docker-compose_external_services_for_component_tests.yml" down -v --remove-orphans
docker compose -f "${thisScriptDir}/docker-compose_external_services_for_component_tests.yml" down -v --remove-orphans
8 changes: 4 additions & 4 deletions .github/workflows/phpt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
VERSION=${{ matrix.php-version }}
VERSION_SHORT=${VERSION//./}
cd agent/extension_phpt_test
docker-compose build elasticsearch apm-server phpt_${VERSION_SHORT}
docker-compose up -d elasticsearch apm-server
docker-compose run phpt_${VERSION_SHORT}
docker-compose stop
docker compose build elasticsearch apm-server phpt_${VERSION_SHORT}
docker compose up -d elasticsearch apm-server
docker compose run phpt_${VERSION_SHORT}
docker compose stop
# exit 0
- if: success() || failure()
name: Change results ownership
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ If you want to update images used to build native extension, you need to go into
`Dockerfile_musl` for Linux x86_64 with musl libc implementation and `Dockerfile_glibc` for all other x86_64 distros with glibc implementation.
Then you need to increment image version in `docker-compose.yml`. Remember to update Dockerfiles for all architectures, if needed. To build new images, you just need to call:
```bash
docker-compose build
docker compose build
```
It will build images for all supported architectures. As a result you should get summary like this:
```bash
Expand Down Expand Up @@ -160,7 +160,7 @@ If you want to update images used for testing, you need to go into `packaging/te
Then you need to increment image version in `docker-compose.yml`.\
To build new images, you just need to call:
```bash
docker-compose build
docker compose build
```
It will build and tag images for all test scenarios. As a result you should get summary like this:
```bash
Expand Down
14 changes: 7 additions & 7 deletions agent/extension_phpt_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To run the tests, you must first build the agent binaries for the `linux-x86-64-

```
cd apm-agent-php/agent/extension_phpt_test
docker-compose up --build
docker compose up --build
```

It will start up elastic search and apm-server and execute tests for all supported PHP releases.
Expand All @@ -38,7 +38,7 @@ In this example we will run all tests with PHP 8.2

```
cd apm-agent-php/agent/extension_phpt_test
docker-compose up elasticsearch apm-server phpt_82
docker compose up elasticsearch apm-server phpt_82
```
It will start up elastic search and apm-server and execute tests for PHP 8.2.

Expand All @@ -48,8 +48,8 @@ In this example we will run test with PHP 8.2

```
cd apm-agent-php/agent/extension_phpt_test
docker-compose build phpt_82 elasticsearch apm-server
docker-compose run --rm phpt_82 /scripts/run.sh tests/output/ob_start_error_005.phpt
docker compose build phpt_82 elasticsearch apm-server
docker compose run --rm phpt_82 /scripts/run.sh tests/output/ob_start_error_005.phpt
```

### Run bunch of tests from a folder
Expand All @@ -58,8 +58,8 @@ In this example we will run test with PHP 8.2

```
cd apm-agent-php/agent/extension_phpt_test
docker-compose build phpt_82 elasticsearch apm-server
docker-compose run --rm phpt_82 /scripts/run.sh tests/output
docker compose build phpt_82 elasticsearch apm-server
docker compose run --rm phpt_82 /scripts/run.sh tests/output
```

### Core dump examination with gdb
Expand All @@ -68,7 +68,7 @@ In order to diagnose a core dump, you need to run the image together with the mo

```
cd apm-agent-php/agent/extension_phpt_test
docker-compose run -v /path/to/coredumps:/path/to/coredumps phpt_82 /bin/bash
docker compose run -v /path/to/coredumps:/path/to/coredumps phpt_82 /bin/bash
```
then inside runnning container:
```
Expand Down
8 changes: 4 additions & 4 deletions agent/extension_phpt_test/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# if you want to run only that one test, execute scipt with test or folder name
# example: docker-compose run --rm phpt_82 /scripts/run.sh tests/output
# example: docker-compose run --rm phpt_82 /scripts/run.sh tests/output/ob_start_error_005.phpt
# example: docker compose run --rm phpt_82 /scripts/run.sh tests/output
# example: docker compose run --rm phpt_82 /scripts/run.sh tests/output/ob_start_error_005.phpt
TEST_OR_DIRECTORY_TO_EXECUTE=$1

PHP_VERSION=`php-config --version`
Expand All @@ -24,7 +24,7 @@ elif [ $PHP_VERSION == "8.2" ]; then
fi

mkdir -m 666 -p /results/${PHP_VERSION}
echo "Making results directory /results/${PHP_VERSION} resultCode: $?"
echo "Making results directory /results/${PHP_VERSION} resultCode: $?"

RESULT_PREFIX=`date -u +"%Y%m%d_%H%M%S-"`

Expand Down Expand Up @@ -136,4 +136,4 @@ compress_test_results ${TEST_FAILED_WITH_AGENT_ARCH}
--failed_with_agent ${TEST_FAILED_WITH_AGENT} --failed_without_agent ${TEST_FAILED_WITHOUT_AGENT} \
--results_with_agent ${TEST_RESULTS_WITH_AGENT} --results_without_agent ${TEST_RESULTS_WITHOUT_AGENT} \
--segfaults_with_agent ${TEST_SEGFAULTS_WITH_AGENT} --segfaults_without_agent ${TEST_SEGFAULTS_WITHOUT_AGENT} \
--markdown ${TEST_RESULTS_MD}
--markdown ${TEST_RESULTS_MD}
4 changes: 2 additions & 2 deletions demos/CakePHP/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Set up application.

```
$ docker-compose build
$ docker-compose up
$ docker compose build
$ docker compose up
```
After it open the next link
```
Expand Down
4 changes: 2 additions & 2 deletions demos/Codeigniter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Setup application.

```
$ docker-compose build
$ docker-compose up
$ docker compose build
$ docker compose up
```

Application url:
Expand Down
4 changes: 2 additions & 2 deletions demos/Laminas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Setup application with the next commands.

```
$ docker-compose build
$ docker-compose up
$ docker compose build
$ docker compose up
```

Application url:
Expand Down
4 changes: 2 additions & 2 deletions demos/Laminas/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"Unable to load application.\n"
. "- Type `composer install` if you are developing locally.\n"
. "- Type `vagrant ssh -c 'composer install'` if you are using Vagrant.\n"
. "- Type `docker-compose run laminas composer install` if you are using Docker.\n"
. "- Type `docker compose run laminas composer install` if you are using Docker.\n"
);
}

Expand Down Expand Up @@ -75,7 +75,7 @@
// "Unable to load application.\n"
// . "- Type `composer install` if you are developing locally.\n"
// . "- Type `vagrant ssh -c 'composer install'` if you are using Vagrant.\n"
// . "- Type `docker-compose run laminas composer install` if you are using Docker.\n"
// . "- Type `docker compose run laminas composer install` if you are using Docker.\n"
// );
//}
//
Expand Down
4 changes: 2 additions & 2 deletions demos/Magento/README-ELASTIC.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to set up ?
```
1. docker-compose build
2. docker-compose up
1. docker compose build
2. docker compose up
```

1. Fronted:
Expand Down
20 changes: 10 additions & 10 deletions demos/Magento/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Trademarks: This software listing is packaged by Bitnami. The respective tradema

```console
$ curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-magento/master/docker-compose.yml > docker-compose.yml
$ docker-compose up -d
$ docker compose up -d
```

**Warning**: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the [Environment Variables](#environment-variables) section for a more secure deployment.
Expand Down Expand Up @@ -71,7 +71,7 @@ The main folder of this repository contains a functional [`docker-compose.yml`](

```console
$ curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-magento/master/docker-compose.yml > docker-compose.yml
$ docker-compose up -d
$ docker compose up -d
```

### Using the Docker Command Line
Expand Down Expand Up @@ -225,9 +225,9 @@ When the container is executed for the first time, it will execute the files wit

### Environment variables

When you start the Magento image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the `docker run` command line. If you want to add a new environment variable:
When you start the Magento image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker compose file or on the `docker run` command line. If you want to add a new environment variable:

* For docker-compose add the variable name and value under the application section in the [`docker-compose.yml`](https://github.com/bitnami/bitnami-docker-magento/blob/master/docker-compose.yml) file present in this repository:
* For docker compose add the variable name and value under the application section in the [`docker-compose.yml`](https://github.com/bitnami/bitnami-docker-magento/blob/master/docker-compose.yml) file present in this repository:

```yaml
magento:
Expand Down Expand Up @@ -345,7 +345,7 @@ $ docker logs magento
Or using Docker Compose:

```console
$ docker-compose logs magento
$ docker compose logs magento
```

You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver.
Expand All @@ -365,7 +365,7 @@ $ docker stop magento
Or using Docker Compose:

```console
$ docker-compose stop magento
$ docker compose stop magento
```

#### Step 2: Run the backup command
Expand Down Expand Up @@ -505,7 +505,7 @@ $ docker stop magento
Or using Docker Compose:

```console
$ docker-compose stop magento
$ docker compose stop magento
```

#### Upgrading bundled image components
Expand All @@ -523,7 +523,7 @@ $ docker pull bitnami/magento:latest
Stop the currently running container using the command

```console
$ docker-compose stop magento
$ docker compose stop magento
```

##### Step 3: Take a snapshot of the application state
Expand All @@ -535,15 +535,15 @@ Follow the steps in [Backing up your container](#backing-up-your-container) to t
Remove the currently running container by executing the following command:

```console
docker-compose rm -v magento
docker compose rm -v magento
```

##### Step 5: Run the new image

Update the image tag in `docker-compose.yml` and re-create your container with the new image:

```console
$ docker-compose up -d
$ docker compose up -d
```

## Customize this image
Expand Down
2 changes: 1 addition & 1 deletion demos/Shopware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ When you update the image version, automatically all required migrations will ru

# Running multiple containers

See `docker-compose-advanced.yml` for a full docker-compose example.
See `docker-compose-advanced.yml` for a full docker compose example.

## Mode: default

Expand Down
4 changes: 2 additions & 2 deletions demos/Shopware/README_ELASTIC.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to set up ?
```
1. docker-compose build
2. docker-compose up
1. docker compose build
2. docker compose up
```

1. Fronted:
Expand Down
4 changes: 2 additions & 2 deletions demos/Symfony/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Set up application.

```
$ docker-compose build
$ docker-compose up
$ docker compose build
$ docker compose up
```
After it open the next link
```
Expand Down
2 changes: 1 addition & 1 deletion demos/WordPress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Setup application with a single command.

```
$ docker-compose up
$ docker compose up
```
6 changes: 3 additions & 3 deletions demos/Yii2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ http://localhost/basic/web/

Update your vendor packages

docker-compose run --rm php composer update --prefer-dist
docker compose run --rm php composer update --prefer-dist

Run the installation triggers (creating cookie validation code)

docker-compose run --rm php composer install
docker compose run --rm php composer install

Start the container

docker-compose up -d
docker compose up -d

You can then access the application through the following URL:

Expand Down
4 changes: 2 additions & 2 deletions demos/Yii2/README_ELASTIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Set up application.

```
$ docker-compose build
$ docker-compose up
$ docker compose build
$ docker compose up
```
After it open the next link
```
Expand Down
Loading