Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0847f40
feat: add base workflow for node execution
cbermudez97 Sep 26, 2025
130b1c6
feat: add nethermind and nitro services docker compose configs
cbermudez97 Sep 26, 2025
a715fde
fix: update nethermind command for sepolia to use archive version
cbermudez97 Sep 26, 2025
63ca2fd
chore: update jinja2 installation to include jinja2-ansible-filters
cbermudez97 Sep 26, 2025
407d6f3
fix: add jinja2-ansible-filters extension to template rendering
cbermudez97 Sep 26, 2025
95c86ea
refactor: improve setup script generation
cbermudez97 Sep 26, 2025
6d81133
chore: add debug output for custom node data in workflow
cbermudez97 Sep 26, 2025
642d96d
chore: update custom node data keys and improve workflow command
cbermudez97 Sep 26, 2025
d43fdb3
chore: update custom machine type for sepolia in node data generation
cbermudez97 Sep 26, 2025
6a9e100
chore: enhance docker compose and setup script for nethermind and nit…
cbermudez97 Sep 26, 2025
ce7b9de
feat: add pushgateway url to nethermind configuration and clean up co…
cbermudez97 Sep 26, 2025
c1c9011
feat: add instance name for metrics identification in custom node dat…
cbermudez97 Sep 26, 2025
00c9be9
fix: include instance name parameter in nethermind config function
cbermudez97 Sep 26, 2025
47b731f
chore: update workflow reference to main in run-node configuration
cbermudez97 Sep 29, 2025
5f16eab
fix: update nitro configuration paths and volumes in custom node data…
cbermudez97 Sep 29, 2025
5433461
feat: add healthcheck and update depends_on condition in custom node …
cbermudez97 Sep 29, 2025
74a2af7
feat: add seq url and api key to custom node configuration
cbermudez97 Sep 29, 2025
1f56793
fix: update workflow reference to use dynamic workflow ref in run-nod…
cbermudez97 Sep 29, 2025
dffe886
fix: add nitro data directory setup in script
cbermudez97 Sep 29, 2025
17c9693
add flags
AnkushinDaniil Sep 30, 2025
5a1aa29
feat: enhance run-node workflow with mainnet support and dynamic chai…
cbermudez97 Sep 30, 2025
3ce35c7
feat: add mainnet machine type and update nethermind command for mainnet
cbermudez97 Sep 30, 2025
8ad9ad7
disable restart
AnkushinDaniil Oct 1, 2025
61eb246
fix
AnkushinDaniil Oct 1, 2025
3ec4f05
upd
AnkushinDaniil Oct 2, 2025
3c0b2d4
fix
AnkushinDaniil Oct 3, 2025
a5b2591
fix
AnkushinDaniil Oct 3, 2025
1fe4d53
change to external
AnkushinDaniil Oct 13, 2025
d8067f8
upd
AnkushinDaniil Dec 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ max_line_length = 160

file_header_template = SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited\nSPDX-License-Identifier: LGPL-3.0-only

[*.py]
indent_size = 4

[*.cs]
indent_size = 4

Expand Down
146 changes: 145 additions & 1 deletion .github/workflows/run-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,155 @@ name: Run Node in Chain

on:
workflow_dispatch:
inputs:
nethermind-image:
description: Nethermind Arbitrum docker image
required: true
nitro-image:
description: Nitro docker image
required: true
chain:
description: Chain name
required: true
default: sepolia
type: choice
options:
- sepolia
- mainnet
timeout:
description: Timeout in hours for the machine to be auto removed
required: false
type: number
default: 24
ssh-keys:
description: Comma separated SSH keys to add to the machine
required: false
type: string
default: ""
allowed-ips:
description: Comma separated allowed IPs to allow in the machine firewall
required: false
type: string
default: ""
tags:
description: Comma separated tags for the machine
required: false
type: string
default: ""

jobs:
run-node:
runs-on: ubuntu-latest
env:
WORKFLOW_REF: "main"
Comment on lines 40 to +45
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow sets WORKFLOW_REF: "main" but this value is hardcoded. If this workflow needs to run against different branches (for testing or deployment), this should be made configurable through workflow inputs or derived from the context. Consider adding it as an optional input parameter with "main" as the default.

Suggested change
jobs:
run-node:
runs-on: ubuntu-latest
env:
WORKFLOW_REF: "main"
workflow-ref:
description: Git ref (branch or tag) to use for this workflow run
required: false
type: string
default: main
jobs:
run-node:
runs-on: ubuntu-latest
env:
WORKFLOW_REF: ${{ github.event.inputs.workflow-ref || 'main' }}

Copilot uses AI. Check for mistakes.
# Generated by the workflow
BASE_TAG: ""
steps:
# Mock workflow
- name: Checkout repository
uses: actions/checkout@v5

- name: Authenticate App
id: gh-app
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
repositories: "post-merge-smoke-tests"

- name: Set up Python
uses: actions/setup-python@v6
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python version is not specified in the setup-python action. This could lead to inconsistent behavior if the default Python version changes. Consider pinning to a specific Python version (e.g., python-version: '3.11') to ensure consistent execution.

Suggested change
uses: actions/setup-python@v6
uses: actions/setup-python@v6
with:
python-version: '3.11'

Copilot uses AI. Check for mistakes.

- name: Install dependencies
run: |
pip install jinja2 jinja2-ansible-filters

- name: Build base tag
env:
USER_NAME: ${{ github.actor }}
run: |
# Generate BASE_TAG using the first letter of USER_NAME and a random 4-digit number
BASE_TAG="${USER_NAME:0:1}$(shuf -i 1000-9999 -n 1)"
echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV

- name: Prepare chain URLs
id: chain-urls
run: |
# Create JSON object with chain URLs
CHAIN_URLS='{
"sepolia": {
"rpc": "${{ secrets.SEPOLIA_RPC_URL }}",
"beacon": "${{ secrets.SEPOLIA_BEACON_URL }}"
},
"mainnet": {
"rpc": "${{ secrets.MAINNET_RPC_URL }}",
"beacon": "${{ secrets.MAINNET_BEACON_URL }}"
}
}'

# Extract URLs for the selected chain
CHAIN_RPC_URL=$(echo "$CHAIN_URLS" | jq -r ".${{ github.event.inputs.chain }}.rpc")
CHAIN_BEACON_URL=$(echo "$CHAIN_URLS" | jq -r ".${{ github.event.inputs.chain }}.beacon")

echo "CHAIN_RPC_URL=$CHAIN_RPC_URL" >> $GITHUB_OUTPUT
echo "CHAIN_BEACON_URL=$CHAIN_BEACON_URL" >> $GITHUB_OUTPUT

- name: Generate custom node script
env:
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
GH_TOKEN: ${{ steps.gh-app.outputs.token }}
GH_USERNAME: ${{ github.actor }}
BASE_TAG: ${{ env.BASE_TAG }}
TIMEOUT: ${{ github.event.inputs.timeout }}
CHAIN: ${{ github.event.inputs.chain }}
CHAIN_RPC_URL: ${{ steps.chain-urls.outputs.CHAIN_RPC_URL }}
CHAIN_BEACON_URL: ${{ steps.chain-urls.outputs.CHAIN_BEACON_URL }}
NITRO_IMAGE: ${{ github.event.inputs.nitro-image }}
NETHERMIND_IMAGE: ${{ github.event.inputs.nethermind-image }}
SETUP_SCRIPT_TEMPLATE: "scripts/setup_script.sh.j2"
PUSHGATEWAY_URL: ${{ secrets.NETHERMIND_PUSHGATEWAY }}
TAGS: ${{ github.event.inputs.tags }}
ALLOWED_IPS: ${{ github.event.inputs.allowed-ips }}
SSH_KEYS: ${{ github.event.inputs.ssh-keys }}
SEQ_URL: ${{ secrets.SEQ_URL }}
SEQ_API_KEY: ${{ secrets.SEQ_API_KEY }}
run: |
python scripts/generate_custom_node_data.py

- name: Trigger Machine Creation
env:
GH_TOKEN: ${{ steps.gh-app.outputs.token }}
run: |
cat custom_node_data.json | gh workflow run run-custom-node.yml -R NethermindEth/post-merge-smoke-tests --ref='${{ env.WORKFLOW_REF }}' --json

- name: Wait for Workflow completion
env:
GITHUB_TOKEN: ${{ steps.gh-app.outputs.token }}
WORKFLOW_ID: "run-custom-node.yml"
MAX_WAIT_MINUTES: "5"
INTERVAL: "5"
TIMEOUT: "20"
ORG_NAME: "NethermindEth"
REPO_NAME: "post-merge-smoke-tests"
REF: ${{ env.WORKFLOW_REF }}
run: |
bash ./scripts/wait_for_workflow.sh | tee workflow.log
RUN_ID=$(grep -oP 'Run ID: \K\d+' workflow.log)
echo "Run ID extracted is: $RUN_ID"
echo "RUN_ID=$RUN_ID" >> $GITHUB_ENV
Comment on lines +138 to +141
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step extracts the Run ID using grep -oP, which requires GNU grep. This may fail on systems with BSD grep (like macOS). Additionally, if the workflow log format changes, this parsing could break. Consider using the output from the wait_for_workflow.sh script directly (line 81 writes to GITHUB_OUTPUT) instead of parsing the log file.

Copilot uses AI. Check for mistakes.

- name: Download machine details artifact
env:
GH_TOKEN: ${{ steps.gh-app.outputs.token }}
RUN_ID: ${{ env.RUN_ID }}
run: |
ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GH_TOKEN}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${RUN_ID}/artifacts | jq '.artifacts[0].id')
curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GH_TOKEN}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/${ARTIFACT_ID}/zip
unzip artifact.zip -d ./downloaded-artifacts/

- name: Display machine details
run: |
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step assumes there will always be at least one file in the downloaded-artifacts/machine-details directory. If the directory is empty or doesn't exist, the ls | head -n 1 command will fail. Add validation to check if files exist before attempting to read them.

Suggested change
run: |
run: |
if [ ! -d "downloaded-artifacts/machine-details" ] || [ -z "$(ls -A downloaded-artifacts/machine-details 2>/dev/null)" ]; then
echo "Error: No machine details files found in downloaded-artifacts/machine-details." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
FILE=$(ls downloaded-artifacts/machine-details | head -n 1)
echo "# Machine Details" >> $GITHUB_STEP_SUMMARY
cat "downloaded-artifacts/machine-details/${FILE}" >> $GITHUB_STEP_SUMMARY
Loading