Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .github/actions/c-chain-reexecution-benchmark/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ runs:
echo "END_BLOCK=${{ inputs.end-block }}"
echo "BLOCK_DIR_SRC=${{ inputs.block-dir-src }}"
echo "CURRENT_STATE_DIR_SRC=${{ inputs.current-state-dir-src }}"
echo "NETWORK_UUID=$(uuidgen || cat /proc/sys/kernel/random/uuid)"
} >> $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -84,6 +85,7 @@ runs:
- name: Run C-Chain Re-Execution
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run_env: NETWORK_UUID=${{ env.NETWORK_UUID }}
run: |
./scripts/run_task.sh reexecute-cchain-range-with-copied-data \
CONFIG=${{ inputs.config }} \
Expand All @@ -96,12 +98,14 @@ runs:
BENCHMARK_OUTPUT_FILE=${{ env.BENCHMARK_OUTPUT_FILE }} \
RUNNER_NAME=${{ inputs.runner_name }} \
METRICS_SERVER_ENABLED=true \
METRICS_COLLECTOR_ENABLED=true
METRICS_COLLECTOR_ENABLED=true \
NETWORK_UUID=${{ env.NETWORK_UUID }}
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'
network_uuid: ${{ env.NETWORK_UUID }}
runtime: "" # Set runtime input to empty string to disable log collection

- name: Compare Benchmark Results
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ inputs:
grafana_dashboard_id:
description: 'The identifier of the Grafana dashboard to use, in the format <UID>/<dashboard-name>.'
default: 'kBQpRdWnk/avalanche-main-dashboard'
network_uuid:
description: 'The network UUID to filter metrics by. If not provided, no network_uuid filter is applied.'
default: ''

runs:
using: composite
Expand Down Expand Up @@ -100,6 +103,7 @@ runs:
GRAFANA_URL: https://grafana-poc.avax-dev.network/d/${{ inputs.grafana_dashboard_id }}?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 }}
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
NETWORK_UUID: ${{ inputs.network_uuid }}
- name: Warn that collection of metrics and logs will not be performed
if: (inputs.prometheus_username == '')
shell: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ if [[ -n "${FILTER_BY_OWNER:-}" ]]; then
metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}"
fi

# Optionally filter by network_uuid to differentiate matrix jobs
if [[ -n "${NETWORK_UUID:-}" ]]; then
metrics_url="${metrics_url}&var-filter=network_uuid%7C%3D%7C${NETWORK_UUID}"
fi

echo "${metrics_url}"
18 changes: 15 additions & 3 deletions tests/reexecute/c/vm_reexecute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ var (
metricsServerPortArg uint64
metricsCollectorEnabledArg bool

networkUUID string = uuid.NewString()
labels = map[string]string{
networkUUID string
labels = map[string]string{
"job": "c-chain-reexecution",
"is_ephemeral_node": "false",
"chain": "C",
"network_uuid": networkUUID,
}

configKey = "config"
Expand Down Expand Up @@ -144,9 +143,22 @@ func TestMain(m *testing.M) {
// Set the runner name label on the metrics.
labels["runner"] = runnerNameArg

// Get or create the network UUID
networkUUID = getOrCreateNetworkUUID()
labels["network_uuid"] = networkUUID

m.Run()
}

// getOrCreateNetworkUUID returns the network UUID from the NETWORK_UUID environment
// variable if set, otherwise it generates a new UUID.
func getOrCreateNetworkUUID() string {
if envUUID := os.Getenv("NETWORK_UUID"); envUUID != "" {
return envUUID
}
return uuid.NewString()
}

func BenchmarkReexecuteRange(b *testing.B) {
require.Equalf(b, 1, b.N, "BenchmarkReexecuteRange expects to run a single iteration because it overwrites the input current-state, but found (b.N=%d)", b.N)
b.Run(fmt.Sprintf("[%d,%d]-Config-%s-Runner-%s", startBlockArg, endBlockArg, configNameArg, runnerNameArg), func(b *testing.B) {
Expand Down