Skip to content

Commit

Permalink
Merge branch 'main' into prover/update-hkey-constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBelling authored Oct 25, 2024
2 parents 2986d31 + 4f4be57 commit 7dc3dee
Show file tree
Hide file tree
Showing 632 changed files with 19,248 additions and 9,810 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/epic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Epic/Major Feature
about: File an Epic
assignees: 'dfox-consensys,julien-marchand'
---

## Description
Write a clear and concise description of what you want to happen. Add any considered drawbacks.

## Motivation
This section should indicate what value we are receiving from it.

## Architecture
- [ ] Link to an architecture document

## Implementation guidelines
- [ ] List implementation steps to complete the epic/feature

## Metrics/monitoring
- [ ] What needs to be monitored once this epic has been shipped?

## Rollout
- [ ] Describe rollout plan for this epic

## Infrastructure & Node operators
- [ ] What is the impact and migration steps required for the infrastructure and node operators

## Documentation & communication
- [ ] What needs to be documented for this feature?

24 changes: 0 additions & 24 deletions .github/actions/check-image-tags-exist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,24 @@ inputs:
last_commit_tag:
description: 'The tag of the last commit image'
required: true
common_ancestor_tag:
description: 'The tag of the common ancestor commit image'
required: true
image_name:
description: 'The name of the image to check'
required: true
docker_username:
description: 'The username to login to Docker Hub'
required: true
docker_password:
description: 'The password to login to Docker Hub'
required: true
outputs:
last_commit_tag_exists:
description: 'Whether the last commit image tag exists'
value: ${{ steps.last_commit_image_exists.outputs.last_commit_tag_exists }}
common_ancestor_commit_tag_exists:
description: 'Whether the common ancestor commit image tag exists'
value: ${{ steps.ancestor_commit_image_exists.outputs.common_ancestor_commit_tag_exists }}

runs:
using: 'composite'
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
- name: Check last commit image tag exists
id: last_commit_image_exists
shell: bash
continue-on-error: true
run: |
echo last_commit_tag_exists=$(docker pull ${{ inputs.image_name }}:${{ inputs.last_commit_tag }} > /dev/null ; echo $?) >> $GITHUB_OUTPUT
- name: Check ancestor commit image tag exists
shell: bash
id: ancestor_commit_image_exists
continue-on-error: true
run: |
echo common_ancestor_commit_tag_exists=$(docker pull ${{ inputs.image_name }}:${{ inputs.common_ancestor_tag }} > /dev/null ; echo $?) >> $GITHUB_OUTPUT
- name: Show outputs
shell: bash
run: |
echo "last_commit_tag_exists: ${{ steps.last_commit_image_exists.outputs.last_commit_tag_exists }}"
echo "common_ancestor_commit_tag_exists: ${{ steps.ancestor_commit_image_exists.outputs.common_ancestor_commit_tag_exists }}"
51 changes: 25 additions & 26 deletions .github/actions/image-tag-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,32 @@ inputs:
last_commit_tag:
description: 'The tag of the last commit image'
required: true
common_ancestor_tag:
description: 'The tag of the common ancestor commit image'
required: true
develop_tag:
description: 'The tag of the develop image'
required: true
untested_tag_suffix:
description: 'The suffix to add to untested images'
required: true
image_name:
description: 'The name of the image to tag and push'
required: true
last_commit_tag_exists:
description: 'Whether the last commit image tag exists'
required: true
common_ancestor_commit_tag_exists:
description: 'Whether the common ancestor commit image tag exists'
required: true
docker_username:
description: 'The username to login to Docker Hub'
required: true
required: false
docker_password:
description: 'The password to login to Docker Hub'
required: true
required: false

outputs:
image_tagged:
image_tagged:
description: 'Whether the image was tagged'
value: ${{ steps.set-output.outputs.image_tagged }}

runs:
using: 'composite'
steps:
- name: Login to Docker Hub
if: ${{ github.ref == 'refs/heads/main' && inputs.last_commit_tag_exists == '0' }}
uses: docker/login-action@v2
with:
username: ${{ inputs.docker_username }}
Expand All @@ -50,29 +42,36 @@ runs:
shell: bash
run: |
echo IMAGE_TAGGED=false >> $GITHUB_ENV
- name: Tag Docker image with last commit tag with the commit hash plus w/o "untested" suffix
- name: Tag Docker image with develop if on main branch
shell: bash
if: ${{ inputs.last_commit_tag != '0000000' && inputs.last_commit_tag_exists == '0' }}
if: ${{ github.ref == 'refs/heads/main' && inputs.last_commit_tag_exists == '0' }}
run: |
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.develop_tag }} ${{ inputs.image_name }}:${{ inputs.last_commit_tag }}
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.commit_tag }} ${{ inputs.image_name }}:${{ inputs.last_commit_tag }}
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.commit_tag }}-${{ inputs.untested_tag_suffix }} ${{ inputs.image_name }}:${{ inputs.last_commit_tag }}
echo IMAGE_TAGGED=true >> $GITHUB_ENV
- name: Tag Docker image with common ancestor commit tag with the commit hash plus w/o "untested" suffix
- name: Split docker image name (i.e. extract "xyz" from "consensys/xyz")
if: ${{ github.ref == 'refs/heads/main' && inputs.last_commit_tag_exists == '0' }}
env:
IMAGE_NAME: ${{ inputs.image_name }}
id: split
shell: bash
if: ${{ inputs.last_commit_tag == '0000000' && inputs.common_ancestor_commit_tag_exists == '0' }}
run: |
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.commit_tag }} ${{ inputs.image_name }}:${{ inputs.common_ancestor_tag }}
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.commit_tag }}-${{ inputs.untested_tag_suffix }} ${{ inputs.image_name }}:${{ inputs.common_ancestor_tag }}
echo IMAGE_TAGGED=true >> $GITHUB_ENV
- name: Tag Docker image with develop if on main branch
shell: bash
echo "::set-output name=image_name_suffix::${IMAGE_NAME##*/}"
- name: Save Docker image as artifact for later use in e2e test
if: ${{ github.ref == 'refs/heads/main' && inputs.last_commit_tag_exists == '0' }}
shell: bash
run: |
docker buildx imagetools create --tag ${{ inputs.image_name }}:${{ inputs.develop_tag }} ${{ inputs.image_name }}:${{ inputs.last_commit_tag }}
echo IMAGE_TAGGED=true >> $GITHUB_ENV
docker pull ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}
docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > ${{ steps.split.outputs.image_name_suffix }}-docker-image.tar.gz
- name: Upload Docker image artifact for later use in e2e test
if: ${{ github.ref == 'refs/heads/main' && inputs.last_commit_tag_exists == '0' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.split.outputs.image_name_suffix }}
path: ${{ steps.split.outputs.image_name_suffix }}-docker-image.tar.gz
- name: Set output from environment variable
shell: bash
id: set-output
run: |
echo "image_tagged=$IMAGE_TAGGED" >> $GITHUB_OUTPUT
echo "image_tagged=$IMAGE_TAGGED" >> $GITHUB_OUTPUT
echo "image_name_suffix: ${{ steps.split.outputs.image_name_suffix }}"
18 changes: 6 additions & 12 deletions .github/workflows/all-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ on:

jobs:
changes:
runs-on: [self-hosted, ubuntu-22.04, X64, small]
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Filter commit changes
outputs:
all-tools: ${{ steps.filter.outputs['all-tools'] }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Filter commit changes
uses: dorny/paths-filter@v2
id: filter
Expand All @@ -39,7 +39,7 @@ jobs:
uses: ./.github/workflows/reuse-store-image-name-and-tags.yml

check_image_tags_exist:
runs-on: [self-hosted, ubuntu-22.04, X64, small]
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Check image tags exist
needs: [ changes, store_image_name_and_tags ]
if: ${{ needs.changes.outputs['all-tools'] == 'false' }}
Expand All @@ -50,13 +50,10 @@ jobs:
uses: ./.github/actions/check-image-tags-exist
with:
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
image_name: consensys/linea-alltools
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

all-tools-tag-only:
runs-on: [self-hosted, ubuntu-22.04, X64, small]
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: All tools tag only
needs: [ changes, store_image_name_and_tags, check_image_tags_exist ]
if: ${{ github.event_name != 'pull_request' && needs.changes.outputs['all-tools'] == 'false' }}
Expand All @@ -71,27 +68,24 @@ jobs:
with:
commit_tag: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
last_commit_tag: ${{ needs.store_image_name_and_tags.outputs.last_commit_tag }}
common_ancestor_tag: ${{ needs.store_image_name_and_tags.outputs.common_ancestor_tag }}
develop_tag: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
untested_tag_suffix: ${{ needs.store_image_name_and_tags.outputs.untested_tag_suffix }}
image_name: consensys/linea-alltools
last_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.last_commit_tag_exists }}
common_ancestor_commit_tag_exists: ${{ needs.check_image_tags_exist.outputs.common_ancestor_commit_tag_exists }}
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

build-and-publish:
needs: [ changes, store_image_name_and_tags, all-tools-tag-only ]
if: ${{ always() && (needs.changes.outputs['all-tools'] == 'true' || needs.all-tools-tag-only.result != 'success' || needs.all-tools-tag-only.outputs.image_tagged != 'true') }}
runs-on: [self-hosted, ubuntu-22.04, X64, small]
runs-on: [self-hosted, ubuntu-20.04, X64, small]
env:
COMMIT_TAG: ${{ needs.store_image_name_and_tags.outputs.commit_tag }}
DEVELOP_TAG: ${{ needs.store_image_name_and_tags.outputs.develop_tag }}
IMAGE_NAME: consensys/linea-alltools
name: All tools build and push
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SELF_GITHUB_SSH_KEY }}
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bridge-ui-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
run-e2e-tests:
runs-on: [self-hosted, ubuntu-22.04, X64, small]
runs-on: [self-hosted, ubuntu-20.04, X64, small]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/bridge-ui-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ on:

jobs:
publish:
runs-on: [self-hosted, ubuntu-22.04, X64, small]
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)
runs-on: [self-hosted, ubuntu-20.04, X64, small]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get version from package.json
id: package-version
Expand Down
49 changes: 26 additions & 23 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ on:
commit_tag:
required: true
type: string
last_commit_tag:
required: true
type: string
common_ancestor_tag:
required: true
type: string
develop_tag:
required: true
type: string
untested_tag_suffix:
required: true
type: string
push_image:
required: false
type: boolean
default: false
coordinator_changed:
required: true
type: string
Expand All @@ -30,6 +25,9 @@ on:
traces_api_facade_changed:
required: true
type: string
transaction_exclusion_api_changed:
required: true
type: string
coordinator_image_tagged:
required: true
type: string
Expand All @@ -42,57 +40,62 @@ on:
traces_api_facade_image_tagged:
required: true
type: string
transaction_exclusion_api_image_tagged:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
required: false
DOCKERHUB_TOKEN:
required: true
required: false

jobs:
coordinator:
uses: ./.github/workflows/coordinator-build-and-publish.yml
if: ${{ always() && (inputs.coordinator_changed == 'true' || inputs.coordinator_image_tagged != 'true') }}
with:
commit_tag: ${{ inputs.commit_tag }}
last_commit_tag: ${{ inputs.last_commit_tag }}
common_ancestor_tag: ${{ inputs.common_ancestor_tag }}
develop_tag: ${{ inputs.develop_tag }}
untested_tag_suffix: ${{ inputs.untested_tag_suffix }}
image_name: consensys/linea-coordinator
push_image: ${{ inputs.push_image }}
secrets: inherit

prover:
uses: ./.github/workflows/prover-build-and-publish.yml
if: ${{ always() && (inputs.prover_changed == 'true' || inputs.prover_image_tagged != 'true') }}
with:
commit_tag: ${{ inputs.commit_tag }}
last_commit_tag: ${{ inputs.last_commit_tag }}
common_ancestor_tag: ${{ inputs.common_ancestor_tag }}
develop_tag: ${{ inputs.develop_tag }}
untested_tag_suffix: ${{ inputs.untested_tag_suffix }}
image_name: consensys/linea-prover
push_image: ${{ inputs.push_image }}
secrets: inherit

postman:
uses: ./.github/workflows/postman-build-and-publish.yml
if: ${{ always() && (inputs.postman_changed == 'true' || inputs.postman_image_tagged != 'true') }}
with:
commit_tag: ${{ inputs.commit_tag }}
last_commit_tag: ${{ inputs.last_commit_tag }}
common_ancestor_tag: ${{ inputs.common_ancestor_tag }}
develop_tag: ${{ inputs.develop_tag }}
untested_tag_suffix: ${{ inputs.untested_tag_suffix }}
image_name: consensys/linea-postman
push_image: ${{ inputs.push_image }}
secrets: inherit

traces-api-facade:
uses: ./.github/workflows/traces-api-facade-build-and-publish.yml
if: ${{ always() && (inputs.traces_api_facade_changed == 'true' || inputs.traces_api_facade_image_tagged != 'true') }}
with:
commit_tag: ${{ inputs.commit_tag }}
last_commit_tag: ${{ inputs.last_commit_tag }}
common_ancestor_tag: ${{ inputs.common_ancestor_tag }}
develop_tag: ${{ inputs.develop_tag }}
untested_tag_suffix: ${{ inputs.untested_tag_suffix }}
image_name: consensys/linea-traces-api-facade
push_image: ${{ inputs.push_image }}
secrets: inherit

transaction_exclusion_api:
uses: ./.github/workflows/transaction-exclusion-api-build-and-publish.yml
if: ${{ always() && (inputs.transaction_exclusion_api_changed == 'true' || inputs.transaction_exclusion_api_image_tagged != 'true') }}
with:
commit_tag: ${{ inputs.commit_tag }}
develop_tag: ${{ inputs.develop_tag }}
image_name: consensys/linea-transaction-exclusion-api
push_image: ${{ inputs.push_image }}
secrets: inherit
Loading

0 comments on commit 7dc3dee

Please sign in to comment.