Skip to content

Commit

Permalink
Use Java 17 for build and runtime (#752)
Browse files Browse the repository at this point in the history
* build.gradle: Java 17
* circleci: Java 17
* build.gradle: removing jdk11 docker tag
* changelog
* license reporting config: MIT license normalized
* Update gatling (performance test) gradle plugin version
* CircleCI: Install Java 17 for machine executors
* circleci: machine image to use ubuntu-2204:current
  • Loading branch information
usmansaleem authored Apr 11, 2023
1 parent 8a9e8df commit 7a2e0de
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 62 deletions.
23 changes: 17 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -55,15 +55,15 @@ 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"
platform: "linux/arm64"

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:
Expand All @@ -81,7 +81,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:
Expand Down Expand Up @@ -253,6 +261,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- run:
name: build and test Docker image
command: |
Expand All @@ -265,6 +274,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- docker_trust_sign
- docker_publish_images
- notify
Expand All @@ -275,6 +285,7 @@ jobs:
- prepare
- attach_workspace:
at: ~/project
- machine_java_17
- docker_trust_sign
- docker_publish_images
- notify
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

## Upcoming release
### Breaking Changes
- Using Java 17 for build and runtime. Removing Java 11 variant of docker image. zip/tar.gz distributions will require
Java 17 or above to run Web3Signer.

### Features Added
- Optional Azure bulk loading tags support using cli option `--azure-secrets-tags`.
- Java 17 for build and runtime.

---
## 23.3.1
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugins {
id "de.undercouch.download" version "4.1.0"
id "com.google.osdetector" version "1.6.2"
id "io.gatling.gradle" version "3.7.0-M1"
id "io.gatling.gradle" version "3.9.3.1"
}

dependencies {
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()}")
}

Expand Down Expand Up @@ -109,8 +109,8 @@ allprojects {
from javadoc.destinationDir
}

sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 17
targetCompatibility = 17

repositories {
mavenCentral()
Expand Down Expand Up @@ -461,7 +461,7 @@ tasks.register("dockerDistUntar") {
}

def dockerImage = "consensys/web3signer"
def dockerJdkVariants = ["jdk17", "jdk11",]
def dockerJdkVariants = ["jdk17",]
def dockerBuildDir = "build/docker-web3signer/"

task distDocker {
Expand Down
50 changes: 0 additions & 50 deletions docker/jdk11/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions gradle/license-report-config/license-normalizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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(.*)" }
Expand Down

0 comments on commit 7a2e0de

Please sign in to comment.