Skip to content

Commit

Permalink
Upgrade to Java 21 (#995)
Browse files Browse the repository at this point in the history
Upgrade build and runtime to Java 21. Following changes are also made to achieve this:

Upgraded to Gradle 8.9
Various plugin versions updated
Various dependencies versions updated
Besu and Teku
Owasp suppressions updated
Removed gatling performance test because it is not compatible with latest Gradle.
  • Loading branch information
usmansaleem authored Jul 23, 2024
1 parent 2cbd5f6 commit 3dafc7b
Show file tree
Hide file tree
Showing 41 changed files with 444 additions and 450 deletions.
48 changes: 14 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2.1
executors:
executor_med: # 2cpu, 4G ram
docker:
- image: cimg/openjdk:17.0
- image: cimg/openjdk:21.0
auth: &docker-auth
# Don't panic, throw away account to avoid Docker rate limits when downloading.
# Second reason we're doing this is so that forked PRs from external contributors works ie env vars aren't visible to forked PRs from within contexts
Expand All @@ -18,7 +18,7 @@ executors:

executor_large: # 4cpu, 8G ram
docker:
- image: cimg/openjdk:17.0
- image: cimg/openjdk:21.0
auth:
<<: *docker-auth
resource_class: large
Expand All @@ -30,7 +30,7 @@ executors:
executor_large_with_fc_devnet: # 4cpu, 8G ram
docker:
# Primary container
- image: cimg/openjdk:17.0
- image: cimg/openjdk:21.0
auth:
<<: *docker-auth
# Secondary container running lotus as devnet on port 7777
Expand Down Expand Up @@ -82,17 +82,17 @@ commands:
- restore_cache:
name: Restore cached gradle dependencies
keys:
- deps-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }}
- deps-{{ checksum "build.gradle" }}
- deps-
machine_java_17:
description: "Install Java 17 on machine executors"
- deps21-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }}
- deps21-{{ checksum "build.gradle" }}
- deps21-
machine_java:
description: "Install Java 21 on machine executors"
steps:
- run:
name: Java 17
name: Java 21
command: |
sudo apt update
sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless
sudo apt install -q --assume-yes openjdk-21-jre-headless openjdk-21-jdk-headless
sudo update-java-alternatives -a
capture_test_results:
description: "Capture test results"
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
- capture_test_reports
- save_cache:
name: Caching gradle dependencies
key: deps-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }}
key: deps21-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }}
paths:
- .gradle
- ~/.gradle
Expand Down Expand Up @@ -223,20 +223,6 @@ jobs:
- capture_test_results
- capture_test_reports

performanceTests:
executor: executor_large
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: Performance Tests
no_output_timeout: 20m
command: |
./gradlew --no-daemon clean installDist
./gradlew --no-daemon gatlingRun
- capture_test_reports

publish:
executor: executor_med
steps:
Expand All @@ -259,7 +245,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- machine_java
- run:
name: build and test Docker image
command: |
Expand All @@ -272,7 +258,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- machine_java
- docker_trust_sign
- docker_publish_images

Expand All @@ -282,7 +268,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- machine_java
- docker_trust_sign
- docker_publish_images

Expand Down Expand Up @@ -372,12 +358,6 @@ workflows:
<<: *filters-release-tags
context:
- protocols-signers
- performanceTests:
requires:
- build
filters:
tags:
<<: *filters-release-tags
- publishOpenApiSpec:
filters:
branches:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ this release. The Web3Signer docker image will also use Java 21, however, binary
require Java 21 to be available on the host machine.
- This is the last Web3Signer release to use the "filecoin" mode. The "filecoin" mode will be removed in a future release.

### Breaking Changes
- Use Java 21 for build and runtime. Remove Java 17 variant of docker image. zip/tar.gz distributions will require Java 21 or above to run Web3Signer.
- The Web3Signer metrics are now compatible with OpenMetrics data model. This results in the names of counter metrics to append `_total` suffix. Users may need to update their dashboards to reflect these changes.

### Features Added
- Added endpoint `/api/v1/eth2/ext/sign/:identifier` which is enabled using cli option `--Xsigning-ext-enabled=true`.
This endpoint allows signing of additional data not covered by the remoting API specs. [#982](https://github.com/Consensys/web3signer/pull/982)
Expand Down
20 changes: 9 additions & 11 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import groovy.text.SimpleTemplateEngine
*/

plugins {
id "de.undercouch.download" version "4.1.0"
id "de.undercouch.download" version "5.6.0"
id "com.google.osdetector" version "1.7.3"
id "io.gatling.gradle" version "3.9.3.1"
}

dependencies {
Expand Down Expand Up @@ -64,6 +63,7 @@ dependencies {
testImplementation 'com.github.arteam:simple-json-rpc-server'
testImplementation 'com.github.arteam:simple-json-rpc-client'
testImplementation 'org.flywaydb:flyway-core'
testImplementation 'org.flywaydb:flyway-database-postgresql'
testImplementation 'io.rest-assured:rest-assured'
testImplementation 'org.jdbi:jdbi3-core'
testImplementation 'org.zeroturnaround:zt-exec'
Expand All @@ -80,8 +80,6 @@ dependencies {
testImplementation 'com.azure:azure-security-keyvault-keys'
testImplementation 'com.azure:azure-security-keyvault-secrets'

gatlingImplementation configurations.getByName("testImplementation")

implementation 'software.amazon.awssdk:auth'
implementation 'software.amazon.awssdk:secretsmanager'
implementation 'software.amazon.awssdk:kms'
Expand All @@ -90,15 +88,15 @@ dependencies {
test.enabled = false

task cleanBesuInstall(type: Delete) {
delete "$buildDir/besu"
delete layout.buildDirectory.dir("besu")
}

task downloadBesu(type: Download) {
src {
// see gradle.properties for Besu URL
return new SimpleTemplateEngine().createTemplate(besuDistroUrl).make(["besuVersion":"$besuVersion"]).toString()
}
dest new File(buildDir, "besu-${besuVersion}.tar.gz")
dest layout.buildDirectory.file("downloads/besu-${besuVersion}.tar.gz")
onlyIfModified true
retries 3
}
Expand All @@ -114,15 +112,15 @@ task extractBesu(dependsOn: [
}
includeEmptyDirs = false
}
into "$buildDir/besu"
into layout.buildDirectory.dir("besu")
}

def vaultBinary () {
switch (osdetector.os) {
case "windows":
return new File(buildDir, "vault.exe").toString()
return layout.buildDirectory.file("vault-bin/vault.exe").get().toString()
default:
return new File(buildDir, "vault").toString()
return layout.buildDirectory.file("vault-bin/vault").get().toString()
}
}

Expand Down Expand Up @@ -154,13 +152,13 @@ task downloadVault(type: Download) {
src {
return vaultDownloadUrl()
}
dest new File(buildDir, "hashicorp.zip")
dest layout.buildDirectory.file("downloads/hashicorp.zip")
onlyIfModified true
}

task extractVault(dependsOn: downloadVault, type: Copy) {
from zipTree(downloadVault.dest)
into buildDir
into layout.buildDirectory.dir("vault-bin")
}

task acceptanceTest(dependsOn: [
Expand Down
93 changes: 0 additions & 93 deletions acceptance-tests/src/gatling/scala/Eth2SignSimulation.scala

This file was deleted.

58 changes: 0 additions & 58 deletions acceptance-tests/src/gatling/scala/FcBlsSignSimulation.scala

This file was deleted.

Loading

0 comments on commit 3dafc7b

Please sign in to comment.