An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
besu/.circleci/config.yml

476 lines
14 KiB

---
version: 2.1
orbs:
win: circleci/windows@5.0
executors:
besu_executor_small:
docker:
- image: cimg/openjdk:17.0
resource_class: small
working_directory: ~/project
environment:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
besu_executor_med: # 2cpu, 4G ram
docker:
- image: cimg/openjdk:17.0
resource_class: medium
working_directory: ~/project
environment:
architecture: "amd64"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
besu_arm64_executor_med: # 2cpu, 8G ram
machine: #https://circleci.com/developer/machine/image/ubuntu-2204
image: ubuntu-2204:2022.10.2
resource_class: arm.medium
working_directory: ~/project
environment:
architecture: "arm64"
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
besu_executor_xl: # 8cpu, 16G ram
docker:
- image: cimg/openjdk:17.0
resource_class: xlarge
working_directory: ~/project
environment:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4
xl_machine_executor:
machine: #https://circleci.com/developer/machine/image/ubuntu-2204
image: ubuntu-2204:2022.10.2
Added new job for Quorum Acceptance Tests (#2122) * ci/cd: added new job for GoQ Acceptance Tests running against Besu in GoQuorum mode Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * ci/cd: fixed missing workflow config Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: add missing setup_remote_docker Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * gradle: moved configuration to run the GoQ AT to the gradle file and added capturer of artifacts for circleci Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * tidy: remove unused executer Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove unused dependency Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * refactor: moved tags to a separate variable Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: increase resource for at executor Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore GoQ AT job to break pipeline Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * feature: updated tags for the GoQ AT Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: formatting Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove istanbul tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * doc: renaming to Quorum. remove todo. Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore graphql tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * feature: add RPC logs to acceptanceTestsQuorum Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore eth-api-signed Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore public estimate gas tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove randomness Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net>
4 years ago
resource_class: xlarge
trivy_executor:
docker:
- image: docker:stable-git
resource_class: small
working_directory: ~/project
commands:
prepare:
description: "Prepare"
steps:
- checkout
- run:
name: Install Packages - LibSodium, nssdb
command: |
sudo apt-get update
sudo apt-get install -y libsodium23 libsodium-dev libjemalloc-dev apt-transport-https haveged libnss3-tools
sudo service haveged restart
java --version
- restore_gradle_cache
restore_gradle_cache:
description: "Restore Gradle cache"
steps:
- restore_cache:
name: Restore cached gradle dependencies
keys:
- deps-{{ checksum "gradle/versions.gradle" }}-{{ .Branch }}-{{ .Revision }}
- deps-{{ checksum "gradle/versions.gradle" }}
- deps-
capture_test_results:
description: "Capture test results"
steps:
- run:
name: Jacoco
command: |
./gradlew --no-daemon jacocoTestReport
- run:
name: Gather test results
when: always
command: |
FILES=`find . -name test-results`
for FILE in $FILES
do
MODULE=`echo "$FILE" | sed -e 's@./\(.*\)/build/test-results@\1@'`
TARGET="build/test-results/$MODULE"
mkdir -p "$TARGET"
cp -rf ${FILE}/*/* "$TARGET"
done
- store_test_results:
path: build/test-results
- store_artifacts:
path: besu/build/reports/jacoco
capture_test_logs:
description: "Capture test logs"
steps:
- store_artifacts:
path: acceptance-tests/tests/build/acceptanceTestLogs
destination: acceptance-tests-logs
- store_artifacts:
path: acceptance-tests/tests/build/jvmErrorLogs
jobs:
assemble:
executor: besu_executor_xl
steps:
- prepare
- run:
name: Assemble
command: |
./gradlew --no-daemon clean compileJava compileTestJava assemble
- save_cache:
name: Caching gradle dependencies
key: deps-{{ checksum "gradle/versions.gradle" }}-{{ .Branch }}-{{ .Revision }}
paths:
- .gradle
- ~/.gradle
- persist_to_workspace:
root: ~/project
paths:
- ./
- store_artifacts:
name: Distribution artifacts
Added new job for Quorum Acceptance Tests (#2122) * ci/cd: added new job for GoQ Acceptance Tests running against Besu in GoQuorum mode Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * ci/cd: fixed missing workflow config Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: add missing setup_remote_docker Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * gradle: moved configuration to run the GoQ AT to the gradle file and added capturer of artifacts for circleci Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * tidy: remove unused executer Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove unused dependency Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * refactor: moved tags to a separate variable Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: increase resource for at executor Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore GoQ AT job to break pipeline Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * feature: updated tags for the GoQ AT Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: formatting Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove istanbul tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * doc: renaming to Quorum. remove todo. Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore graphql tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * feature: add RPC logs to acceptanceTestsQuorum Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore eth-api-signed Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: ignore public estimate gas tests Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net> * fix: remove randomness Signed-off-by: Ricardo Silva <ricardo.silva@consensys.net>
4 years ago
path: build/distributions
destination: distributions
when: always
testWindows:
executor: win/default
steps:
- attach_workspace:
at: ~/project
- run:
name: Unzip Windows build
no_output_timeout: 20m
command: |
cd build/distributions
unzip besu-*.zip -d besu-tmp
cd besu-tmp
mv besu-* ../besu
- run:
name: Test Besu Windows executable
no_output_timeout: 10m
command: |
build\distributions\besu\bin\besu.bat --help
build\distributions\besu\bin\besu.bat --version
dockerScan:
executor: trivy_executor
steps:
- checkout
- restore_gradle_cache
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Install trivy
command: |
apk add --update-cache --upgrade curl bash
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- run:
name: Scan with trivy
shell: /bin/sh
command: |
for FILE in $(ls docker)
do
if [[ $FILE == "test.sh" || $FILE == "tests" ]]; then
continue
fi
docker pull -q "hyperledger/besu:develop-$FILE"
trivy -q image --exit-code 1 --no-progress --severity HIGH,CRITICAL "hyperledger/besu:develop-$FILE"
done
unitTests:
executor: besu_executor_xl
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: Build
no_output_timeout: 20m
command: |
./gradlew --no-daemon build
- capture_test_results
integrationTests:
Vert.x upgrade (with tests) (#3135) * compile issues sorted, some tests failing Signed-off-by: Justin Florentine <justin+github@florentine.us> * closing runnerBehind closes the vertx shared with runnerAhead, which now throws an exception Signed-off-by: Justin Florentine <justin+github@florentine.us> * checkpoint when 4/5 websocket login tests pass Signed-off-by: Justin Florentine <justin+github@florentine.us> * exp moved to attribute from principal Signed-off-by: Justin Florentine <justin+github@florentine.us> * fixed more tests Signed-off-by: Justin Florentine <justin+github@florentine.us> * fixed more tests Signed-off-by: Justin Florentine <justin+github@florentine.us> * exception handling test improvement Signed-off-by: Justin Florentine <justin+github@florentine.us> * exception handling test improvement Signed-off-by: Justin Florentine <justin+github@florentine.us> * static renamed Signed-off-by: Justin Florentine <justin+github@florentine.us> * We want old implementation of the host() Newly vertex handles the forward headers and modifies host(). In the process vert.x loses track of port from Host header in case the port was not a string. Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * adding dependency on jackson-databind for tests Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * making sure changes are spotless Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * Dealing with regression Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * fixing last failing vert.x test hopefully Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * removed commented out code Signed-off-by: Justin Florentine <justin+github@florentine.us> * reverts debugging adjustment Signed-off-by: Justin Florentine <justin+github@florentine.us> * removed commented out code Signed-off-by: Justin Florentine <justin+github@florentine.us> * minor whitespace cleanup Signed-off-by: Justin Florentine <justin+github@florentine.us> * (internal) Refactor 'onchain' to 'flexible' where applicable (#3075) * CLI option name change Signed-off-by: Frank Li <b439988l@gmail.com> * refactor privacyparameters.java and add deprecation warning Signed-off-by: Frank Li <b439988l@gmail.com> * more refactoring Signed-off-by: Frank Li <b439988l@gmail.com> * add to everything.toml Signed-off-by: Frank Li <b439988l@gmail.com> * bugs Signed-off-by: Frank Li <b439988l@gmail.com> * more missing variable names Signed-off-by: Frank Li <b439988l@gmail.com> * more classes Signed-off-by: Frank Li <b439988l@gmail.com> * more classes Signed-off-by: Frank Li <b439988l@gmail.com> * fix compile error Signed-off-by: Frank Li <b439988l@gmail.com> * add new test to invalidate passing both commands Signed-off-by: Frank Li <b439988l@gmail.com> * more refactoring + more tests Signed-off-by: Frank Li <b439988l@gmail.com> * new batch Signed-off-by: Frank Li <b439988l@gmail.com> * final batch? Signed-off-by: Frank Li <b439988l@gmail.com> * failing unit test Signed-off-by: Frank Li <b439988l@gmail.com> * revert incorrect refactoring back to onchain Signed-off-by: Frank Li <b439988l@gmail.com> * fix unit test Signed-off-by: Frank Li <b439988l@gmail.com> * comment Signed-off-by: Frank Li <b439988l@gmail.com> * comment Signed-off-by: Frank Li <b439988l@gmail.com> * support both privx methods Signed-off-by: Frank Li <b439988l@gmail.com> * add to changelog Signed-off-by: Frank Li <b439988l@gmail.com> * address comment Signed-off-by: Frank Li <b439988l@gmail.com> * add plugin privacy Signed-off-by: Frank Li <b439988l@gmail.com> Signed-off-by: Justin Florentine <justin+github@florentine.us> * checkpoint when 4/5 websocket login tests pass Signed-off-by: Justin Florentine <justin+github@florentine.us> * trying to figure out how to decouple this test Signed-off-by: Justin Florentine <justin+github@florentine.us> * spotless Signed-off-by: Justin Florentine <justin+github@florentine.us> * removes Orion from integration test Signed-off-by: Justin Florentine <justin+github@florentine.us> * spotless Signed-off-by: Justin Florentine <justin+github@florentine.us> * Add jackson dependency to merge module Signed-off-by: Diego López León <dieguitoll@gmail.com> * Migrate JWTAuthOptions creations for public keys Signed-off-by: Diego López León <dieguitoll@gmail.com> * Check http client response status Signed-off-by: Diego López León <dieguitoll@gmail.com> * Replace Orian with Tessera in tests Signed-off-by: Diego López León <dieguitoll@gmail.com> * Change Tessera expected error messages in tests Signed-off-by: Diego López León <dieguitoll@gmail.com> * Change executor of integrationTests to allow spanning Docker processes Signed-off-by: Diego López León <dieguitoll@gmail.com> Co-authored-by: Justin Florentine <justin+github@florentine.us> Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com> Co-authored-by: Frank Li <39414003+frankisawesome@users.noreply.github.com> Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
3 years ago
executor: xl_machine_executor
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: IntegrationTests
command: |
./gradlew --no-daemon integrationTest
- run:
name: CompileJmh
command: |
./gradlew --no-daemon compileJmh
- capture_test_results
referenceTests:
executor: besu_executor_xl
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: ReferenceTests
no_output_timeout: 30m
command: |
git submodule update --init --recursive
./gradlew --no-daemon referenceTest
- capture_test_results
acceptanceTests:
parallelism: 6
executor: xl_machine_executor
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: AcceptanceTests (Mainnet)
no_output_timeout: 20m
command: |
CLASSNAMES=$(circleci tests glob "acceptance-tests/tests/src/test/java/**/*.java" \
| sed 's@.*/src/test/java/@@' \
| sed 's@/@.@g' \
| sed 's/.\{5\}$//' \
| circleci tests split --split-by=timings --timings-type=classname)
# Format the arguments to "./gradlew test"
GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}')
./gradlew --no-daemon acceptanceTestMainnet $GRADLE_ARGS
- capture_test_results
- capture_test_logs
acceptanceTestsNonMainnet:
parallelism: 6
executor: xl_machine_executor
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: AcceptanceTests (Non-Mainnet)
no_output_timeout: 20m
command: |
CLASSNAMES=$(circleci tests glob "acceptance-tests/tests/src/test/java/**/*.java" \
| sed 's@.*/src/test/java/@@' \
| sed 's@/@.@g' \
| sed 's/.\{5\}$//' \
| circleci tests split --split-by=timings --timings-type=classname)
# Format the arguments to "./gradlew test"
GRADLE_ARGS=$(echo $CLASSNAMES | awk '{for (i=1; i<=NF; i++) print "--tests",$i}')
./gradlew --no-daemon acceptanceTestNonMainnet $GRADLE_ARGS
- capture_test_results
- capture_test_logs
buildDocker:
executor: besu_executor_med
steps:
- prepare
- attach_workspace:
at: ~/project
- setup_remote_docker
- run:
name: hadoLint_openjdk_17
command: |
docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile
- run:
name: hadoLint_openjdk_17_debug
command: |
docker run --rm -i hadolint/hadolint < docker/openjdk-17-debug/Dockerfile
- run:
name: hadoLint_openjdk_latest
command: |
docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile
- run:
name: hadoLint_graalvm
command: |
docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile
- run:
name: build image
command: |
./gradlew --no-daemon distDocker
- run:
name: test image
command: |
mkdir -p docker/reports
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-amd64 -o ./docker/tests/goss-linux-amd64
./gradlew --no-daemon testDocker
buildArm64Docker:
executor: besu_arm64_executor_med
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: hadoLint_openjdk_17
command: |
docker run --rm -i hadolint/hadolint < docker/openjdk-17/Dockerfile
- run:
name: hadoLint_openjdk_latest
command: |
docker run --rm -i hadolint/hadolint < docker/openjdk-latest/Dockerfile
- run:
name: hadoLint_graalvm
command: |
docker run --rm -i hadolint/hadolint < docker/graalvm/Dockerfile
- run:
name: Java_17
command: |
sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless
sudo update-java-alternatives -a
- run:
name: build image
command: |
./gradlew --no-daemon distDocker
- run:
name: test image
command: |
mkdir -p docker/reports
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-arm -o ./docker/tests/goss-linux-arm64
./gradlew --no-daemon testDocker
publish:
executor: besu_executor_med
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: Publish
command: |
./gradlew --no-daemon artifactoryPublish
publishDocker:
executor: besu_executor_med
steps:
- prepare
- attach_workspace:
at: ~/project
- setup_remote_docker
- run:
name: Publish Docker
command: |
docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}"
./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" dockerUpload
publishArm64Docker:
executor: besu_arm64_executor_med
steps:
- prepare
- attach_workspace:
at: ~/project
- run:
name: Java_17
command: |
sudo apt install -q --assume-yes openjdk-17-jre-headless openjdk-17-jdk-headless
sudo update-java-alternatives -a
- run:
name: Publish Docker
command: |
docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}"
./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" dockerUpload
manifestDocker:
executor: besu_executor_med
steps:
- prepare
- setup_remote_docker
- run:
name: Create and publish docker manifest
command: |
docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}"
./gradlew --no-daemon "-Pbranch=${CIRCLE_BRANCH}" --parallel manifestDocker
workflows:
version: 2
default:
jobs:
- assemble
- unitTests:
requires:
- assemble
- testWindows:
requires:
- assemble
- referenceTests:
requires:
- assemble
- integrationTests:
requires:
- assemble
- acceptanceTests:
requires:
- assemble
- buildDocker:
requires:
- assemble
- buildArm64Docker:
requires:
- assemble
- publish:
filters:
branches:
only:
- main
- /^release-.*/
requires:
- assemble
- integrationTests
- unitTests
- acceptanceTests
- referenceTests
- buildDocker
- publishDocker:
filters:
branches:
only:
- main
- /^release-.*/
requires:
- assemble
- integrationTests
- unitTests
- acceptanceTests
- referenceTests
- buildDocker
context:
- besu-dockerhub-rw
- publishArm64Docker:
filters:
branches:
only:
- main
- /^release-.*/
requires:
- integrationTests
- unitTests
- acceptanceTests
- referenceTests
- buildArm64Docker
context:
- besu-dockerhub-rw
- manifestDocker:
filters:
branches:
only:
- main
- /^release-.*/
requires:
- publishDocker
- publishArm64Docker
context:
- besu-dockerhub-rw
nightly:
triggers:
- schedule:
cron: "0 19 * * *"
filters:
branches:
only:
- main
jobs:
- assemble
- dockerScan
- acceptanceTestsNonMainnet