Feat/integrate linea besu package (#900)

* initial commit

* feat: merge changes from linea-besu-package latest main

* feat: change locationn of linea-devnet workflow

* feat: add job outputs for build-and-upload-artifact

* fix: assemble-devnet path

* fix: linea-devnet.env path

* fix: linea-devnet.env path for versions.txt copy

* fix: linea-besu path for placing the package together to build the docker images

* feat: add tree command install

* feat: add tree command install

* feat: add tree command install

* feat: add tree command install

* feat: revise linea-besu-package pattern for docker image artifacts download

* fix: sed command

* fix: tracer-plugin-version job output variable name

* feat: revise echo for expected-traces-api-version-v2

* feat: build and push to dockerhub whenever e2e tests succeeded even for pull requests

* fix: right path for linea-besu-package in build-and-push-dockerhub

* feat: remove redundant build and just push image to dockerhub after e2e tests passed

* feat: add parameters for build the combined manifest

* Revert "feat: add parameters for build the combined manifest"

This reverts commit 83d315f4fec0ebb5f658a3c0a2f903b43991061c.

* Revert "feat: remove redundant build and just push image to dockerhub after e2e tests passed"

This reverts commit 7b0dcd7b75f1c86e142aca048b0616ecf71b6553.

* feat: revert to build and push after e2e tests passed

* feat: updated linea-devnet.env for latest versions

* feat: removed the use of filter commit changes

* Revert "feat: updated linea-devnet.env for latest versions"

This reverts commit 8bfeb979b9ddef92e7a7bebfacbe639adee95ef3.

* feat: revised output values

* feat: reuse besu package build test push

* fix: linea_env inputs name

* feat: refactoring out assemble actions with linea_env input

* fix: assemble name

* feat: refactoring and added mainnet and sepolia workflow

* feat: removed unnecessary files

* Revert "feat: removed unnecessary files"

This reverts commit a60d1df7df3a1b6d3f74b3b0735f8070320bc4b5.

* feat: removed unnecessary files

* feat: add besu run test in reuse-linea-besu-package-build-test-push workflow

* fix: step typo

* fix: step outputs files typo

* fix: run-test outcome check

* fix: use result instead of outcome

* feat: add mainnet linea-besu-package workflow

* feat: add filter commit changes to determine running e2e and push image

* feat: force e2e test run and push to dockerhub when triggered manually

* feat: skip filter changes if triggered manually

* fix: missing quote

* feat: add if always in build-test-push

* feat: revise release to manual workflow

* fix: move up checkout

* fix: remove cd release

* fix: cd into the correct folder linea-besu-package/linea-besu

* fix: added release_tag_prefix and correct path for plugin tar files

* fix: release permission and besu tar.gz location

* feat: temp disable sepolia and devnet, and add changelog

* feat: set git-push as false in Changelog Action

* feat: re-enable sepolia and devnet, cleanup commented lines, removed unnecessary files

* fix: latest tag condition

* feat: use env for linea_env for tags

* feat: use env for linea_env for tags

* fix: syntax error of echo append

* feat: revise release note

* feat: clean up commented codes and remove output workflow id

* feat: move besu container check script

* feat: add timestamp in the release tag

* fix: check against github event name for compile release note

* feat: publish release log for every dockerhub image push and update README

* fix: release tag issue and change log only for manual release

* feat: revise release to tag on commit

* feat: temp change on versions and add prerelease

* fix: mainnet staterecovery version

* feat: update README and detect config changes to push image

* feat: update env version file

* feat: revise README

* feat: update devnet version

* feat: update devnet version

* feat: update path matching

* feat: update to use same format of release tag across all releases

* feat: added ref name and event name in release note

* feat: added markdown highlight

* feat: fixed in-line code block

* fix: in-line code block

* fix: in-line code block

* feat: add workflow link in release note

* feat: fix workflow link in release note

* feat: fix workflow link in release note

* feat: fix workflow link in release note

* fix: markdown highlight

* feat: update commit tag for PR as last commit on branch instead of merge commit

* feat: remove env files and env workflows to achieve environment-agnostic

* feat: update versions env file for beta v2

* feat: move linea.env to versions.env and update workflow accordingly

* feat: update README.md

* feat: remove commented out if check workflow_dispatch

* feat: update README.md

* staterecovery: update version

* feat: updated input description and removed unnecessary files

* feat: make assemble action to release notes based on inputs

---------

Co-authored-by: Fluent Crafter <205769460+fluentcrafter@users.noreply.github.com>
This commit is contained in:
jonesho
2025-05-09 11:47:16 +08:00
committed by GitHub
parent fd514a8a06
commit 2bdd4833e4
25 changed files with 3021 additions and 0 deletions

View File

@@ -0,0 +1,172 @@
---
name: 'assemble'
description: 'Composite action to assemble the artifacts for the targer environment'
inputs:
release_tag_prefix:
description: 'Custom release tag prefix'
required: true
compile_release_notes:
description: 'Compile release notes or not'
required: false
default: 'false'
outputs:
workflow_id:
description: workflow id
value: ${{ steps.workflowdetails.outputs.id }}
build_date:
description: build date
value: ${{ steps.workflowdetails.outputs.build_date }}
dockertag:
description: docker tag
value: ${{ steps.dockertag.outputs.dockertag }}
dockerimage:
description: docker image
value: ${{ steps.dockerimage.outputs.dockerimage }}
releasetag:
description: release tag
value: ${{ steps.releasetag.outputs.releasetag }}
tracer_plugin_version:
description: tracer plugin version
value: ${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}
runs:
using: "composite"
steps:
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: Consensys/docs-gha
path: .docs-gha
- name: get workflow_details
id: workflowdetails
shell: bash
run: |
echo "id=${{ github.run_id }}" >> $GITHUB_OUTPUT
echo "build_date=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
- name: get versions via dotenv
id: dotenv
uses: falti/dotenv-action@v1
with:
path: linea-besu-package/versions.env
mode: development
keys-case: lower
log-variables: true
load-mode: strict
- name: Set timestamp
id: timestamp
shell: bash
run: |
echo "TIMESTAMP=$(date -u +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
- name: Compute commit hash
id: commithash
shell: bash
run: |
# For PR, GITHUB_SHA is NOT the last commit pushed onto the PR branch - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "commithash=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT
else
echo "commithash=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
fi
- name: set docker tag
id: dockertag
shell: bash
run: |
if [ -n "${{ inputs.release_tag_prefix }}" ]; then
echo "dockertag=${{ inputs.release_tag_prefix }}-${{ steps.timestamp.outputs.TIMESTAMP }}-${{ steps.commithash.outputs.commithash }}" >> $GITHUB_OUTPUT
else
echo "dockertag=${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}-${{ steps.timestamp.outputs.TIMESTAMP }}-${{ steps.commithash.outputs.commithash }}" >> $GITHUB_OUTPUT
fi
- name: set release tag
id: releasetag
shell: bash
run: |
echo "releasetag=${{ steps.dockertag.outputs.dockertag }}" >> $GITHUB_OUTPUT
- name: set docker image
id: dockerimage
shell: bash
run: |
echo "dockerimage=consensys/linea-besu-package:${{ steps.dockertag.outputs.dockertag }}" >> "$GITHUB_OUTPUT"
- name: download and untar the linea-besu archive
shell: bash
run: |
cd /tmp/
echo "downloading besu from linea-besu-upstream: ${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}"
wget -nv "${{ steps.dotenv.outputs.LINEA_BESU_BASE_URL }}${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}/${{ steps.dotenv.outputs.LINEA_BESU_FILENAME_PREFIX }}-${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}.tar.gz"
tar -xvf ${{ steps.dotenv.outputs.LINEA_BESU_FILENAME_PREFIX }}-${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}.tar.gz
mv /tmp/${{ steps.dotenv.outputs.LINEA_BESU_FILENAME_PREFIX }}-${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }} /tmp/besu
- name: copy the list of versions to the container
shell: bash
run: |
cp ./linea-besu-package/versions.env /tmp/besu/versions.txt
mkdir -p /tmp/besu/plugins
- name: get the plugins
shell: bash
run: |
cd /tmp/besu/plugins
echo "getting linea_sequencer_plugin_version: ${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }}"
wget -nv "https://github.com/Consensys/linea-sequencer/releases/download/v${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }}/linea-sequencer-v${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }}.jar" -P /tmp/besu/plugins
echo "getting linea_finalized_tag_updater_plugin_version: ${{ steps.dotenv.outputs.LINEA_FINALIZED_TAG_UPDATER_PLUGIN_VERSION }}"
wget -nv "https://github.com/Consensys/linea-monorepo/releases/download/linea-finalized-tag-updater-v${{ steps.dotenv.outputs.LINEA_FINALIZED_TAG_UPDATER_PLUGIN_VERSION }}/linea-finalized-tag-updater-v${{ steps.dotenv.outputs.LINEA_FINALIZED_TAG_UPDATER_PLUGIN_VERSION }}.jar" -P /tmp/besu/plugins
echo "getting linea_staterecovery_plugin_version: ${{ steps.dotenv.outputs.LINEA_STATERECOVERY_PLUGIN_VERSION }}"
wget -nv "https://github.com/Consensys/linea-monorepo/releases/download/linea-staterecovery-v${{ steps.dotenv.outputs.LINEA_STATERECOVERY_PLUGIN_VERSION }}/linea-staterecovery-besu-plugin-v${{ steps.dotenv.outputs.LINEA_STATERECOVERY_PLUGIN_VERSION }}.jar" -P /tmp/besu/plugins
echo "getting linea_tracer_plugin_version: ${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}"
wget -nv "https://github.com/Consensys/linea-tracer/releases/download/${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}/linea-tracer-${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}.jar" -P /tmp/besu/plugins
echo "getting shomei_plugin_version: ${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }}"
wget -nv "https://github.com/Consensys/besu-shomei-plugin/releases/download/v${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }}/besu-shomei-plugin-v${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }}.jar" -P /tmp/besu/plugins
- name: place the packages together for preparing docker image build
shell: bash
run: |
cd linea-besu-package/linea-besu
mv /tmp/besu ./
mv config/ genesis/ profiles/ besu/
sudo apt update
sudo apt-get install --no-install-recommends --assume-yes tree
tree .
- name: compile release notes
id: release_create_artifacts
if: ${{ inputs.compile_release_notes == 'true' }}
shell: bash
run: |
mkdir release && cd release
tar -czvf linea-besu-package-${{ steps.dockertag.outputs.dockertag }}.tar.gz ../linea-besu-package/linea-besu/
echo "# Release Artifact: Linea Besu Package" > output.md
echo "**Name:** linea-besu-package-${{ steps.dockertag.outputs.dockertag }}.tar.gz" >> output.md
echo "**SHA256:** $(sha256sum linea-besu-package-${{ steps.dockertag.outputs.dockertag }}.tar.gz | awk '{ print $1 }' )" >> output.md
echo "**From:** [${{ github.ref_name }} (${{ github.event_name }})](https://github.com/Consensys/linea-monorepo/actions/runs/${{ github.run_id }})" >> output.md
echo "" >> output.md
echo "### Besu and Plugin Details" >> output.md
echo "| Module | Version | SHA-256 |" >> output.md
echo "|--------|---------|--------------|" >> output.md
echo "| linea-besu | ${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }} | $(sha256sum /tmp/${{ steps.dotenv.outputs.LINEA_BESU_FILENAME_PREFIX }}-${{ steps.dotenv.outputs.LINEA_BESU_TAR_GZ }}.tar.gz | awk '{ print $1 }' ) |" >> output.md
echo "| linea-sequencer-plugin | ${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu-package/linea-besu/besu/plugins/linea-sequencer-v${{ steps.dotenv.outputs.LINEA_SEQUENCER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| linea-tracer-plugin | ${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu-package/linea-besu/besu/plugins/linea-tracer-${{ steps.dotenv.outputs.LINEA_TRACER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| linea-finalized-tag-updater-plugin | ${{ steps.dotenv.outputs.LINEA_FINALIZED_TAG_UPDATER_PLUGIN_VERSION }} | $(sha256sum ../linea-besu-package/linea-besu/besu/plugins/linea-finalized-tag-updater-v${{ steps.dotenv.outputs.LINEA_FINALIZED_TAG_UPDATER_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| linea-staterecovery-plugin | ${{ steps.dotenv.outputs.LINEA_STATERECOVERY_PLUGIN_VERSION }} | $(sha256sum ../linea-besu-package/linea-besu/besu/plugins/linea-staterecovery-besu-plugin-v${{ steps.dotenv.outputs.LINEA_STATERECOVERY_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "| shomei-plugin | ${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }} | $(sha256sum ../linea-besu-package/linea-besu/besu/plugins/besu-shomei-plugin-v${{ steps.dotenv.outputs.SHOMEI_PLUGIN_VERSION }}.jar | awk '{ print $1 }' ) |" >> output.md
echo "" >> output.md

View File

@@ -0,0 +1,58 @@
name: linea-besu-package-release
on:
pull_request:
push:
branches:
- main
paths:
- 'linea-besu-package/**'
- '.github/actions/linea-besu-package/**'
- '.github/workflows/linea-besu-package-release.yml'
- '.github/workflows/reuse-linea-besu-package-*.yml'
workflow_call:
workflow_dispatch:
inputs:
release_tag_prefix:
description: 'Custom release tag prefix, i.e. docker image tag would be [prefix]-[YYYYMMDDHHMMSS]-[commit], if not given, the tracer plugin version from "versions.env" would be used as prefix'
required: false
type: string
default: ''
permissions:
actions: read
id-token: write
contents: write
jobs:
filter-commit-changes:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-small
name: Filter commit changes
if: ${{ github.event_name != 'workflow_dispatch' }}
outputs:
versions_env: ${{ steps.filter.outputs.versions-env }}
linea_configs: ${{ steps.filter.outputs.linea-configs }}
steps:
- name: Filter commit changes
uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
list-files: "json"
filters: |
versions-env:
- 'linea-besu-package/versions.env'
linea-configs:
- 'linea-besu-package/linea-besu/**'
build-test-push:
needs: [ filter-commit-changes ]
if: ${{ always() }}
uses: ./.github/workflows/reuse-linea-besu-package-build-test-push.yml
with:
release_tag_prefix: ${{ inputs.release_tag_prefix }}
run_test: true
run_e2e_test: ${{ github.event_name == 'workflow_dispatch' || needs.filter-commit-changes.outputs.versions_env == 'true' }}
push_image: ${{ github.event_name == 'workflow_dispatch' || needs.filter-commit-changes.outputs.versions_env == 'true' || needs.filter-commit-changes.outputs.linea_configs == 'true' }}
secrets: inherit

View File

@@ -0,0 +1,213 @@
name: Reusable linea-besu-package build, test, and push
on:
workflow_call:
inputs:
release_tag_prefix:
required: true
type: string
run_test:
required: true
type: boolean
run_e2e_test:
required: true
type: boolean
push_image:
required: true
type: boolean
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
jobs:
build-and-upload-artifact:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
if: ${{ inputs.run_test || inputs.run_e2e_test }}
environment: dockerhub
outputs:
linea_besu_package_tag: ${{ steps.assemble.outputs.dockertag }}
expected_traces_api_version: ${{ steps.assemble.outputs.tracer_plugin_version }}
dockerimage: ${{ steps.assemble.outputs.dockerimage }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: build the linea artifacts
id: assemble
uses: ./.github/actions/linea-besu-package/assemble
with:
release_tag_prefix: ${{ inputs.release_tag_prefix }}
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: set docker build args
run: |
echo "Building docker tag: ${{ steps.assemble.outputs.dockertag }}"
echo "Building docker image: ${{ steps.assemble.outputs.dockerimage }}"
- name: build the combined manifest
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
context: linea-besu-package/linea-besu/.
platforms: linux/amd64
provenance: false
build-args: |
VERSION=${{ steps.assemble.outputs.dockertag }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.assemble.outputs.build_date }}
load: true
push: false
tags: |
consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }}
- name: Save Docker image as artifact
run: |
docker images
docker save consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }} | gzip > linea-besu-package-image.tar.gz
shell: bash
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: linea-besu-package
path: linea-besu-package-image.tar.gz
retention-days: 1
run-test:
needs: [ build-and-upload-artifact ]
if: ${{ inputs.run_test }}
concurrency:
group: run-test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
uses: ./.github/workflows/reuse-linea-besu-package-run-test.yml
with:
dockerimage: ${{ needs.build-and-upload-artifact.outputs.dockerimage }}
run-e2e-tests:
needs: [ build-and-upload-artifact ]
if: ${{ inputs.run_e2e_test }}
concurrency:
group: run-e2e-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
uses: ./.github/workflows/reuse-linea-besu-package-run-e2e-tests.yml
with:
linea_besu_package_tag: ${{ needs.build-and-upload-artifact.outputs.linea_besu_package_tag }}
expected_traces_api_version: ${{ needs.build-and-upload-artifact.outputs.expected_traces_api_version }}
e2e-tests-logs-dump: true
secrets: inherit
build-and-push-dockerhub:
needs: [ run-test, run-e2e-tests ]
if: ${{ always() && inputs.push_image && (needs.run-e2e-test.result == 'skipped' || needs.run-e2e-tests.outputs.tests_outcome == 'success') && (needs.run-test.result == 'skipped' || needs.run-test.result == 'success') }}
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
environment: dockerhub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: build the linea artifacts
id: assemble
uses: ./.github/actions/linea-besu-package/assemble
with:
release_tag_prefix: ${{ inputs.release_tag_prefix }}
compile_release_notes: ${{ inputs.push_image }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: set docker build args
run: |
echo "Building docker tag: ${{ steps.assemble.outputs.dockertag }}"
echo "Building docker image: ${{ steps.assemble.outputs.dockerimage }}"
- name: build and push the combined manifest
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
context: linea-besu-package/linea-besu/.
platforms: linux/arm64,linux/amd64
provenance: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=${{ steps.assemble.outputs.dockertag }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.assemble.outputs.build_date }}
push: true
tags: |
consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }}
${{ github.ref == 'refs/heads/main' && 'consensys/linea-besu-package:develop' || '' }}
${{ github.event_name == 'workflow_dispatch' && 'consensys/linea-besu-package:latest' || '' }}
### update the release notes with docker hashes
- name: create the release notes and then the release
id: release_create_artifacts
run: |
cd release
MANIFEST=$(docker manifest inspect consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }})
if [ $? -eq 0 ]; then
echo "### Docker Image Details" >> output.md
echo "" >> output.md
echo "To pull the image, use the following command:" >> output.md
echo "\`\`\`" >> output.md
echo "docker pull consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }}" >> output.md
echo "\`\`\`" >> output.md
echo "" >> output.md
echo "| Digest | OS | Architecture |" >> output.md
echo "|--------|----|--------------|" >> output.md
echo "$MANIFEST" | jq -r '.manifests[] | select(.platform.architecture != "unknown" and .platform.os != "unknown") | "| \(.digest) | \(.platform.os) | \(.platform.architecture) |"' >> output.md
else
echo "Docker image consensys/linea-besu-package:${{ steps.assemble.outputs.dockertag }} does not exist on dockerhub"
exit 1
fi
- name: Conventional Changelog Action
if: ${{ github.event_name == 'workflow_dispatch' }}
id: change_log
uses: TriPSs/conventional-changelog-action@v5
with:
git-path: ./linea-besu-package/
git-push: false
output-file: "false"
- name: Append Changelog Action to release note
if: ${{ github.event_name == 'workflow_dispatch' }}
id: append_change_log
shell: bash
run: |
cd release
echo "## What's Changed" >> output.md
echo "${{ steps.change_log.outputs.clean_changelog }}" >> output.md
echo "output.md=$(cat output.md)"
- name: release - publish artifacts and release notes
id: release_publish
uses: softprops/action-gh-release@v2
with:
name: Linea Besu Package ${{ steps.assemble.outputs.releasetag }}
tag_name: linea-besu-package-${{ steps.assemble.outputs.releasetag }}
body_path: release/output.md
prerelease: ${{ github.event_name != 'workflow_dispatch' }}
generate_release_notes: false
target_commitish: ${{ github.sha }}
fail_on_unmatched_files: true
files: |
release/linea-besu-package-${{ steps.assemble.outputs.dockertag }}.tar.gz

View File

@@ -0,0 +1,134 @@
name: Reusable run e2e tests
on:
workflow_call:
inputs:
linea_besu_package_tag:
description: The tag to use for all linea-besu-package images
required: true
type: string
expected_traces_api_version:
description: The expected traces api version used by cooridinator
required: true
type: string
e2e-tests-with-ssh:
description: Run end to end tests with ability to ssh into environment
required: false
type: boolean
default: false
e2e-tests-logs-dump:
description: Dump logs after running end to end tests
required: false
type: boolean
default: false
e2e-tests-containers-list:
description: List containers before starting end to end tests
required: false
type: boolean
default: true
outputs:
tests_outcome:
value: ${{ jobs.run-e2e-tests.outputs.tests_outcome }}
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
jobs:
# Required job
run-e2e-tests:
env:
BESU_PACKAGE_TAG: ${{ inputs.linea_besu_package_tag }}
EXPECTED_TRACES_API_VERSION: ${{ inputs.expected_traces_api_version }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
outputs:
tests_outcome: ${{ steps.run_e2e_tests.outcome }}
# xl saves ~0 mins
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-large
steps:
- name: Setup upterm session
if: ${{ inputs.e2e-tests-with-ssh }}
uses: lhotari/action-upterm@v1
- name: Checkout
uses: actions/checkout@v4
- name: Setup nodejs environment
uses: ./.github/actions/setup-nodejs
with:
pnpm-install-options: '-F contracts -F e2e --frozen-lockfile --prefer-offline'
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create directory for conflated traces
run: |
mkdir -p tmp/local/traces/v2/conflated
chmod -R a+rw tmp/local/
- name: Download local docker image artifacts
uses: actions/download-artifact@v4
with:
pattern: linea-besu-package*
- name: Load Docker images
run: |
pwd && ls -la && echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" &&
gunzip -c $GITHUB_WORKSPACE/linea-besu-package/linea-besu-package-image.tar.gz | docker load
shell: bash
- name: Replace expected traces api version in coordinator config file
shell: bash
run: |
sed -i 's/^\(expected-traces-api-version-v2=\).*/\1"${{ env.EXPECTED_TRACES_API_VERSION }}"/' config/coordinator/coordinator-docker-traces-v2-override.config.toml
echo "EXPECTED_TRACES_API_VERSION=${{ env.EXPECTED_TRACES_API_VERSION }}"
echo "BESU_PACKAGE_TAG=${{ env.BESU_PACKAGE_TAG }}"
echo "$(grep expected-traces-api-version-v2 config/coordinator/coordinator-docker-traces-v2-override.config.toml)"
- name: Spin up fresh environment with besu tracing with retry
uses: nick-fields/retry@v3
with:
max_attempts: 10
retry_on: error
retry_wait_seconds: 30
timeout_minutes: 10
command: |
make start-env-with-tracing-v2-ci CLEAN_PREVIOUS_ENV=false
on_retry_command: |
make clean-environment
- name: List docker containers/images
if: ${{ always() && inputs.e2e-tests-containers-list }}
continue-on-error: true
run: |
docker ps -la && docker images
docker container ls -a
- name: Run e2e tests
id: run_e2e_tests
timeout-minutes: 4
run: |
pnpm run -F e2e test:e2e:local
- name: Show e2e tests result
if: always()
run: |
echo "E2E_TESTS_RESULT: ${{ steps.run_e2e_tests.outcome }}"
- name: Dump logs
if: ${{ failure() && inputs.e2e-tests-logs-dump }}
run: |
mkdir -p docker_logs
find tmp/local/ >> docker_logs/files_in_shared_dir.txt || true
docker ps -a >> docker_logs/docker_ps.txt || true
docker logs coordinator --since 1h &>> docker_logs/coordinator.txt || true
docker logs prover-v3 --since 1h &>> docker_logs/prover-v3.txt || true
docker logs shomei --since 1h &>> docker_logs/shomei.txt || true
docker logs zkbesu-shomei --since 1h &>> docker_logs/zkbesu-shomei.txt || true
docker logs shomei-frontend --since 1h &>> docker_logs/shomei-frontend.txt || true
docker logs postman --since 1h &>> docker_logs/postman.txt || true
docker logs traces-node-v2 --since 1h &>> docker_logs/traces-node-v2.txt || true
docker logs l2-node-besu --since 1h &>> docker_logs/l2-node-besu.txt || true
docker logs transaction-exclusion-api --since 1h &>> docker_logs/transaction-exclusion-api.txt || true
docker logs sequencer --since 1h &>> docker_logs/sequencer.txt || true
- name: Archive debug logs
uses: actions/upload-artifact@v4
if: ${{ failure() && inputs.e2e-tests-logs-dump }}
with:
name: end-2-end-debug-logs
if-no-files-found: error
path: |
docker_logs/**/*

View File

@@ -0,0 +1,67 @@
name: Reusable linea-besu-package Besu run test
on:
workflow_call:
inputs:
dockerimage:
required: true
type: string
jobs:
list-profiles:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-small
outputs:
profile-files: ${{ steps.list-profiles.outputs.files }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Split and list profiles
id: list-profiles
run: |
files=$(ls linea-besu-package/linea-besu/profiles/* | xargs -n 1 basename | sed 's/\.[^.]*$//')
files_json=$(echo "$files" | tr ' ' '\n' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "files=$files_json" >> "$GITHUB_OUTPUT"
echo "Files: $files_json"
test-profile:
timeout-minutes: 4
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
continue-on-error: true
needs: [ list-profiles ]
strategy:
fail-fast: false
matrix:
file: ${{ fromJSON(needs.list-profiles.outputs.profile-files) }}
env:
CONTAINER_NAME: linea-besu-profile-check-${{ matrix.file }}
DOCKER_IMAGE: ${{ inputs.dockerimage }}
steps:
- name: Check repository
uses: actions/checkout@v4
- name: Download local docker image artifacts
uses: actions/download-artifact@v4
with:
pattern: linea-besu-package*
- name: Load Docker image
run: |
pwd && ls -la && echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" &&
gunzip -c $GITHUB_WORKSPACE/linea-besu-package/linea-besu-package-image.tar.gz | docker load
shell: bash
- name: Start container
run: |
env
COMMAND="docker run -d --name ${{ env.CONTAINER_NAME }} -e BESU_PROFILE=${{ matrix.file }} ${{ env.DOCKER_IMAGE }}"
echo $COMMAND
eval $COMMAND
- name: Verify besu container
run: bash linea-besu-package/docker/scripts/BesuContainerVerify.sh
env:
CONTAINER_NAME: ${{ env.CONTAINER_NAME }}
- name: Stop container
run: docker stop ${{ env.CONTAINER_NAME }}