diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e6a68b75..403a7aabb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ orbs: executors: executor_med: # 2cpu, 4G ram docker: - - image: cimg/openjdk:11.0 + - image: cimg/openjdk:17.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 @@ -21,7 +21,7 @@ executors: executor_large: # 4cpu, 8G ram docker: - - image: cimg/openjdk:11.0 + - image: cimg/openjdk:17.0 auth: <<: *docker-auth resource_class: large @@ -33,7 +33,7 @@ executors: executor_large_with_fc_devnet: # 4cpu, 8G ram docker: # Primary container - - image: cimg/openjdk:11.0 + - image: cimg/openjdk:17.0 auth: <<: *docker-auth # Secondary container running lotus as devnet on port 7777 @@ -55,7 +55,7 @@ executors: machine_executor_arm64: machine: - image: ubuntu-2004:202201-02 # Ubuntu 20.04, Docker v20.10.12, Docker Compose v1.29.2 + image: ubuntu-2204:current # https://circleci.com/developer/machine/image/ubuntu-2204 resource_class: arm.medium environment: architecture: "arm64" @@ -63,7 +63,7 @@ executors: machine_executor_amd64: machine: - image: ubuntu-2004:202201-02 # Ubuntu 20.04, Docker v20.10.12, Docker Compose v1.29.2 + image: ubuntu-2204:current # https://circleci.com/developer/machine/image/ubuntu-2204 docker_layer_caching: true working_directory: ~/project environment: @@ -89,7 +89,15 @@ commands: - deps-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }} - deps-{{ checksum "build.gradle" }} - deps- - + machine_java_17: + description: "Install Java 17 on machine executors" + steps: + - run: + name: Java 17 + command: | + sudo apt update + sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless + sudo update-java-alternatives -a capture_test_results: description: "Capture test results" steps: @@ -261,6 +269,7 @@ jobs: - prepare - attach_workspace: at: ~/project + - machine_java_17 - run: name: build and test Docker image command: | @@ -273,6 +282,7 @@ jobs: - prepare - attach_workspace: at: ~/project + - machine_java_17 - docker_trust_sign - docker_publish_images - notify @@ -283,6 +293,7 @@ jobs: - prepare - attach_workspace: at: ~/project + - machine_java_17 - docker_trust_sign - docker_publish_images - notify diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eae2e95c..548a9ab36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Next release ### Breaking Changes +- Use Java 17 for build and runtime. Remove Java 11 variant of docker image. zip/tar.gz distributions will require Java 17 or above to run Web3Signer. - Eth2 Azure command line option --azure-secrets-tags is now deprecated and is replaced with --azure-tags. The --azure-secrets-tags option will be removed in a future release. ### Features Added @@ -14,7 +15,8 @@ - Add eth_sendTransaction RPC method under the eth1 subcommand [#835](https://github.com/Consensys/web3signer/pull/835) - Add EIP-1559 support for eth1 public transactions for eth_sendTransaction and eth_signTransaction [#836](https://github.com/Consensys/web3signer/pull/836) - Add Azure bulk loading for secp256k1 keys in eth1 mode [#850](https://github.com/Consensys/web3signer/pull/850) -- Added Gnosis configuration for the 🦉 CAPELLA 🦉 network fork due at epoch 648704, UTC Tue 01/08/2023, 11:34:20 +- Added Gnosis configuration for the 🦉 CAPELLA 🦉 network fork due at epoch 648704, UTC Tue 01/08/2023, 11:34:20 [#865](https://github.com/Consensys/web3signer/pull/865) +- Java 17 for build and runtime. [#870](https://github.com/Consensys/web3signer/pull/870) ### Bugs fixed - Support long name aliases in environment variables and YAML configuration [#825](https://github.com/Consensys/web3signer/pull/825) diff --git a/acceptance-tests/build.gradle b/acceptance-tests/build.gradle index cf178f66b..65b89aa11 100644 --- a/acceptance-tests/build.gradle +++ b/acceptance-tests/build.gradle @@ -1,5 +1,4 @@ import groovy.text.SimpleTemplateEngine - /* * Copyright 2019 ConsenSys AG. * @@ -16,7 +15,7 @@ import groovy.text.SimpleTemplateEngine plugins { id "de.undercouch.download" version "4.1.0" id "com.google.osdetector" version "1.7.3" - id "io.gatling.gradle" version "3.7.0-M1" + id "io.gatling.gradle" version "3.9.3.1" } dependencies { diff --git a/build.gradle b/build.gradle index bff64bf44..ec7259e7e 100644 --- a/build.gradle +++ b/build.gradle @@ -40,8 +40,8 @@ plugins { id 'org.ajoberstar.grgit' version '4.1.1' } -if (!JavaVersion.current().java11Compatible) { - throw new GradleException("Java 11 or later is required to build Web3Signer.\n" + +if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { + throw new GradleException("Java 17 or later is required to build Web3Signer.\n" + " Detected version ${JavaVersion.current()}") } @@ -109,8 +109,8 @@ allprojects { from javadoc.destinationDir } - sourceCompatibility = 11 - targetCompatibility = 11 + sourceCompatibility = 17 + targetCompatibility = 17 repositories { // mavenLocal() //for local testing only, uncomment while testing locally build signers. @@ -462,7 +462,7 @@ tasks.register("dockerDistUntar") { } def dockerImage = "consensys/web3signer" -def dockerJdkVariants = ["jdk17", "jdk11",] +def dockerJdkVariants = ["jdk17",] def dockerBuildDir = "build/docker-web3signer/" task distDocker { diff --git a/docker/jdk11/Dockerfile b/docker/jdk11/Dockerfile deleted file mode 100644 index 5626216ab..000000000 --- a/docker/jdk11/Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -FROM eclipse-temurin:11 as jre-build - -# Create a custom Java runtime -RUN JAVA_TOOL_OPTIONS="-Djdk.lang.Process.launchMechanism=vfork" $JAVA_HOME/bin/jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM ubuntu:latest -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -RUN apt-get -y update && apt-get -y install libssl3 curl iputils-ping net-tools && rm -rf /var/lib/api/lists/* -RUN adduser --disabled-password --gecos "" --home /opt/web3signer web3signer && \ - chown web3signer:web3signer /opt/web3signer && chmod 755 /opt/web3signer - -USER web3signer -WORKDIR /opt/web3signer - -# copy application (with libraries inside) -COPY --chown=web3signer:web3signer web3signer /opt/web3signer/ - -ENV WEB3SIGNER_HTTP_LISTEN_HOST="0.0.0.0" -ENV WEB3SIGNER_METRICS_HOST="0.0.0.0" - -# List Exposed Ports -# Metrics, Rest API -EXPOSE 9001 9000 9000/udp - -# specify default command -ENTRYPOINT ["/opt/web3signer/bin/web3signer"] - - -# Build-time metadata as defined at http://label-schema.org -ARG BUILD_DATE -ARG VCS_REF -ARG VERSION -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Web3Signer" \ - org.label-schema.description="Ethereum 2.0 Signing Service" \ - org.label-schema.url="https://docs.web3signer.consensys.net" \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/ConsenSys/web3signer.git" \ - org.label-schema.vendor="ConsenSys" \ - org.label-schema.version=$VERSION \ - org.label-schema.schema-version="1.0" diff --git a/gradle/license-report-config/license-normalizer.json b/gradle/license-report-config/license-normalizer.json index 9e6bb5649..829b242d2 100644 --- a/gradle/license-report-config/license-normalizer.json +++ b/gradle/license-report-config/license-normalizer.json @@ -7,6 +7,7 @@ ], "transformationRules" : [ { "bundleName" : "MIT", "licenseNamePattern" : "\"MIT\\sLicense\"" }, + { "bundleName" : "MIT", "licenseNamePattern" : "(.*)SPDX-License-Identifier: MIT(.*)" }, { "bundleName" : "BSD", "licenseNamePattern" : "BSD licence" }, { "bundleName" : "CDDL-1.1", "licenseNamePattern" : "(.*)Dual license consisting of the CDDL v1.1 and GPL v2(.*)" }, { "bundleName" : "Apache-2.0", "licenseNamePattern" : "(.*)Apache-2.0(.*)" } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 4c9664270..77ab2fe80 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -77,7 +77,7 @@ dependencyManagement { entry 'junit-jupiter-params' } - dependency 'org.mock-server:mockserver-netty:5.11.2' + dependency 'org.mock-server:mockserver-netty:5.15.0' dependencySet(group: 'org.mockito', version: '4.2.0') { entry 'mockito-core'