Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
966eb57
ci(avalanchego-build)
Elvis339 Sep 25, 2025
ec8fe0e
ci: temp. run custom action on github runners
Elvis339 Sep 25, 2025
36f8420
ci: temp. run custom action on github runners with ubuntu-latest tag
Elvis339 Sep 25, 2025
8a517e5
ci(gh_runners): temp. checkout
Elvis339 Sep 25, 2025
04a9aa8
ci: remove checkout
Elvis339 Sep 25, 2025
1477677
ci: add checkout back
Elvis339 Sep 25, 2025
58784da
ci: remove defaults from coreth and libevm
Elvis339 Sep 25, 2025
bec87c7
debug
Elvis339 Sep 25, 2025
ebeafdc
ci: use $GITHUB_ACTION_PATH
Elvis339 Sep 25, 2025
17af2a7
ci: github runners
Elvis339 Sep 25, 2025
76b7009
ci: github runners use nix and use realpath
Elvis339 Sep 25, 2025
7aafbae
ci: github runners run help from bin
Elvis339 Sep 25, 2025
35e7eb6
ci: self-hosted runners
Elvis339 Sep 25, 2025
2ea5241
ci: self-hosted runners install build-essential
Elvis339 Sep 25, 2025
0e863be
ci: self-hosted runners run & build reexecution bench
Elvis339 Sep 25, 2025
b63ffe4
ci: self-hosted runners run & build reexecution bench
Elvis339 Sep 25, 2025
18e728c
ci(reexec): temp. disable go setup
Elvis339 Sep 25, 2025
3dfbc38
re-run re-exec
Elvis339 Sep 25, 2025
dfa8c81
ci: set permissions
Elvis339 Sep 25, 2025
06708b0
ci(avalanchego-build-action): use composable Firewood action
Elvis339 Sep 26, 2025
fb8a6cf
ci: reexecution bench with firewood custom action
Elvis339 Sep 26, 2025
da4c389
ci: add back ci jobs & remove tmp. jobs
Elvis339 Sep 26, 2025
6a09874
Merge branch 'master' into composable-ci-action
Elvis339 Sep 26, 2025
2c84ad9
ci: uncomment c-chain-reexecution-benchmark-* pull_request directive
Elvis339 Sep 26, 2025
f1a55c7
chore: address copilot PR review
Elvis339 Sep 26, 2025
4702f81
ci(c-chain-reexecution-benchmark)
Elvis339 Sep 26, 2025
7ac895c
ci(avalanchego-build-action): use `go get` instead of checking libevm…
Elvis339 Sep 26, 2025
26443d9
feat(build): extend build with Firewood
Elvis339 Sep 29, 2025
833f844
ci(avalanche-go-setup):
Elvis339 Sep 29, 2025
4257069
ci: test composition
Elvis339 Sep 29, 2025
24805ed
ci: test composition - switch AWS role
Elvis339 Sep 29, 2025
7503a0c
ci: test composition - switch AWS role
Elvis339 Sep 29, 2025
9f82ca8
ci: test composition - set permissions
Elvis339 Sep 29, 2025
db1bbc5
ci: test composition - set permissions
Elvis339 Sep 29, 2025
4df4b98
ci: test composition, set `config: firewood` to reexec bench
Elvis339 Sep 29, 2025
1674dfa
ci: set current state dir src to firewood 100
Elvis339 Sep 29, 2025
6de7ef2
ci: revert to default
Elvis339 Sep 29, 2025
6b212a9
Merge branch 'master' into composable-ci-action
Elvis339 Sep 29, 2025
07ada03
ci(avalanchego-setup-action): add `firewood-path` checkout path allow…
Elvis339 Oct 1, 2025
79f3d9b
Merge remote-tracking branch 'origin/composable-ci-action' into compo…
Elvis339 Oct 1, 2025
106ee40
ci(avalanchego-setup-action): handle checkout-path
Elvis339 Oct 1, 2025
57329f2
ci(avalanchego-setup-action): handle checkout-path
Elvis339 Oct 1, 2025
daff6b5
ci(avalanchego-setup-action): correct Firewood setup path
Elvis339 Oct 1, 2025
9f9d92d
Merge branch 'master' of github.com:ava-labs/avalanchego into composa…
Elvis339 Oct 23, 2025
5964641
chore: externalize c-chain-reexecution json based workflow into tasks
Elvis339 Oct 30, 2025
70fbc9f
ci(c-chain-reexecution): remove relative imports to make this action …
Elvis339 Oct 30, 2025
d5bc227
ci(c-chain-reexecution): use correct shells
Elvis339 Oct 30, 2025
ff86c39
ci(c-chain-reexecution)!:
Elvis339 Oct 30, 2025
b88c5ea
copilot PR comments
Elvis339 Oct 30, 2025
c753cf9
ci(c-chain-reexecution): set absolute path to benchmark output file r…
Elvis339 Oct 30, 2025
7b3a231
address pr review
Elvis339 Nov 3, 2025
c0281ed
address PR
Elvis339 Nov 3, 2025
10c5ef7
ci(c-chain-reexecution-benchmark): revert change on `Push Post-State …
Elvis339 Nov 3, 2025
7d7956c
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 3, 2025
a42e26b
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 4, 2025
785278f
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 5, 2025
c5b650a
chore(benchamrk_cchain_range): avoid duplicating the default of `RUNN…
Elvis339 Nov 5, 2025
20c4ad0
ci(c-chain-reexecution):
Elvis339 Nov 5, 2025
f9b3ce0
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 5, 2025
519e92a
chore: rm doc
Elvis339 Nov 5, 2025
f3d56fb
Merge remote-tracking branch 'origin/es/task-reexecution' into es/tas…
Elvis339 Nov 5, 2025
69c38b5
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 6, 2025
a800ff1
ci(c-chain-reexecution): support alternative approach to task based o…
Elvis339 Nov 6, 2025
f7f0ccf
ci(c-chain-reexecution): support both container and native altenrativ…
Elvis339 Nov 6, 2025
ef5cae7
Merge remote-tracking branch 'origin/es/task-reexecution' into es/tas…
Elvis339 Nov 6, 2025
7921a03
lint
Elvis339 Nov 6, 2025
e703fe0
refactor(scripts): extract S3 bucket config from copy_dir.sh to Taskf…
Elvis339 Nov 6, 2025
d359c7a
fix
Elvis339 Nov 6, 2025
30e7b0c
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 7, 2025
0cb04dc
ci(c-chain-reexecution): use dynamic env variable for benchmark outpu…
Elvis339 Nov 12, 2025
8082a9e
Merge remote-tracking branch 'origin/es/task-reexecution' into es/tas…
Elvis339 Nov 12, 2025
3b2a82f
ci(c-chain-reexecution): remove unused `TASK_NAME` environment variable
Elvis339 Nov 12, 2025
3483737
ci(c-chain-reexecution): enforce required `runner` parameter by remov…
Elvis339 Nov 12, 2025
c14c088
Merge branch 'master' into es/task-reexecution
Elvis339 Nov 12, 2025
c932542
Merge branch 'master' into composable-ci-action
Elvis339 Nov 12, 2025
723d07f
Merge branch 'es/task-reexecution' into composable-ci-action
Elvis339 Nov 12, 2025
bb3d233
chore: setup firewood
Elvis339 Nov 13, 2025
1c8434f
chore(setup-firewood): use correct branch for cloning
Elvis339 Nov 13, 2025
a1485bb
ci: disable ci jobs
Elvis339 Nov 13, 2025
c32a622
run on pull request
Elvis339 Nov 13, 2025
8fd517e
t
Elvis339 Nov 13, 2025
e51f0fd
stash changes
Elvis339 Nov 13, 2025
b689bd3
fix
Elvis339 Nov 13, 2025
2a69c0e
ci: support only self-hosted
Elvis339 Nov 20, 2025
665eaf8
ci: setup go
Elvis339 Nov 20, 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
44 changes: 44 additions & 0 deletions .github/actions/avalanchego-setup-action/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# AvalancheGo Setup Action

## Overview
This action provides composable CI capabilities for setting up AvalancheGo with custom dependency versions.

### Why this exists?
Solves CI composability problems by enabling repositories to setup and build AvalancheGo with specific dependency versions without complex setup or cross-repository coordination.

### Why is it needed?
Dependencies need AvalancheGo as their integration context for realistic testing.
Without this action, setting up AvalancheGo with custom dependency versions requires build knowledge and manual `go mod` manipulation.
Teams either skip proper testing or dump tests in AvalancheGo (wrong ownership).
This action makes AvalancheGo composable - any repository can pull it in as integration context with one line.

## Security Model
- Repository Restriction: Only allows dependencies from `github.com/ava-labs/*` repositories
- No Custom Forks: Prevents supply chain attacks from malicious forks
- Commit Validation: Validates dependency versions reference ava-labs repositories only

## Inputs

| Input | Description | Required | Default |
|-------|-------------|----------|-----------------------|
| `checkout-path` | Directory path where AvalancheGo will be checked out | No | `'.'` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this suggested?

| `avalanchego` | AvalancheGo version (commit SHA, branch, tag) | No | `'${{ github.sha }}'` |
| `firewood` | Firewood version. Consumer should run Firewood shared workflow first | No | `''` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Where's the firewood dir?

| `coreth` | Coreth version (commit SHA, branch, tag) | No | `''` |
| `libevm` | LibEVM version (commit SHA, branch, tag) | No | `''` |

## Usage Examples

```yaml
- name: Setup AvalancheGo with Firewood # This will setup go.mod
uses: ./.github/actions/avalanchego-setup-action
with:
checkout-path: "build/avalanchego"
coreth: "my-feature-branch"
libevm: "experimental-branch"
firewood: "ffi/v0.0.12"
- name: Load test # This will compile and run the load test
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-load -- --load-timeout=30m --firewood
```
69 changes: 69 additions & 0 deletions .github/actions/avalanchego-setup-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: 'Setup AvalancheGo'
description: 'Setup AvalancheGo with custom dependencies (Firewood, Coreth, LibEVM)'

inputs:
avalanchego:
description: 'AvalancheGo version (commit SHA, branch name, or tag)'
required: false
default: ${{ github.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This reference only makes sense if the custom action will only be used in the avalanchego repo.

checkout-path:
description: 'Path where AvalancheGo will be checked out'
required: false
default: '.'
firewood:
description: 'Firewood version (commit SHA, branch, tag, or ffi/vX.Y.Z for pre-built)'
required: false
default: ''
firewood-path:
Copy link
Contributor

Choose a reason for hiding this comment

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

Under what circumstances will this actually be used?

description: 'Directory path where Firewood will be cloned/built (preferably NVMe storage)'
required: false
default: ''
coreth:
description: 'Coreth version (commit SHA, branch name, or tag)'
required: false
default: ''
libevm:
description: 'LibEVM version (commit SHA, branch name, or tag)'
required: false
default: ''

runs:
using: 'composite'
steps:
- name: Checkout AvalancheGo
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the only non-task step that I would expect to see in an action with the remain steps being part of a task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a fair point. I can see the appeal of consolidating all go.mod updates in one place.

I'm thinking of keeping coreth/libevm updates explicit in the action makes the dependency changes visible and optional. They're simple go get commands, so putting them in setup_firewood.sh would add context/coupling without clear benefit - the script would need to handle optional arguments for dependencies it doesn't own.

That said, I'm not strongly opposed to consolidating them. Do you see a clear advantage to moving them into the script? Or is this more about having a consistent pattern for where dependency management happens?

Happy to restructure if there's a compelling reason I'm missing.

Copy link
Contributor

Choose a reason for hiding this comment

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

The pattern for the majority of our CI jobs is that they are trivial to reproduce locally. That means, apart from CI-specific setup like cloning, caching and installing non-nix deps, the meat of a given job is encapsulated in a task that can be invoked locally. CI jobs are then just the glue between Github Actions and our tasks. This ensures both reproducibility and simplifies development and maintenance of our jobs.

uses: actions/checkout@v4
with:
repository: 'ava-labs/avalanchego'
ref: ${{ inputs.avalanchego }}
path: ${{ inputs.checkout-path }}
- name: Update Coreth dependency
if: inputs.coreth != ''
shell: bash
working-directory: ${{ inputs.checkout-path }}
run: |
echo "Updating Coreth to version: ${{ inputs.coreth }}"
go get github.com/ava-labs/coreth@${{ inputs.coreth }}
Copy link
Contributor

Choose a reason for hiding this comment

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

What guarantees are there that a given version of coreth is going to be compatible with given versions of avalanchego or firewood?

- name: Update LibEVM dependency
if: inputs.libevm != ''
shell: bash
working-directory: ${{ inputs.checkout-path }}
run: |
echo "Updating LibEVM to version: ${{ inputs.libevm }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

What guarantees are there that a given version of libevm is going to be compatible with given versions of avalanchego and coreth?

go get github.com/ava-labs/libevm@${{ inputs.libevm }}
- name: Setup Firewood FFI
if: inputs.firewood != ''
id: setup-firewood
uses: ava-labs/firewood/.github/actions/build-action@composable-ci-action
with:
version: ${{ inputs.firewood }}
workspace-path: ${{ inputs.firewood-path }}
- name: Configure Go modules with Firewood FFI
if: inputs.firewood != ''
shell: bash
working-directory: ${{ inputs.checkout-path }}
run: |
FFI_PATH="${{ steps.setup-firewood.outputs.ffi-path }}"
echo "Updating go.mod with FFI path: ${FFI_PATH}"
go mod edit -replace github.com/ava-labs/firewood-go-ethhash/ffi="${FFI_PATH}"
go mod tidy
go mod download
183 changes: 140 additions & 43 deletions .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,34 @@ name: 'C-Chain Re-Execution Benchmark'
description: 'Run C-Chain re-execution benchmark'

inputs:
runner_name:
description: 'The name of the runner to use and include in the Golang Benchmark name.'
required: true
task:
description: 'Task name to execute from Taskfile.yml. Leave empty to use custom inputs below.'
default: ''
# Custom inputs (alternative to task-based approach)
config:
description: 'The config to pass to the VM for the benchmark. See BenchmarkReexecuteRange for details.'
default: ''
start-block:
description: 'The start block for the benchmark.'
default: '101'
default: ''
end-block:
description: 'The end block for the benchmark.'
default: '250000'
default: ''
block-dir-src:
description: 'The source block directory. Supports S3 directory/zip and local directories.'
default: 's3://avalanchego-bootstrap-testing/cchain-mainnet-blocks-1m-ldb/**'
default: ''
current-state-dir-src:
description: 'The current state directory. Supports S3 directory/zip and local directories.'
default: 's3://avalanchego-bootstrap-testing/cchain-current-state-hashdb-full-100/**'
default: ''
runner_name:
description: 'The name of the runner to use and include in the Golang Benchmark name.'
required: true
aws-role:
description: 'AWS role to assume for S3 access.'
required: true
aws-region:
description: 'AWS region to use for S3 access.'
required: true
default: 'us-east-2'
aws-role-duration-seconds:
description: 'The duration of the AWS role to assume for S3 access.'
required: true
Expand Down Expand Up @@ -56,54 +60,145 @@ inputs:
push-github-action-benchmark:
description: 'Whether to push the benchmark result to GitHub.'
required: true
default: false
push-post-state:
description: 'S3 destination to copy the current-state directory after completing re-execution. If empty, this will be skipped.'
default: ''
# The following inputs need never be provided by the caller. They
# default to context values that the action's steps are unable to
# access directly.
repository-owner:
default: ${{ github.repository_owner }}
repository-name:
default: ${{ github.event.repository.name }}
workflow:
default: ${{ github.workflow }}
run-id:
default: ${{ github.run_id }}
run-number:
default: ${{ github.run_number }}
run-attempt:
default: ${{ github.run_attempt }}
job:
default: ${{ github.job }}

outputs:
metrics-from-timestamp:
description: 'Start timestamp for metrics monitoring (in seconds)'
value: ${{ steps.export-metrics-timestamps.outputs.from-timestamp }}
metrics-to-timestamp:
description: 'End timestamp for metrics monitoring (in seconds)'
value: ${{ steps.export-metrics-timestamps.outputs.to-timestamp }}

runs:
using: composite
steps:
- name: Set task env
- uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f #v31
with:
github_access_token: ${{ inputs.github-token }}
- run: echo "dependencies installed"
shell: nix develop --command bash {0}
# Cache Go modules (architecture-independent)
- uses: actions/cache@v4
id: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-mod-
# Cache Go build cache (architecture-specific)
- uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-${{ runner.arch }}-go-build-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-go-build-
# Download modules only on cache miss
- run: go mod download
if: steps.go-mod-cache.outputs.cache-hit != 'true'
shell: nix develop --command bash -x {0}
- name: Notify of metrics availability
if: inputs.prometheus-username != ''
shell: bash
run: |
{
echo "EXECUTION_DATA_DIR=${{ inputs.workspace }}/reexecution-data"
echo "BENCHMARK_OUTPUT_FILE=output.txt"
echo "START_BLOCK=${{ inputs.start-block }}"
echo "END_BLOCK=${{ inputs.end-block }}"
echo "BLOCK_DIR_SRC=${{ inputs.block-dir-src }}"
echo "CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }}"
} >> $GITHUB_ENV
metrics_url=$($GITHUB_ACTION_PATH/output-metrics-url.sh)
echo "Grafana: ${metrics_url}"
echo "🔗 [View Grafana Dashboard](${metrics_url})" >> "$GITHUB_STEP_SUMMARY"
env:
GRAFANA_URL: https://grafana-poc.avax-dev.network/d/Gl1I20mnk/c-chain?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.repository_owner }}%2F${{ inputs.repository_name }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Export metrics timestamps
id: export-metrics-timestamps
if: inputs.prometheus-username != ''
shell: bash
run: |
echo "from-timestamp=${METRICS_FROM_TIMESTAMP}" >> "$GITHUB_OUTPUT"
echo "to-timestamp=${METRICS_TO_TIMESTAMP}" >> "$GITHUB_OUTPUT"
- name: Warn that collection of metrics and logs will not be performed
if: inputs.prometheus-username == ''
shell: bash
run: echo "::warning::Monitoring credentials not found. Skipping collector start. Is the PR from a fork branch?"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws-role }}
aws-region: ${{ inputs.aws-region }}
role-duration-seconds: ${{ inputs.aws-role-duration-seconds }}
- name: Run C-Chain Re-Execution
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: |
- name: Validate inputs
shell: bash
run: |
if [[ -z "${{ inputs.task }}" ]]; then
# Granular mode - validate required inputs
missing=()
[[ -z "${{ inputs.block-dir-src }}" ]] && missing+=("block-dir-src")
[[ -z "${{ inputs.current-state-dir-src }}" ]] && missing+=("current-state-dir-src")
[[ -z "${{ inputs.start-block }}" ]] && missing+=("start-block")
[[ -z "${{ inputs.end-block }}" ]] && missing+=("end-block")

if [[ ${#missing[@]} -gt 0 ]]; then
echo "::error::When 'task' is empty, the following inputs are required: ${missing[*]}"
exit 1
fi
fi
- name: Set task env
shell: bash
run: |
TIMESTAMP=$(date '+%Y%m%d-%H%M%S')
echo "EXECUTION_DATA_DIR=/tmp/reexecution-data-${TIMESTAMP}" >> "$GITHUB_ENV"
echo "BENCHMARK_OUTPUT_FILE=${GITHUB_WORKSPACE}/benchmark-output.txt" >> "$GITHUB_ENV"
- name: Run C-Chain Re-execution Benchmark
shell: nix develop --impure --command bash -x {0}
run: |
if [[ -n "${{ inputs.task }}" ]]; then
# Task-based approach
./scripts/run_task.sh ${{ inputs.task }} \
BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}" \
EXECUTION_DATA_DIR="${{ env.EXECUTION_DATA_DIR }}"
else
# Granular approach
./scripts/run_task.sh reexecute-cchain-range-with-copied-data \
CONFIG=${{ inputs.config }} \
EXECUTION_DATA_DIR=${{ env.EXECUTION_DATA_DIR }} \
BLOCK_DIR_SRC=${{ env.BLOCK_DIR_SRC }} \
CURRENT_STATE_DIR_SRC=${{ env.CURRENT_STATE_DIR_SRC }} \
START_BLOCK=${{ env.START_BLOCK }} \
END_BLOCK=${{ env.END_BLOCK }} \
LABELS=${{ env.LABELS }} \
BENCHMARK_OUTPUT_FILE=${{ env.BENCHMARK_OUTPUT_FILE }} \
RUNNER_NAME=${{ inputs.runner_name }} \
METRICS_SERVER_ENABLED=true \
METRICS_COLLECTOR_ENABLED=true
prometheus_url: ${{ inputs.prometheus-url }}
prometheus_push_url: ${{ inputs.prometheus-push-url }}
prometheus_username: ${{ inputs.prometheus-username }}
prometheus_password: ${{ inputs.prometheus-password }}
grafana_dashboard_id: 'Gl1I20mnk/c-chain'
runtime: "" # Set runtime input to empty string to disable log collection

BLOCK_DIR_SRC=${{ inputs.block-dir-src }} \
CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }} \
START_BLOCK=${{ inputs.start-block }} \
END_BLOCK=${{ inputs.end-block }} \
BENCHMARK_OUTPUT_FILE="${{ env.BENCHMARK_OUTPUT_FILE }}"
fi
env:
RUNNER_NAME: ${{ inputs.runner_name }}
METRICS_COLLECTOR_ENABLED: ${{ inputs.prometheus-username != '' }}
PROMETHEUS_URL: ${{ inputs.prometheus-url }}
PROMETHEUS_PUSH_URL: ${{ inputs.prometheus-push-url }}
PROMETHEUS_USERNAME: ${{ inputs.prometheus-username }}
PROMETHEUS_PASSWORD: ${{ inputs.prometheus-password }}
GH_REPO: ${{ inputs.repository_owner }}/${{ inputs.repository_name }}
GH_WORKFLOW: ${{ inputs.workflow }}
GH_RUN_ID: ${{ inputs.run_id }}
GH_RUN_NUMBER: ${{ inputs.run_number }}
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Stash local changes before benchmark comparison
shell: bash
run: |
git stash --include-untracked || true
- name: Compare Benchmark Results
uses: benchmark-action/github-action-benchmark@v1
with:
Expand All @@ -112,8 +207,10 @@ runs:
summary-always: true
github-token: ${{ inputs.github-token }}
auto-push: ${{ inputs.push-github-action-benchmark }}

- name: Push Post-State to S3 (if not exists)
if: ${{ inputs.push-post-state != '' }}
shell: nix develop --command bash -x {0}
run: ./scripts/run_task.sh export-dir-to-s3 SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ DST=${{ inputs.push-post-state }}
- name: Push Post-State to S3
if: inputs.push-post-state != ''
shell: nix develop --impure --command bash -x {0}
run: |
./scripts/run_task.sh export-dir-to-s3 \
SRC=${{ env.EXECUTION_DATA_DIR }}/current-state/ \
DST=${{ inputs.push-post-state }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

# WARNING: This file is a duplication of:
# - .github/actions/run-monitored-tmpnet-cmd/output-metrics-url.sh (source of truth)
# Changes must be made to BOTH files.

set -euo pipefail

# Timestamps are in seconds
from_timestamp="$(date '+%s')"
monitoring_period=900 # 15 minutes
to_timestamp="$((from_timestamp + monitoring_period))"

# Export timestamps to GitHub environment
if [ -n "${GITHUB_ENV:-}" ]; then
echo "METRICS_FROM_TIMESTAMP=${from_timestamp}" >> "$GITHUB_ENV"
echo "METRICS_TO_TIMESTAMP=${to_timestamp}" >> "$GITHUB_ENV"
fi

# Grafana expects microseconds, so pad timestamps with 3 zeros
metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000"

# Optionally ensure that the link displays metrics only for the shared
# network rather than mixing it with the results for private networks.
if [[ -n "${FILTER_BY_OWNER:-}" ]]; then
metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}"
fi

echo "${metrics_url}"
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash

# WARNING: This file is duplicated at:
# - .github/actions/c-chain-reexecution-benchmark/output-metrics-url.sh (copy)
# Changes must be made to BOTH files.

set -euo pipefail

# Timestamps are in seconds
Expand Down
Loading
Loading