This is an automated email from the ASF dual-hosted git repository. florianhockmann pushed a commit to branch TINKERPOP-3106 in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit a455f408e2973bd69576b5d049c329193608151f Author: Florian Hockmann <[email protected]> AuthorDate: Wed Aug 21 15:57:35 2024 +0200 TINKERPOP-3106 Update to Docker Compose V2 https://issues.apache.org/jira/browse/TINKERPOP-3106 Docker Compose V1 has been deprecated in 2023: https://docs.docker.com/compose/migrate/ This now leads to failing GH Action builds as they have stopped supporting it: https://github.blog/changelog/2024-04-10-github-hosted-runner-images-deprecation-notice-docker-compose-v1/ Updating mainly means that `docker-compose` needs to change to `docker compose`. --- docker/build.sh | 12 ++++++------ .../src/dev/developer/development-environment.asciidoc | 12 ++++++------ gremlin-dotnet/test/pom.xml | 6 ++++-- gremlin-go/driver/README.md | 8 ++++---- gremlin-go/pom.xml | 6 ++++-- gremlin-go/run.sh | 4 ++-- gremlin-javascript/pom.xml | 6 ++++-- gremlin-python/pom.xml | 18 +++++++++--------- 8 files changed, 39 insertions(+), 33 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index 1b299d5c34..d495ff5de1 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -106,7 +106,7 @@ EOF function check_status { status=$? - [ "$1" == "down" ] && docker-compose down + [ "$1" == "down" ] && docker compose down popd > /dev/null [ $status -ne 0 ] && exit $status } @@ -128,7 +128,7 @@ docker run -p 80:80 ${TINKERPOP_DOCKER_OPTS} ${REMOVE_CONTAINER} \ check_status if [ -n "${RUN_TESTS}" ]; then - # If testing, then build base server which is required by the following docker-compose. + # If testing, then build base server which is required by the following docker compose. pushd ${ABS_PROJECT_HOME}/gremlin-server > /dev/null docker build -f ./Dockerfile --build-arg GREMLIN_SERVER_DIR=target/apache-tinkerpop-gremlin-server-${GREMLIN_SERVER}-standalone -t tinkerpop/gremlin-server:${GREMLIN_SERVER} . check_status @@ -136,7 +136,7 @@ fi if [ -n "${INCLUDE_GO}" ] && [ -n "${RUN_TESTS}" ]; then pushd ${ABS_PROJECT_HOME}/gremlin-go > /dev/null - docker-compose up --build --exit-code-from gremlin-go-integration-tests + docker compose up --build --exit-code-from gremlin-go-integration-tests check_status "down" fi @@ -145,19 +145,19 @@ if [ -n "${INCLUDE_PYTHON}" ] && [ -n "${RUN_TESTS}" ]; then export BUILD_DIR=$(pwd)/target/python3/ mkdir -p ${BUILD_DIR} cp -r ./src/main/python/* ${BUILD_DIR} - docker-compose up --build --abort-on-container-exit gremlin-server-test-python gremlin-python-integration-tests + docker compose up --build --abort-on-container-exit gremlin-server-test-python gremlin-python-integration-tests check_status "down" fi if [ -n "${INCLUDE_DOTNET}" ] && [ -n "${RUN_TESTS}" ]; then pushd ${ABS_PROJECT_HOME}/gremlin-dotnet/test > /dev/null - docker-compose up --build --exit-code-from gremlin-dotnet-integration-tests + docker compose up --build --exit-code-from gremlin-dotnet-integration-tests check_status "down" fi if [ -n "${INCLUDE_JAVASCRIPT}" ] && [ -n "${RUN_TESTS}" ]; then pushd ${ABS_PROJECT_HOME}/gremlin-javascript/src/main/javascript/gremlin-javascript > /dev/null - docker-compose up --build --exit-code-from gremlin-js-integration-tests + docker compose up --build --exit-code-from gremlin-js-integration-tests check_status "down" fi diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc index d5e97eec6b..8710b6fba4 100644 --- a/docs/src/dev/developer/development-environment.asciidoc +++ b/docs/src/dev/developer/development-environment.asciidoc @@ -341,7 +341,7 @@ go build Docker allows you to test the driver without installing any dependencies. The following command can be used to run docker: [source,text] -docker-compose up --exit-code-from gremlin-go-integration-tests +docker compose up --exit-code-from gremlin-go-integration-tests See the <<release-environment,Release Environment>> section for more information on release manager configurations. @@ -624,12 +624,12 @@ your Platform: * Run Maven commands, e.g. `mvn clean install` inside of project folder e.g. `tinkerpop/gremlin-go`, or `mvn clean install -pl gremlin-go` inside of `tinkerpop` (platform-agnostic - recommended) -* Add `GREMLIN_SERVER=<server-image-version>` and `HOME=<user-home-directory>` to an `.env` file inside project folder and run `docker-compose up --exit-code-from gremlin-go-integration-tests` (Platform-agnostic). -* Run `GREMLIN_SERVER=<server-image-version> docker-compose up --exit-code-from gremlin-go-integration-tests` in Unix/Linux. -* Run `$env:GREMLIN_SERVER="<server-image-version>";$env:HOME=$env:USERPROFILE;docker-compose up --exit-code-from gremlin-go-integration-tests` in Windows PowerShell. +* Add `GREMLIN_SERVER=<server-image-version>` and `HOME=<user-home-directory>` to an `.env` file inside project folder and run `docker compose up --exit-code-from gremlin-go-integration-tests` (Platform-agnostic). +* Run `GREMLIN_SERVER=<server-image-version> docker compose up --exit-code-from gremlin-go-integration-tests` in Unix/Linux. +* Run `$env:GREMLIN_SERVER="<server-image-version>";$env:HOME=$env:USERPROFILE;docker compose up --exit-code-from gremlin-go-integration-tests` in Windows PowerShell. -You should see exit code 0 upon successful completion of the test suites. Run `docker-compose down` to remove the -service containers (not needed if you executed Maven commands or `run.sh`), or `docker-compose down --rmi all` to +You should see exit code 0 upon successful completion of the test suites. Run `docker compose down` to remove the +service containers (not needed if you executed Maven commands or `run.sh`), or `docker compose down --rmi all` to remove the service containers while deleting all used images. Note for running docker with MacOS on ARM processors: Docker's performance is extremely poor on ARM Mac's in its diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml index d332a939e1..5e549a8161 100644 --- a/gremlin-dotnet/test/pom.xml +++ b/gremlin-dotnet/test/pom.xml @@ -102,8 +102,9 @@ limitations under the License. <!-- setting this env variable is needed to be cross-platform compatible --> <HOME>${user.home}</HOME> </environmentVariables> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>up</argument> <argument>--build</argument> <argument>--exit-code-from</argument> @@ -120,8 +121,9 @@ limitations under the License. <configuration> <skip>${skipTests}</skip> <!-- don't need to set env variables for container tear down --> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>down</argument> </arguments> </configuration> diff --git a/gremlin-go/driver/README.md b/gremlin-go/driver/README.md index bbae31ec9e..652432805b 100644 --- a/gremlin-go/driver/README.md +++ b/gremlin-go/driver/README.md @@ -132,11 +132,11 @@ The docker compose environment variable `HOME` specifies the user home directory There are different ways to launch the test suite and set the `GREMLIN_SERVER` environment variable depending on your Platform: - Run Maven commands, e.g. `mvn clean install` inside of `tinkerpop/gremlin-go`, or `mvn clean install -pl gremlin-go` inside of `tinkerpop` (platform-agnostic - recommended) - Run the `run.sh` script, which sets `GREMLIN_SERVER` by default. Run `./run.sh -h` for usage information (Unix/Linux - recommended). -- Add `GREMLIN_SERVER=<server-image-version>` and `HOME=<user-home-directory>` to an `.env` file inside `gremlin-go` and run `docker-compose up --exit-code-from gremlin-go-integration-tests` (Platform-agnostic). -- Run `GREMLIN_SERVER=<server-image-version> docker-compose up --exit-code-from gremlin-go-integration-tests` in Unix/Linux. -- Run `$env:GREMLIN_SERVER="<server-image-version>";$env:HOME=$env:USERPROFILE;docker-compose up --exit-code-from gremlin-go-integration-tests` in Windows PowerShell. +- Add `GREMLIN_SERVER=<server-image-version>` and `HOME=<user-home-directory>` to an `.env` file inside `gremlin-go` and run `docker compose up --exit-code-from gremlin-go-integration-tests` (Platform-agnostic). +- Run `GREMLIN_SERVER=<server-image-version> docker compose up --exit-code-from gremlin-go-integration-tests` in Unix/Linux. +- Run `$env:GREMLIN_SERVER="<server-image-version>";$env:HOME=$env:USERPROFILE;docker compose up --exit-code-from gremlin-go-integration-tests` in Windows PowerShell. -You should see exit code 0 upon successful completion of the test suites. Run `docker-compose down` to remove the service containers (not needed if you executed Maven commands or `run.sh`), or `docker-compose down --rmi all` to remove the service containers while deleting all used images. +You should see exit code 0 upon successful completion of the test suites. Run `docker compose down` to remove the service containers (not needed if you executed Maven commands or `run.sh`), or `docker compose down --rmi all` to remove the service containers while deleting all used images. [go]: https://go.dev/dl/ [gomods]: https://go.dev/blog/using-go-modules diff --git a/gremlin-go/pom.xml b/gremlin-go/pom.xml index eab020fdb0..62eab4980d 100644 --- a/gremlin-go/pom.xml +++ b/gremlin-go/pom.xml @@ -114,8 +114,9 @@ limitations under the License. <!-- setting this env variable is needed to be cross-platform compatible --> <HOME>${user.home}</HOME> </environmentVariables> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>up</argument> <argument>--build</argument> <argument>--exit-code-from</argument> @@ -132,8 +133,9 @@ limitations under the License. <configuration> <skip>${skipTests}</skip> <!-- don't need to set env variables for container tear down --> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>down</argument> </arguments> </configuration> diff --git a/gremlin-go/run.sh b/gremlin-go/run.sh index 5f62072dda..23a37638a6 100755 --- a/gremlin-go/run.sh +++ b/gremlin-go/run.sh @@ -48,8 +48,8 @@ ABS_PROJECT_HOME=$(dirname $(realpath "$0"))/.. export ABS_PROJECT_HOME # Passes current gremlin server version into docker compose as environment variable -docker-compose up --build --exit-code-from gremlin-go-integration-tests +docker compose up --build --exit-code-from gremlin-go-integration-tests EXIT_CODE=$? # Removes all service containers -docker-compose down +docker compose down exit $EXIT_CODE diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml index 3b5d067407..15f45146c7 100644 --- a/gremlin-javascript/pom.xml +++ b/gremlin-javascript/pom.xml @@ -261,8 +261,9 @@ limitations under the License. <!-- setting this env variable is needed to be cross-platform compatible --> <HOME>${user.home}</HOME> </environmentVariables> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>up</argument> <argument>--build</argument> <argument>--exit-code-from</argument> @@ -280,8 +281,9 @@ limitations under the License. <configuration> <skip>${skipTests}</skip> <!-- don't need to set env variables for container tear down --> - <executable>docker-compose</executable> + <executable>docker</executable> <arguments> + <argument>compose</argument> <argument>down</argument> </arguments> <workingDirectory>./src/main/javascript/gremlin-javascript</workingDirectory> diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index df98f2ff5f..c51ff0fd53 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -136,16 +136,16 @@ limitations under the License. </goals> <configuration> <target> - <exec executable="docker-compose" failonerror="true"> + <exec executable="docker" failonerror="true"> <env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/> <env key="VERSION" value="${project.version}"/> <env key="PYTHONPATH" value=""/> - <arg line="up --build --abort-on-container-exit gremlin-python-package"/> + <arg line="compose up --build --abort-on-container-exit gremlin-python-package"/> </exec> - <exec executable="docker-compose" failonerror="true"> + <exec executable="docker" failonerror="true"> <env key="PYTHONPATH" value=""/> <env key="PACKAGE_DIR" value="${project.build.directory}/python-packaged"/> - <arg line="down"/> + <arg line="compose down"/> </exec> <exec executable="docker" failonerror="true"> <env key="PYTHONPATH" value=""/> @@ -157,7 +157,7 @@ limitations under the License. </execution> <!-- - use docker-compose to run unit tests, radish, and integration tests. + use docker compose to run unit tests, radish, and integration tests. --> <execution> <id>python-tests</id> @@ -168,18 +168,18 @@ limitations under the License. <configuration> <skip>${skipTests}</skip> <target> - <exec executable="docker-compose" failonerror="true"> + <exec executable="docker" failonerror="true"> <env key="VERSION" value="${project.version}"/> <env key="PYTHONPATH" value=""/> <env key="GREMLIN_SERVER" value="${project.version}"/> <env key="ABS_PROJECT_HOME" value="${project.basedir}/../"/> <env key="BUILD_DIR" value="${project.build.directory}/python3"/> - <arg line="up --build --abort-on-container-exit gremlin-server-test-python gremlin-python-integration-tests"/> + <arg line="compose up --build --abort-on-container-exit gremlin-server-test-python gremlin-python-integration-tests"/> </exec> - <exec executable="docker-compose" failonerror="true"> + <exec executable="docker" failonerror="true"> <env key="PYTHONPATH" value=""/> <env key="BUILD_DIR" value="${project.build.directory}/python3"/> - <arg line="down"/> + <arg line="compose down"/> </exec> <exec executable="docker" failonerror="true"> <env key="PYTHONPATH" value=""/>
