From 438e109f0865f01750b43fe48796a042f5537371 Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:01:52 -0400 Subject: [PATCH 1/6] updating docker compose to allow for ci testing --- contrib/docker/docker-compose.ubi8.yml | 48 +++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/contrib/docker/docker-compose.ubi8.yml b/contrib/docker/docker-compose.ubi8.yml index 2eec0dccea..ce52b3ffc6 100644 --- a/contrib/docker/docker-compose.ubi8.yml +++ b/contrib/docker/docker-compose.ubi8.yml @@ -1,6 +1,4 @@ --- -version: "3" - services: emissary-server: image: emissary @@ -8,10 +6,9 @@ services: context: ../../ dockerfile: contrib/docker/Dockerfile.ci environment: - - PROJECT_BASE=/opt/emissary - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -Dfile.encoding=UTF8 - hostname: "emissary-server" - command: "server -a 5 -p 8001 -s http -h emissary-server" + network_mode: host + command: "server -a 5 -p 8001 -m cluster -s http" ports: - "8000:8000" - "8001:8001" @@ -21,6 +18,47 @@ services: volumes: - input:/opt/emissary/target/data - output:/opt/emissary/localoutput + healthcheck: + test: curl --fail http://localhost:8001/api/health || exit 1 + start_period: 10s + interval: 10s + timeout: 20s + retries: 3 + + emissary-feeder: + image: emissary + build: + context: ../../ + dockerfile: contrib/docker/Dockerfile.ci + environment: + - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7000 -Dfile.encoding=UTF8 + network_mode: host + command: "feed -p 7001 -i /opt/emissary/target/data/InputData --eatPrefix /opt/emissary/target/data/InputData" + ports: + - "7000:7000" + - "7001:7001" + expose: + - '7000' + - '7001' + depends_on: + emissary-server: + condition: service_healthy + volumes: + - input:/opt/emissary/target/data + healthcheck: + test: curl --fail http://localhost:7001/api/health || exit 1 + start_period: 10s + interval: 10s + timeout: 20s + retries: 3 + + emissary-ci: + image: redhat/ubi8:8.9 + network_mode: host + command: curl --fail http://localhost:7001/api/health || exit 1 + depends_on: + emissary-feeder: + condition: service_healthy volumes: input: From 229a85316d8734ff01161cde9158350f7af5cd3a Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Tue, 18 Jun 2024 06:48:10 -0400 Subject: [PATCH 2/6] test compose ci --- .github/workflows/maven-ci.yml | 7 +++ contrib/docker/docker-compose.ci.centos7.yml | 44 +++++++++++++++ contrib/docker/docker-compose.ci.common.yml | 59 ++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 contrib/docker/docker-compose.ci.centos7.yml create mode 100644 contrib/docker/docker-compose.ci.common.yml diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 4055fcc289..4dfbbc4b5b 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -43,6 +43,7 @@ jobs: context: . push: false file: contrib/docker/Dockerfile.ci + tags: emissary:latest build-args: | java_version=${{ matrix.java-version }} java_compiler=${{ matrix.java-compiler }} @@ -69,12 +70,18 @@ jobs: context: . push: false file: contrib/docker/Dockerfile.ci + tags: emissary-server:latest , emissary-feeder:latest build-args: | target_os=centos7 verify_build=false cache-from: type=gha cache-to: ${{ github.event_name == 'push' && 'type=gha,mode=max' || '' }} + - name: Test + run: | + docker compose -f contrib/docker/docker-compose.ci.centos7.yml up --exit-code-from emissary-ci + docker compose -f contrib/docker/docker-compose.ci.centos7.yml down + macos-build: name: MacOS non-standard build on Java 11 with compiler target 11 runs-on: macos-14 diff --git a/contrib/docker/docker-compose.ci.centos7.yml b/contrib/docker/docker-compose.ci.centos7.yml new file mode 100644 index 0000000000..99e7e4b7d0 --- /dev/null +++ b/contrib/docker/docker-compose.ci.centos7.yml @@ -0,0 +1,44 @@ +--- +services: + emissary-server: + image: emissary + extends: + file: docker-compose.ci.common.yml + service: emissary-server + build: + args: + java_version: 11 + java_compiler: 11 + target_os: centos7 + verify_build: false + maven_phases: 'clean package' + maven_profiles: '-DskipTests -Pdist' + + emissary-feeder: + image: emissary + extends: + file: docker-compose.ci.common.yml + service: emissary-feeder + build: + args: + java_version: 11 + java_compiler: 11 + target_os: centos7 + verify_build: false + maven_phases: 'clean package' + maven_profiles: '-DskipTests -Pdist' + depends_on: + emissary-server: + condition: service_healthy + + emissary-ci: + extends: + file: docker-compose.ci.common.yml + service: emissary-ci + depends_on: + emissary-feeder: + condition: service_healthy + +volumes: + input: + output: diff --git a/contrib/docker/docker-compose.ci.common.yml b/contrib/docker/docker-compose.ci.common.yml new file mode 100644 index 0000000000..03490dc784 --- /dev/null +++ b/contrib/docker/docker-compose.ci.common.yml @@ -0,0 +1,59 @@ +--- +services: + emissary-server: + image: emissary + build: + context: ../../ + dockerfile: contrib/docker/Dockerfile.ci + environment: + - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -Dfile.encoding=UTF8 + network_mode: host + command: "server -a 5 -p 8001 -m cluster -s http" + ports: + - "8000:8000" + - "8001:8001" + expose: + - '8000' + - '8001' + volumes: + - input:/opt/emissary/target/data + - output:/opt/emissary/localoutput + healthcheck: + test: curl --fail http://localhost:8001/api/health || exit 1 + start_period: 10s + interval: 10s + timeout: 20s + retries: 3 + + emissary-feeder: + image: emissary + build: + context: ../../ + dockerfile: contrib/docker/Dockerfile.ci + environment: + - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7000 -Dfile.encoding=UTF8 + network_mode: host + command: "feed -p 7001 -i /opt/emissary/target/data/InputData --eatPrefix /opt/emissary/target/data/InputData" + ports: + - "7000:7000" + - "7001:7001" + expose: + - '7000' + - '7001' + volumes: + - input:/opt/emissary/target/data + healthcheck: + test: curl --fail http://localhost:7001/api/health || exit 1 + start_period: 10s + interval: 10s + timeout: 20s + retries: 3 + + emissary-ci: + image: redhat/ubi8:8.9 + network_mode: host + command: curl --fail http://localhost:7001/api/health || exit 1 + +volumes: + input: + output: From e8ea2936e65c189ce271c81f9a8bf673366baa4a Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:14:04 -0400 Subject: [PATCH 3/6] test compose ci --- .github/workflows/maven-ci.yml | 41 ++++++++-------- contrib/docker/Dockerfile.ci | 2 +- contrib/docker/docker-compose.ci.centos7.yml | 44 ----------------- ...se.ci.common.yml => docker-compose.ci.yml} | 6 +++ contrib/docker/docker-compose.ubi8.yml | 48 ++----------------- 5 files changed, 34 insertions(+), 107 deletions(-) delete mode 100644 contrib/docker/docker-compose.ci.centos7.yml rename contrib/docker/{docker-compose.ci.common.yml => docker-compose.ci.yml} (91%) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 4dfbbc4b5b..b6e66ca14a 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -9,23 +9,33 @@ on: # yamllint disable-line rule:truthy jobs: build: - name: RHEL8 ${{ matrix.build-type }} build on Java ${{ matrix.java-version }} with compiler target ${{ matrix.java-compiler }} + name: RHEL8 standard build on Java 11 with compiler target 11 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + run: | + docker compose -f contrib/docker/docker-compose.ci.yml up --exit-code-from emissary-ci + docker compose -f contrib/docker/docker-compose.ci.yml down + + matrix-build: + name: RHEL8 experimental build on Java ${{ matrix.java-version }} with compiler target ${{ matrix.java-compiler }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: java-compiler: ['11', '17'] java-version: ['17'] - experimental: [false] - build-type: ["experimental"] - verify-build: [false] - include: - - java-compiler: '11' - java-version: '11' - experimental: false - build-type: "standard" - verify-build: true - continue-on-error: ${{ matrix.experimental }} + experimental: [true] + continue-on-error: true steps: - name: Checkout @@ -47,9 +57,7 @@ jobs: build-args: | java_version=${{ matrix.java-version }} java_compiler=${{ matrix.java-compiler }} - verify_build=${{ matrix.verify-build }} - cache-from: type=gha - cache-to: ${{ github.event_name == 'push' && 'type=gha,mode=max' || '' }} + verify_build=false centos7-build: name: Centos7 legacy build on Java 11 with compiler target 11 @@ -77,11 +85,6 @@ jobs: cache-from: type=gha cache-to: ${{ github.event_name == 'push' && 'type=gha,mode=max' || '' }} - - name: Test - run: | - docker compose -f contrib/docker/docker-compose.ci.centos7.yml up --exit-code-from emissary-ci - docker compose -f contrib/docker/docker-compose.ci.centos7.yml down - macos-build: name: MacOS non-standard build on Java 11 with compiler target 11 runs-on: macos-14 diff --git a/contrib/docker/Dockerfile.ci b/contrib/docker/Dockerfile.ci index bd68c9af1c..00e7140dd5 100644 --- a/contrib/docker/Dockerfile.ci +++ b/contrib/docker/Dockerfile.ci @@ -101,7 +101,7 @@ ARG maven_profiles='-Pdist' RUN --mount=type=cache,uid=${uid},gid=${gid},target=/home/${user}/.m2 \ mvn -V -B -e -ntp "-Dstyle.color=always" -Dmaven.compiler.release=${java_compiler} ${maven_phases} ${maven_profiles} -ARG verify_build=false +ARG verify_build=true RUN if ${verify_build} ; then ./contrib/ci/detect-changes.sh ; fi diff --git a/contrib/docker/docker-compose.ci.centos7.yml b/contrib/docker/docker-compose.ci.centos7.yml deleted file mode 100644 index 99e7e4b7d0..0000000000 --- a/contrib/docker/docker-compose.ci.centos7.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -services: - emissary-server: - image: emissary - extends: - file: docker-compose.ci.common.yml - service: emissary-server - build: - args: - java_version: 11 - java_compiler: 11 - target_os: centos7 - verify_build: false - maven_phases: 'clean package' - maven_profiles: '-DskipTests -Pdist' - - emissary-feeder: - image: emissary - extends: - file: docker-compose.ci.common.yml - service: emissary-feeder - build: - args: - java_version: 11 - java_compiler: 11 - target_os: centos7 - verify_build: false - maven_phases: 'clean package' - maven_profiles: '-DskipTests -Pdist' - depends_on: - emissary-server: - condition: service_healthy - - emissary-ci: - extends: - file: docker-compose.ci.common.yml - service: emissary-ci - depends_on: - emissary-feeder: - condition: service_healthy - -volumes: - input: - output: diff --git a/contrib/docker/docker-compose.ci.common.yml b/contrib/docker/docker-compose.ci.yml similarity index 91% rename from contrib/docker/docker-compose.ci.common.yml rename to contrib/docker/docker-compose.ci.yml index 03490dc784..ce52b3ffc6 100644 --- a/contrib/docker/docker-compose.ci.common.yml +++ b/contrib/docker/docker-compose.ci.yml @@ -40,6 +40,9 @@ services: expose: - '7000' - '7001' + depends_on: + emissary-server: + condition: service_healthy volumes: - input:/opt/emissary/target/data healthcheck: @@ -53,6 +56,9 @@ services: image: redhat/ubi8:8.9 network_mode: host command: curl --fail http://localhost:7001/api/health || exit 1 + depends_on: + emissary-feeder: + condition: service_healthy volumes: input: diff --git a/contrib/docker/docker-compose.ubi8.yml b/contrib/docker/docker-compose.ubi8.yml index ce52b3ffc6..2eec0dccea 100644 --- a/contrib/docker/docker-compose.ubi8.yml +++ b/contrib/docker/docker-compose.ubi8.yml @@ -1,4 +1,6 @@ --- +version: "3" + services: emissary-server: image: emissary @@ -6,9 +8,10 @@ services: context: ../../ dockerfile: contrib/docker/Dockerfile.ci environment: + - PROJECT_BASE=/opt/emissary - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -Dfile.encoding=UTF8 - network_mode: host - command: "server -a 5 -p 8001 -m cluster -s http" + hostname: "emissary-server" + command: "server -a 5 -p 8001 -s http -h emissary-server" ports: - "8000:8000" - "8001:8001" @@ -18,47 +21,6 @@ services: volumes: - input:/opt/emissary/target/data - output:/opt/emissary/localoutput - healthcheck: - test: curl --fail http://localhost:8001/api/health || exit 1 - start_period: 10s - interval: 10s - timeout: 20s - retries: 3 - - emissary-feeder: - image: emissary - build: - context: ../../ - dockerfile: contrib/docker/Dockerfile.ci - environment: - - JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7000 -Dfile.encoding=UTF8 - network_mode: host - command: "feed -p 7001 -i /opt/emissary/target/data/InputData --eatPrefix /opt/emissary/target/data/InputData" - ports: - - "7000:7000" - - "7001:7001" - expose: - - '7000' - - '7001' - depends_on: - emissary-server: - condition: service_healthy - volumes: - - input:/opt/emissary/target/data - healthcheck: - test: curl --fail http://localhost:7001/api/health || exit 1 - start_period: 10s - interval: 10s - timeout: 20s - retries: 3 - - emissary-ci: - image: redhat/ubi8:8.9 - network_mode: host - command: curl --fail http://localhost:7001/api/health || exit 1 - depends_on: - emissary-feeder: - condition: service_healthy volumes: input: From 52f627ab416f9a41b08dc94a2d9913b316c5610e Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:02:15 -0400 Subject: [PATCH 4/6] added cache back in --- .github/workflows/maven-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index b6e66ca14a..42aaf32675 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -58,6 +58,8 @@ jobs: java_version=${{ matrix.java-version }} java_compiler=${{ matrix.java-compiler }} verify_build=false + cache-from: type=gha + cache-to: ${{ github.event_name == 'push' && 'type=gha,mode=max' || '' }} centos7-build: name: Centos7 legacy build on Java 11 with compiler target 11 From cf72ec06832c593edaab96085e1fa34e3b8701c5 Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:23:09 -0400 Subject: [PATCH 5/6] remove tags --- .github/workflows/maven-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index 42aaf32675..eadf0cc403 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -53,7 +53,6 @@ jobs: context: . push: false file: contrib/docker/Dockerfile.ci - tags: emissary:latest build-args: | java_version=${{ matrix.java-version }} java_compiler=${{ matrix.java-compiler }} @@ -80,7 +79,6 @@ jobs: context: . push: false file: contrib/docker/Dockerfile.ci - tags: emissary-server:latest , emissary-feeder:latest build-args: | target_os=centos7 verify_build=false From e35811629d15772af697bd1af1a469037f0e2f90 Mon Sep 17 00:00:00 2001 From: dev-mlb <19797865+dev-mlb@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:54:11 -0400 Subject: [PATCH 6/6] remove unused experimental matrix variable --- .github/workflows/maven-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index eadf0cc403..972faae757 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -34,7 +34,6 @@ jobs: matrix: java-compiler: ['11', '17'] java-version: ['17'] - experimental: [true] continue-on-error: true steps: