From 19941280469a3f66cb678525a4088f86b9cacee3 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Mon, 8 Jul 2024 14:06:52 -0700 Subject: [PATCH] feat(connector-corda): support JVM 17 Cordapps 1. The runner stage of the corda connector JVM image now uses an up to date JRE instead of the very old JDK 8 which the builder stage is still stuck on. 2. This enables the connector to load and use contract .jar files which were built with the newer JDK as well. 3. This is important because we would like to support as wide range of contract/flow invocation use cases as possible and also recently there's been some changes in the Corda official samples repositories where the contracts are being upgraded to JVM 17 as well so this will become more and more relevant as a use-case in the near future. Signed-off-by: Peter Somogyvari --- .github/workflows/ci.yaml | 12 ++++++------ .../src/main-server/Dockerfile | 2 +- .../src/main-server/start-app.sh | 10 +++++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 09280bc4ec..4fc26c03db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -497,7 +497,7 @@ jobs: run: yarn run benchmark - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1.19.2 + uses: benchmark-action/github-action-benchmark@v1.20.3 with: tool: 'benchmarkjs' output-file-path: .tmp/benchmark-results/cmd-api-server/run-cmd-api-server-benchmark.ts.log @@ -508,10 +508,10 @@ jobs: auto-push: ${{ github.ref == 'refs/heads/main' }} # Show alert with commit comment on detecting possible performance regression - alert-threshold: '25%' + alert-threshold: '200%' comment-on-alert: true fail-on-alert: true - alert-comment-cc-users: '@petermetz' + alert-comment-cc-users: '@hyperledger/cacti-maintainers' cactus-cmd-socketio-server: continue-on-error: false @@ -1102,7 +1102,7 @@ jobs: run: yarn run benchmark - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1.19.2 + uses: benchmark-action/github-action-benchmark@v1.20.3 with: tool: 'benchmarkjs' output-file-path: .tmp/benchmark-results/plugin-ledger-connector-besu/run-plugin-ledger-connector-besu-benchmark.ts.log @@ -1113,10 +1113,10 @@ jobs: auto-push: ${{ github.ref == 'refs/heads/main' }} # Show alert with commit comment on detecting possible performance regression - alert-threshold: '5%' + alert-threshold: '200%' comment-on-alert: true fail-on-alert: true - alert-comment-cc-users: '@petermetz' + alert-comment-cc-users: '@hyperledger/cacti-maintainers' cpl-connector-polkadot: continue-on-error: false diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile b/packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile index 4e5d603ff8..60872d9b19 100644 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /kotlin-spring/ RUN gradle build WORKDIR / -FROM openjdk:8u275-jre-slim-buster +FROM openjdk:24-slim-bookworm ARG APP=/usr/src/app ENV APP=/usr/src/app diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh b/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh index a1292106d9..aa317c750d 100755 --- a/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh +++ b/packages/cactus-plugin-ledger-connector-corda/src/main-server/start-app.sh @@ -2,6 +2,14 @@ # Without these we get crashes on JDK 17 an above since the introduction of the # Java Modules system. -EXTRA_JVM_ARGS="" + +EXTRA_JVM_ARGS="--add-exports java.base/sun.security.provider.certpath=ALL-UNNAMED" +EXTRA_JVM_ARGS="--add-exports java.base/sun.security.util=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-exports java.base/sun.security.rsa=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-exports jdk.crypto.ec/sun.security.ec=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-exports java.base/sun.security.x509=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-opens java.base/java.util=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-opens java.base/java.time=ALL-UNNAMED ${EXTRA_JVM_ARGS}" +EXTRA_JVM_ARGS="--add-opens java.base/java.io=ALL-UNNAMED ${EXTRA_JVM_ARGS}" for i in 1 2 3; do java $EXTRA_JVM_ARGS -jar ${APP}/kotlin-spring/build/libs/cactus-connector-corda-server-2.0.0-rc.2.jar && break || sleep 5; done