From 6d0f746777d5e007ffe6fedbf1b3fe9fad11525a Mon Sep 17 00:00:00 2001 From: Philip Liu <12836897+philipliu@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:41:19 -0400 Subject: [PATCH] Use docker compose v2 (#1448) --- .github/workflows/sub_essential_tests.yml | 4 ++-- .github/workflows/sub_extended_tests.yml | 4 ++-- .../01 - Contributing/A - Development Environment.md | 12 ++++++------ service-runner/build.gradle.kts | 4 ++-- .../platform/run_profiles/RunDockerDevStackNoWait.kt | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sub_essential_tests.yml b/.github/workflows/sub_essential_tests.yml index 6b0b1c250f..ca4cf119d9 100644 --- a/.github/workflows/sub_essential_tests.yml +++ b/.github/workflows/sub_essential_tests.yml @@ -50,10 +50,10 @@ jobs: - name: Pull Stellar Validation Tests Docker Image run: docker pull stellar/anchor-tests:latest & - - name: Run Kafka, Postgres, and Sep24 UI with docker-compose + - name: Run Kafka, Postgres, and Sep24 UI with docker compose env: TEST_PROFILE_NAME: default - run: docker-compose -f /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/docker-compose-test.yaml up -d --build + run: docker compose -f /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/docker-compose-test.yaml up -d --build - name: Run sep server, platform server, observer, and reference servers for integration tests env: diff --git a/.github/workflows/sub_extended_tests.yml b/.github/workflows/sub_extended_tests.yml index 567d935974..90aac095fb 100644 --- a/.github/workflows/sub_extended_tests.yml +++ b/.github/workflows/sub_extended_tests.yml @@ -46,8 +46,8 @@ jobs: ############################################# - - name: Run Kafka, Postgres, and Sep24 UI with docker-compose - run: docker-compose -f /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/docker-compose-test.yaml up -d --build + - name: Run Kafka, Postgres, and Sep24 UI with docker compose + run: docker compose -f /home/runner/java-stellar-anchor-sdk/service-runner/src/main/resources/docker-compose-test.yaml up -d --build # `custody` Tests - name: Start `custody` configuration diff --git a/docs/01 - Contributing/A - Development Environment.md b/docs/01 - Contributing/A - Development Environment.md index 9f063db1fc..af3f2f4573 100644 --- a/docs/01 - Contributing/A - Development Environment.md +++ b/docs/01 - Contributing/A - Development Environment.md @@ -11,7 +11,7 @@ * [Clean](#clean) * [Build](#build) * [Running Unit Tests](#running-unit-tests) - * [Running `docker-compose` up for development](#running-docker-compose-up-for-development) + * [Running `docker compose` up for development](#running-docker-compose-up-for-development) * [Starting all servers](#starting-all-servers) * [Set up the Git Hooks](#set-up-the-git-hooks) * [Set up the Development Environment with IntelliJ IDEA](#set-up-the-development-environment-with-intellij-idea) @@ -111,11 +111,11 @@ Run all tests: `./gradlew test` Run subproject tests: `./gradlew :[subproject]:test` -### Running `docker-compose start` for Kafka, Postgres, and SEP24 Reference UI +### Running `docker compose start` for Kafka, Postgres, and SEP24 Reference UI `./gradlew dockerComposeStart` -### Running `docker-compose stop` to shutdown Kafka, Postgres, and SEP24 Reference UI +### Running `docker compose stop` to shutdown Kafka, Postgres, and SEP24 Reference UI `./gradlew dockerComposeStop` @@ -218,7 +218,7 @@ the `service-runner/src/main/resources/profiles` folder. If you would like to debug the Platform server, you can do so by running the -- Make sure `docker` and `docker-compose` is available on your local machine. +- Make sure `docker` is available on your local machine. - Check if there are previous docker containers running on your machine. If there are, please stop and delete them. - Run `Docker - Run Dev Stack - Kafka, Postgres, SEP24 Reference UI` to start the development stack. - Debug `Sep Server: default` to start the SEP server. @@ -229,7 +229,7 @@ If you would like to debug the unit tests or the end-to-end tests, there are two #### Option 1: Run the servers from IntelliJ -- Make sure `docker` and `docker-compose` is available on your local machine. +- Make sure `docker` is available on your local machine. - Check if there are previous docker containers running on your machine. If there are, please stop and delete them. - Run `Docker - Run Dev Stack - Kafka, Postgres, SEP24 Reference UI` to start the development stack. - Run `Test Profile: default` to run the servers with the `default` profile. @@ -237,7 +237,7 @@ If you would like to debug the unit tests or the end-to-end tests, there are two ### Option 2: Run the servers and tests from Gradle -- Make sure `docker` and `docker-compose` is available on your local machine. +- Make sure `docker` is available on your local machine. - Check if there are previous docker containers running on your machine. If there are, please stop and delete them. - Navigate to the directory to the project folder - `./gradlew dockerComposeStart` to start the development stack. diff --git a/service-runner/build.gradle.kts b/service-runner/build.gradle.kts index fae2ee354f..1a6df10f2b 100644 --- a/service-runner/build.gradle.kts +++ b/service-runner/build.gradle.kts @@ -61,9 +61,9 @@ tasks.register("startServersWithTestProfile") { mainClass.set("org.stellar.anchor.platform.run_profiles.RunTestProfile") } -/** Run docker-compose up to start Postgres, Kafka, etc. */ +/** Run docker compose up to start Postgres, Kafka, etc. */ tasks.register("dockerComposeStart") { - println("Running docker-compose to start Postgres, Kafka ,etc.") + println("Running docker compose to start Postgres, Kafka ,etc.") group = "application" classpath = sourceSets["main"].runtimeClasspath mainClass.set("org.stellar.anchor.platform.run_profiles.RunDockerDevStackNoWait") diff --git a/service-runner/src/main/kotlin/org/stellar/anchor/platform/run_profiles/RunDockerDevStackNoWait.kt b/service-runner/src/main/kotlin/org/stellar/anchor/platform/run_profiles/RunDockerDevStackNoWait.kt index 38f6d60a34..b8dea29ce0 100644 --- a/service-runner/src/main/kotlin/org/stellar/anchor/platform/run_profiles/RunDockerDevStackNoWait.kt +++ b/service-runner/src/main/kotlin/org/stellar/anchor/platform/run_profiles/RunDockerDevStackNoWait.kt @@ -8,7 +8,7 @@ import org.stellar.anchor.platform.* fun main() = runBlocking { testProfileExecutor = TestProfileExecutor(TestConfig()) // The "registerShutdownHook(testProfileExecutor)" is commented out to avoid shutting down the - // docker-compose stack when the JVM is shutdown. + // docker compose stack when the JVM is shutdown. testProfileExecutor.start(true) { it.env[RUN_DOCKER] = "true" it.env[RUN_ALL_SERVERS] = "false"