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 :: updating docker compose to allow for testing #823

Merged
merged 6 commits into from
Sep 16, 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
33 changes: 21 additions & 12 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,32 @@ 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 }}
continue-on-error: true

steps:
- name: Checkout
Expand All @@ -46,7 +55,7 @@ jobs:
build-args: |
java_version=${{ matrix.java-version }}
java_compiler=${{ matrix.java-compiler }}
verify_build=${{ matrix.verify-build }}
verify_build=false
cache-from: type=gha
cache-to: ${{ github.event_name == 'push' && 'type=gha,mode=max' || '' }}

Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
65 changes: 65 additions & 0 deletions contrib/docker/docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
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'
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:
output: