From aee560279ebb9eca904dd9ee858826ffd42e370a Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Thu, 20 Apr 2023 19:54:48 +0100 Subject: [PATCH 1/3] Add podman build --- .github/workflows/ci-actions-incremental.yml | 2 +- .github/workflows/podman-build.yml | 223 ++++++++++++++++++ devtools/cli/pom.xml | 2 - extensions/jdbc/jdbc-db2/deployment/pom.xml | 20 ++ .../jdbc/jdbc-oracle/deployment/pom.xml | 21 ++ .../jdbc/jdbc-postgresql/deployment/pom.xml | 20 ++ extensions/micrometer/deployment/pom.xml | 23 ++ .../deployment/pom.xml | 27 +++ .../reactive-oracle-client/deployment/pom.xml | 20 ++ integration-tests/jpa-mysql/pom.xml | 27 ++- integration-tests/logging-gelf/pom.xml | 26 ++ 11 files changed, 407 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/podman-build.yml diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml index 5b1e19dbd410d..4b355461d2237 100644 --- a/.github/workflows/ci-actions-incremental.yml +++ b/.github/workflows/ci-actions-incremental.yml @@ -765,4 +765,4 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} build-reports-artifacts-path: build-reports-artifacts - forks-only: true + forks-only: true \ No newline at end of file diff --git a/.github/workflows/podman-build.yml b/.github/workflows/podman-build.yml new file mode 100644 index 0000000000000..7f5ddd8e015c2 --- /dev/null +++ b/.github/workflows/podman-build.yml @@ -0,0 +1,223 @@ +name: Podman Test Build (Linux) + + +on: + pull_request: # TODO testing only, we do not want to build on PRs + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - '.gitignore' + - '.dockerignore' + - '*.md' + - '*.adoc' + - '*.txt' + - 'adr/**' + - 'jakarta/**' + - 'docs/src/main/asciidoc/**' + - '.github/ISSUE_TEMPLATE/**' + - '.github/*.yml' + - '.github/*.java' + - '.github/*.conf' + workflow_dispatch: + schedule: ## Do a run daily, to refresh website content + - cron: '0 3 * * *' + +env: + # Workaround testsuite locale issue + LANG: en_US.UTF-8 + COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end" + NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs" + JVM_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dformat.skip -DskipDocs -Dquarkus.test.hang-detection-timeout=60" + DB_USER: hibernate_orm_test + DB_PASSWORD: hibernate_orm_test + DB_NAME: hibernate_orm_test + IS_PODMAN: "true" + +jobs: + build-all-the-things: + name: "JDK 17 Build" + runs-on: ubuntu-latest + env: + MAVEN_OPTS: "-Xmx2g -XX:MaxMetaspaceSize=1g" + # Skip main in forks + # Skip draft PRs and those with WIP in the subject, rerun as soon as its removed + if: "(github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main')) && ( \ + github.event_name != 'pull_request' || ( \ + github.event.pull_request.draft == false && \ + github.event.pull_request.state != 'closed' && \ + contains(github.event.pull_request.title, 'wip ') == false && \ + contains(github.event.pull_request.title, '[wip]') == false && \ + ( + github.event.action != 'edited' || \ + contains(github.event.changes.title.from, 'wip ') || \ + contains(github.event.changes.title.from, '[wip]') \ + ) \ + ) \ + )" + outputs: + gib_args: ${{ steps.get-gib-args.outputs.gib_args }} + gib_impacted: ${{ steps.get-gib-impacted.outputs.impacted_modules }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Add quarkusio remote + shell: bash + run: git remote show quarkusio &> /dev/null || git remote add quarkusio https://github.com/quarkusio/quarkus.git + - name: Reclaim Disk Space + if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" + run: .github/ci-prerequisites.sh + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - name: Get Date + id: get-date + run: | + echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT + shell: bash + - name: Setup docker host + run: echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV" + - name: Update podman + run: | + sudo apt-get -y purge podman + sudo mkdir -p /etc/apt/keyrings + curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] \ + https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ + | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null + sudo apt-get update -qq + sudo apt-get -qq -y install podman + # Runs a single command using the runners shell + - name: Check podman + run: docker version + - name: Set up testcontainers for podman + run: | + echo ryuk.container.privileged=true > ~/.testcontainers.properties + - name: Cache Maven Repository + id: cache-maven + uses: actions/cache@v3 + with: + path: ~/.m2/repository + # refresh cache every month to avoid unlimited growth + key: q2maven-${{ steps.get-date.outputs.date }} + - name: Initial build + run: | + ./mvnw -T1C $COMMON_MAVEN_ARGS -DskipTests -DskipITs -Dinvoker.skip -Dno-format -Dtcks -Prelocations clean install + - name: Verify extension dependencies + shell: bash + run: ./update-extension-dependencies.sh $COMMON_MAVEN_ARGS + - name: Get GIB arguments + id: get-gib-args + env: + PULL_REQUEST_BASE: ${{ github.event.pull_request.base.ref }} + run: | + # See also: https://github.com/gitflow-incremental-builder/gitflow-incremental-builder#configuration (GIB) + # Common GIB_ARGS for all CI cases (hint: see also root pom.xml): + # - disableSelectedProjectsHandling: required to detect changes in jobs that use -pl + # - untracked: to ignore files created by jobs (and uncommitted to be consistent) + GIB_ARGS="-Dincremental -Dgib.disableSelectedProjectsHandling -Dgib.untracked=false -Dgib.uncommitted=false" + if [ -n "$PULL_REQUEST_BASE" ] + then + # The PR defines a clear merge target so just use that branch for reference, *unless*: + # - the current branch is a backport branch targeting some released branch like 1.10 (merge target is not main) + GIB_ARGS+=" -Dgib.referenceBranch=origin/$PULL_REQUEST_BASE -Dgib.disableIfReferenceBranchMatches='origin/\d+\.\d+'" + else + # No PR means the merge target is uncertain so fetch & use main of quarkusio/quarkus, *unless*: + # - the current branch is main or some released branch like 1.10 + # - the current branch is a backport branch which is going to target some released branch like 1.10 (merge target is not main) + GIB_ARGS+=" -Dgib.referenceBranch=refs/remotes/quarkusio/main -Dgib.fetchReferenceBranch -Dgib.disableIfBranchMatches='main|\d+\.\d+|.*backport.*'" + fi + echo "GIB_ARGS: $GIB_ARGS" + echo "gib_args=${GIB_ARGS}" >> $GITHUB_OUTPUT + - name: Get GIB impacted modules + id: get-gib-impacted + # mvnw just for creating gib-impacted.log ("validate" should not waste much time if not incremental at all, e.g. on main) + run: | + ./mvnw -q -T1C $COMMON_MAVEN_ARGS -Dtcks -Dquickly-ci ${{ steps.get-gib-args.outputs.gib_args }} -Dgib.logImpactedTo=gib-impacted.log validate + if [ -s gib-impacted.log ] + then + GIB_IMPACTED=$(cat gib-impacted.log) + else + GIB_IMPACTED='' + fi + echo "GIB_IMPACTED: ${GIB_IMPACTED}" + # three steps to retain linefeeds in output for other jobs + # (see https://github.com/github/docs/issues/21529 and https://github.com/orgs/community/discussions/26288#discussioncomment-3876281) + echo 'impacted_modules<> $GITHUB_OUTPUT + echo "${GIB_IMPACTED}" >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT + - name: Stop mysql + if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" + shell: bash + run: | + ss -ln + sudo service mysql stop || true + - name: Support longpaths on Windows + if: "startsWith(matrix.java.os-name, 'windows')" + run: git config --global core.longpaths true + - name: apt clean + if: "!startsWith(matrix.java.os-name, 'windows') && !startsWith(matrix.java.os-name, 'macos')" + shell: bash + run: sudo apt-get clean + - name: Build + shell: bash + # Despite the pre-calculated run_jvm flag, GIB has to be re-run here to figure out the exact submodules to build. + run: ./mvnw $COMMON_MAVEN_ARGS install -Dsurefire.timeout=1200 -pl !integration-tests/gradle -pl !integration-tests/maven -pl !integration-tests/devtools -pl !docs $JVM_TEST_MAVEN_ARGS ${{ needs.build-jdk11.outputs.gib_args }} + - name: Delete Local Artifacts From Cache + shell: bash + run: rm -r ~/.m2/repository/io/quarkus + - name: Clean Gradle temp directory + if: always() + shell: bash + run: devtools/gradle/gradlew --stop && rm -rf devtools/gradle/gradle-extension-plugin/build/tmp + - name: Prepare failure archive (if maven failed) + if: failure() + shell: bash + run: find . -name '*-reports' -type d -o -name '*.log' | tar -czf test-reports.tgz -T - + - name: Upload failure Archive (if maven failed) + uses: actions/upload-artifact@v3 + if: failure() + with: + name: test-reports-jvm${{matrix.java.name}} + path: 'test-reports.tgz' + retention-days: 5 + - name: Upload build reports (if build failed) + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: "build-reports-JVM Tests - JDK ${{matrix.java.name}}" + path: | + **/target/*-reports/TEST-*.xml + target/build-report.json + LICENSE.txt + retention-days: 2 + - name: Upload gc.log + uses: actions/upload-artifact@v3 + with: + name: "GC log - JDK ${{matrix.java.name}}" + path: | + **/windows-java-11.txt + !**/build/tmp/** + retention-days: 5 + - name: Upload build.log (if build failed) + uses: actions/upload-artifact@v3 + if: ${{ failure() || cancelled() }} + with: + name: "build-logs-JVM Tests - JDK ${{matrix.java.name}}" + path: | + **/build.log + retention-days: 2 + - name: Report + if: always() + shell: bash + run: | + curl -Ls https://sh.jbang.dev | bash -s - app setup + ~/.jbang/bin/jbang .github/NativeBuildReport.java \ + issueNumber=13058 \ + runId=${{ github.run_id }} \ + status=${{ job.status }} \ + token=${{ secrets.GITHUB_API_TOKEN }} \ + issueRepo=${{ github.repository }} \ + thisRepo=${{ github.repository }} diff --git a/devtools/cli/pom.xml b/devtools/cli/pom.xml index 61db6a075dece..9ba49274bea8b 100644 --- a/devtools/cli/pom.xml +++ b/devtools/cli/pom.xml @@ -202,7 +202,5 @@ native - - diff --git a/extensions/jdbc/jdbc-db2/deployment/pom.xml b/extensions/jdbc/jdbc-db2/deployment/pom.xml index a803ad71c492f..6f90b9a6a45dd 100644 --- a/extensions/jdbc/jdbc-db2/deployment/pom.xml +++ b/extensions/jdbc/jdbc-db2/deployment/pom.xml @@ -110,5 +110,25 @@ + + + podman + + + env.IS_PODMAN + true + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/extensions/jdbc/jdbc-oracle/deployment/pom.xml b/extensions/jdbc/jdbc-oracle/deployment/pom.xml index 7a1522773c062..34d7034121570 100644 --- a/extensions/jdbc/jdbc-oracle/deployment/pom.xml +++ b/extensions/jdbc/jdbc-oracle/deployment/pom.xml @@ -99,5 +99,26 @@ + + + + podman + + + env.IS_PODMAN + true + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/extensions/jdbc/jdbc-postgresql/deployment/pom.xml b/extensions/jdbc/jdbc-postgresql/deployment/pom.xml index 47a9ef69f6017..1bb2061bc84db 100644 --- a/extensions/jdbc/jdbc-postgresql/deployment/pom.xml +++ b/extensions/jdbc/jdbc-postgresql/deployment/pom.xml @@ -109,5 +109,25 @@ + + + podman + + + env.IS_PODMAN + true + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/extensions/micrometer/deployment/pom.xml b/extensions/micrometer/deployment/pom.xml index 19b77fff04cad..3e4f9b4dbd8cc 100644 --- a/extensions/micrometer/deployment/pom.xml +++ b/extensions/micrometer/deployment/pom.xml @@ -152,4 +152,27 @@ + + + + + podman + + + env.IS_PODMAN + true + + + + + + maven-surefire-plugin + + true + + + + + + diff --git a/extensions/panache/hibernate-reactive-panache/deployment/pom.xml b/extensions/panache/hibernate-reactive-panache/deployment/pom.xml index 2f2aafb53fb4f..33dc57957a18a 100644 --- a/extensions/panache/hibernate-reactive-panache/deployment/pom.xml +++ b/extensions/panache/hibernate-reactive-panache/deployment/pom.xml @@ -211,5 +211,32 @@ + + + podman + + + env.IS_PODMAN + true + + + + true + true + true + + + + + io.fabric8 + docker-maven-plugin + + true + + + + + + diff --git a/extensions/reactive-oracle-client/deployment/pom.xml b/extensions/reactive-oracle-client/deployment/pom.xml index 48e7440082102..02078d9506ad8 100644 --- a/extensions/reactive-oracle-client/deployment/pom.xml +++ b/extensions/reactive-oracle-client/deployment/pom.xml @@ -240,6 +240,26 @@ + + + podman + + + env.IS_PODMAN + true + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/integration-tests/jpa-mysql/pom.xml b/integration-tests/jpa-mysql/pom.xml index 4f1fc7f30171d..af53db1d55b3a 100644 --- a/integration-tests/jpa-mysql/pom.xml +++ b/integration-tests/jpa-mysql/pom.xml @@ -258,7 +258,32 @@ - + + + podman + + + env.IS_PODMAN + true + + + + true + true + true + + + + + io.fabric8 + docker-maven-plugin + + true + + + + + diff --git a/integration-tests/logging-gelf/pom.xml b/integration-tests/logging-gelf/pom.xml index 70df7c5971d10..0fd53519d9542 100644 --- a/integration-tests/logging-gelf/pom.xml +++ b/integration-tests/logging-gelf/pom.xml @@ -272,6 +272,32 @@ true + + + podman + + + env.IS_PODMAN + true + + + + true + true + true + + + + + io.fabric8 + docker-maven-plugin + + true + + + + + From 83962e4c66e5bbfe8ef81e493047a2d39779cc3e Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Fri, 19 May 2023 09:12:01 +0100 Subject: [PATCH 2/3] Remove report step, which does not have correct credentials --- .github/workflows/podman-build.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/podman-build.yml b/.github/workflows/podman-build.yml index 7f5ddd8e015c2..c5770993c3ae4 100644 --- a/.github/workflows/podman-build.yml +++ b/.github/workflows/podman-build.yml @@ -209,15 +209,4 @@ jobs: path: | **/build.log retention-days: 2 - - name: Report - if: always() - shell: bash - run: | - curl -Ls https://sh.jbang.dev | bash -s - app setup - ~/.jbang/bin/jbang .github/NativeBuildReport.java \ - issueNumber=13058 \ - runId=${{ github.run_id }} \ - status=${{ job.status }} \ - token=${{ secrets.GITHUB_API_TOKEN }} \ - issueRepo=${{ github.repository }} \ - thisRepo=${{ github.repository }} + From 4e11f2268328587fd413006543d860fb5dba03c7 Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Wed, 31 May 2023 10:53:45 +0100 Subject: [PATCH 3/3] Do not execute podman CI on PRs, now that the PR which introduces it has been tested --- .github/workflows/podman-build.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/podman-build.yml b/.github/workflows/podman-build.yml index c5770993c3ae4..c496db4fdd5d5 100644 --- a/.github/workflows/podman-build.yml +++ b/.github/workflows/podman-build.yml @@ -2,23 +2,8 @@ name: Podman Test Build (Linux) on: - pull_request: # TODO testing only, we do not want to build on PRs - types: [opened, synchronize, reopened, ready_for_review] - paths-ignore: - - '.gitignore' - - '.dockerignore' - - '*.md' - - '*.adoc' - - '*.txt' - - 'adr/**' - - 'jakarta/**' - - 'docs/src/main/asciidoc/**' - - '.github/ISSUE_TEMPLATE/**' - - '.github/*.yml' - - '.github/*.java' - - '.github/*.conf' workflow_dispatch: - schedule: ## Do a run daily, to refresh website content + schedule: ## Do a run daily, to check our compatibility - cron: '0 3 * * *' env: