-
Notifications
You must be signed in to change notification settings - Fork 241
[WIP] HA failover #2814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
[WIP] HA failover #2814
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
658a62e
Start sequencer failoverx
alpe f1498ce
Disable p2p peers when raft enabled
alpe 2877d24
Implementation
alpe cd92bef
Better test support
alpe 4a3f4f7
Fix failing tests
alpe d9cef3f
Review feedback
alpe d771e5e
Rebased
alpe c1fd0f7
x
alpe d1de3b3
x
alpe 2032af2
Better shutdown
alpe a9f8257
Minor cleanup
alpe 071ede0
docs: add version notice warning about pre-v1 releases (#2824)
tac0turtle 175bd61
chore: docker workflow refactor (#2820)
auricom 17f772a
add note on full node for evm (#2825)
tac0turtle 63d2507
refactor: replace interface{} with any for clarity and modernization …
promalert bbe9a07
build(deps): Bump actions/github-script from 7 to 8 (#2827)
dependabot[bot] 15006b4
build(deps): Bump golangci/golangci-lint-action from 8.0.0 to 9.0.0 (…
dependabot[bot] c3f485c
Merge branch 'main' into alex/adr023_ha-failover_raft5
alpe 780dd6a
Merge branch 'main' into alex/adr023_ha-failover_raft5
alpe c7952fe
Start rpc server before p2p sync
alpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| name: CI | ||
| "on": | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| merge_group: | ||
|
|
||
| permissions: {} | ||
| jobs: | ||
| determine-image-tag: | ||
| name: Determine Image Tag | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| tag: ${{ steps.set-tag.outputs.tag }} | ||
| steps: | ||
| - name: Set image tag | ||
| id: set-tag | ||
| run: | | ||
| if [ -n "${{ github.event.pull_request.number }}" ]; then | ||
| TAG="pr-${{ github.event.pull_request.number }}" | ||
| echo "::notice::Using PR-based tag: $TAG" | ||
| else | ||
| # Sanitize ref_name by replacing / with - | ||
| TAG="${{ github.ref_name }}" | ||
| TAG="${TAG//\//-}" | ||
| echo "::notice::Using branch/tag-based tag: $TAG" | ||
| fi | ||
|
|
||
| # Validate tag format | ||
| if [[ ! "$TAG" =~ ^[a-zA-Z0-9._-]+$ ]]; then | ||
| echo "::error::Invalid image tag format: $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| lint: | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/lint.yml | ||
|
|
||
| docker: | ||
| needs: determine-image-tag | ||
| uses: ./.github/workflows/docker-build-push.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
| apps: | | ||
| [ | ||
| {"name": "ev-node-evm-single", "dockerfile": "apps/evm/single/Dockerfile"}, | ||
| {"name": "ev-node-testapp", "dockerfile": "apps/testapp/Dockerfile"} | ||
| ] | ||
|
|
||
| test: | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: inherit | ||
|
|
||
| docker-tests: | ||
| needs: [determine-image-tag, docker] | ||
| uses: ./.github/workflows/docker-tests.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
|
|
||
| proto: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| uses: ./.github/workflows/proto.yml |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| # This workflow builds and pushes Docker images to GHCR | ||
| name: Build Docker Images | ||
| permissions: {} | ||
| "on": | ||
| workflow_call: | ||
| inputs: | ||
| image-tag: | ||
| required: true | ||
| type: string | ||
| description: 'Docker image tag (e.g., v1.2.3, pr-123, sha-abc123)' | ||
| apps: | ||
| required: true | ||
| type: string | ||
| description: 'JSON array of apps to build (e.g., [{"name": "testapp", "dockerfile": "apps/testapp/Dockerfile"}])' | ||
|
|
||
| jobs: | ||
| build-images: | ||
| name: Build ${{ matrix.app.name }} | ||
| # skip building images for merge groups as they are already built on PRs and main | ||
| if: github.event_name != 'merge_group' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| strategy: | ||
| matrix: | ||
| app: ${{ fromJson(inputs.apps) }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push ${{ matrix.app.name }} Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ${{ matrix.app.dockerfile }} | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.app.name }}:${{ inputs.image-tag }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| # This workflow runs tests that require Docker images to be built first | ||
| name: Docker E2E Tests | ||
| permissions: {} | ||
| "on": | ||
| workflow_call: | ||
| inputs: | ||
| image-tag: | ||
| required: true | ||
| type: string | ||
| workflow_dispatch: | ||
| inputs: | ||
| image-tag: | ||
| description: 'Docker image tag to use for tests (e.g., v1.2.3, pr-123, sha-abc123)' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| docker-tests: | ||
| permissions: | ||
| contents: read | ||
| name: Docker E2E Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: set up go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: ./test/docker-e2e/go.mod | ||
| - name: Run Docker E2E Tests | ||
| run: make test-docker-e2e | ||
| env: | ||
| EV_NODE_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/ev-node-testapp | ||
| EV_NODE_IMAGE_TAG: ${{ inputs.image-tag }} | ||
|
|
||
| docker-upgrade-tests: | ||
| name: Docker Upgrade E2E Tests | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: set up go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: ./test/docker-e2e/go.mod | ||
| - name: Run Docker Upgrade E2E Tests | ||
| run: make test-docker-upgrade-e2e | ||
| env: | ||
| EVM_SINGLE_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/ev-node-evm-single | ||
| EVM_SINGLE_NODE_IMAGE_TAG: ${{ inputs.image-tag }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| --- | ||
| # lint runs all linters in this repository | ||
| # This workflow is triggered by ci_release.yml workflow | ||
| # This workflow is triggered by ci.yml workflow | ||
| name: lint | ||
| on: | ||
| permissions: | ||
| contents: read | ||
| "on": | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
|
|
@@ -13,8 +16,8 @@ | |
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: ./go.mod | ||
| # This steps sets the GIT_DIFF environment variable to true | ||
| # if files defined in PATTERS changed | ||
| # This steps sets the GIT_DIFF environment variable to true | ||
| # if files defined in PATTERS changed | ||
| - uses: technote-space/[email protected] | ||
| with: | ||
| # This job will pass without running if go.mod, go.sum, and *.go | ||
|
|
@@ -23,39 +26,64 @@ | |
| **/**.go | ||
| go.mod | ||
| go.sum | ||
| - uses: golangci/golangci-lint-action@v8.0.0 | ||
| - uses: golangci/golangci-lint-action@v9.0.0 | ||
| with: | ||
| version: latest | ||
| args: --timeout 10m | ||
| github-token: ${{ secrets.github_token }} | ||
| if: env.GIT_DIFF | ||
|
|
||
| # hadolint lints the Dockerfile | ||
| hadolint: | ||
| uses: evstack/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length | ||
| with: | ||
| dockerfile: Dockerfile | ||
| failure-threshold: error | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: hadolint/[email protected] | ||
| with: | ||
| recursive: true | ||
| failure-threshold: error | ||
|
|
||
| yamllint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: technote-space/[email protected] | ||
|
||
| with: | ||
| PATTERNS: | | ||
| **/*.yml | ||
| **/*.yaml | ||
| - uses: evstack/.github/.github/actions/[email protected] | ||
| if: env.GIT_DIFF | ||
|
|
||
| markdown-lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: technote-space/[email protected] | ||
| with: | ||
| PATTERNS: | | ||
| **/*.md | ||
| - uses: evstack/.github/.github/actions/[email protected] | ||
| if: env.GIT_DIFF | ||
|
|
||
| # Checks that the .goreleaser.yaml file is valid | ||
| goreleaser-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: technote-space/[email protected] | ||
| with: | ||
| PATTERNS: | | ||
| .goreleaser.yaml | ||
| .goreleaser.yml | ||
| - uses: goreleaser/goreleaser-action@v6 | ||
| with: | ||
| version: latest | ||
| args: check | ||
| if: env.GIT_DIFF | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.