Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
3392f09
pull initial work from branch load-testing
cjonas9 May 9, 2026
ffe27bc
add ledger generation test adapted for RPC
cjonas9 May 4, 2026
65da3b5
add apply load config
cjonas9 May 4, 2026
34f086d
add generated ledger output to infrastructure/testdata/
cjonas9 May 4, 2026
80c982d
add basic ingestion of synthetic ledgers phase
cjonas9 May 7, 2026
94c69b7
disable debug logs for load test for timeout reasons
cjonas9 May 7, 2026
f4a16f9
add functions for snapshotting + restoring test DB
cjonas9 May 8, 2026
1d53b96
improve ad restructure db restoration helpers/API
cjonas9 May 8, 2026
baf2255
finish DB restoration logic flow and wiring
cjonas9 May 8, 2026
1647464
skip migrations/fee-stats in load test mode
cjonas9 May 8, 2026
2f14765
ingest test: refactor, minor semantic fixes
cjonas9 May 8, 2026
d7c90a9
test.go: add retention window to config, fix fake history archive for…
cjonas9 May 8, 2026
0390757
minor db restore/trim helper fixes
cjonas9 May 8, 2026
e0a86e7
rename restore backed-up ledgers function for accuracy
cjonas9 May 8, 2026
f151a35
refactor, add env vars, change DB helpers to take sequences
cjonas9 May 12, 2026
bffb101
remove db restoration functionality
cjonas9 May 15, 2026
e04d51d
add performance metrics json emission functionality
cjonas9 May 15, 2026
bd8c784
migrate to polling getHealth, change ingest test limits to 1000 ledgers
cjonas9 May 15, 2026
c7bc001
remove ledger fixtures
cjonas9 May 15, 2026
786423d
add workflow and script
cjonas9 May 15, 2026
1606829
fix yaml referencing wrong path for script
cjonas9 May 15, 2026
7d41b1a
fix yml parsing indentation bug
cjonas9 May 15, 2026
b701108
use head-object for metadata rather than tags
cjonas9 May 15, 2026
b1cec1d
refine workflow + instance script
cjonas9 May 15, 2026
b9ef27e
add apply load cfg
cjonas9 May 15, 2026
73df1e7
testing: on-push runs
cjonas9 May 15, 2026
241bdf8
minor yml syntax fixes
cjonas9 May 15, 2026
1161e3f
set test e2e.yml + add debugging info from instance to ssm
cjonas9 May 15, 2026
47437f4
skip e2e.yml for testing, add retry loop for root volume lookup
cjonas9 May 15, 2026
008f327
build-libs over build-stellar-rpc to cut time back
cjonas9 May 15, 2026
9441749
further slim build phase with no-install-recommends
cjonas9 May 15, 2026
36c0a82
make instance script best-effort if head-object or stellar-core versi…
cjonas9 May 16, 2026
4535977
temporarily modify script to work on scratch dev box; increase timeout
cjonas9 May 16, 2026
54f0b41
fix cfg path error and run ID regression
cjonas9 May 16, 2026
44e093c
improve error logging
cjonas9 May 16, 2026
1ce515e
fix error logging wrapper
cjonas9 May 16, 2026
22a8e6e
patch premature exit due to err trap bug
cjonas9 May 16, 2026
e925d3c
fix empty GOPATH/GOMODCACHE
cjonas9 May 16, 2026
ffb3299
updated apply-load config for specific core on runner
cjonas9 May 16, 2026
bae2fdc
fix version check if warning prints
cjonas9 May 16, 2026
70eb9dc
bump all timeouts to >= 2 hours
cjonas9 May 17, 2026
705edec
increase ingest phase timeout
cjonas9 May 17, 2026
c697510
extend aws role lifetime
cjonas9 May 17, 2026
caec3f4
undo session time limit increase, use pre-generated synthetic ledgers
cjonas9 May 18, 2026
b32181d
require confirmed gp3 throttling, extend GHA AWS session to 4 hours
cjonas9 May 19, 2026
3a0571f
patch logic for throttling behavior
cjonas9 May 19, 2026
2c4a004
slim needless instance bootstrapping work
cjonas9 May 20, 2026
d620450
refactor ephemeral load test runner
cjonas9 May 27, 2026
41529f4
fix minor refactor false sha-verify failure
cjonas9 May 27, 2026
2a21c73
add support for multiple ledger profiles/files
cjonas9 Jun 11, 2026
04f0fe1
change log level to warn, decrease each soroban scenario meta to 1000…
cjonas9 Jun 12, 2026
02556cc
refactored duplicate/messy code
cjonas9 Jun 12, 2026
807ca42
stop grepping to determine success status, make GHA->ec2 parameter pa…
cjonas9 Jun 12, 2026
af9f7b9
split offline ledger generation out of the ingest benchmark
cjonas9 Jun 12, 2026
e4180dd
refactor and remove old apply load cfg
cjonas9 Jun 12, 2026
4c3394c
Merge remote-tracking branch 'origin/main' into apply-load
cjonas9 Jun 12, 2026
bc2e490
Merge branch 'main' into apply-load
cjonas9 Jun 15, 2026
555483e
Merge branch 'apply-load' of https://github.com/stellar/stellar-rpc i…
cjonas9 Jun 15, 2026
a620cdc
fix linter errors
cjonas9 Jun 15, 2026
2dabdf3
add json file providing configurability for eval thresholds
cjonas9 Jun 16, 2026
3f873f7
add basic coordinator for epic's tasks
cjonas9 Jun 16, 2026
8f4f1d1
make ec2 ingest load test callable
cjonas9 Jun 16, 2026
c1c437f
propogate apply load ingest test metrics to coordinator
cjonas9 Jun 17, 2026
b031d9d
add releaseeval package for subtest tooling and execution
cjonas9 Jun 17, 2026
61d4877
make ingest load test share perf schema w/ coordinator
cjonas9 Jun 17, 2026
65cb6ff
update go version
cjonas9 Jun 17, 2026
4aca1ef
update default ledger bundle/config to existent ones for test
cjonas9 Jun 17, 2026
3d61ceb
decompose ec2 script into go programs
cjonas9 Jun 17, 2026
9bef115
reduce comment verbosity, minor clean up
cjonas9 Jun 17, 2026
8b39ed5
install jq on load-test box for build-libs; surface build-libs errors
cjonas9 Jun 18, 2026
714b1fa
throttle load-test benchmark via cgroup io.max instead of EBS ModifyV…
cjonas9 Jun 18, 2026
d9987f6
drop accidentally-committed refresh tooling and orphaned apply-load.cfg
cjonas9 Jun 18, 2026
5058ad3
fix linter errors in load-test runner
cjonas9 Jun 18, 2026
8cf9f6b
make load-test ingest frequency and ledger count configurable via env
cjonas9 Jun 18, 2026
3b33626
EXPERIMENT: run load-test benchmark un-throttled at volume-provisione…
cjonas9 Jun 18, 2026
7e60661
use SDK's maxLedgersPerFile ceiling and multiple-bundle functionality
cjonas9 Jun 18, 2026
fdb1926
simplify verification walk
cjonas9 Jun 18, 2026
1f974a4
simplify and refactor, add ledger ingest stall timeout
cjonas9 Jun 22, 2026
19a3115
simplify correctness check, delegate apply-load config work to SDK
cjonas9 Jun 22, 2026
103b648
remove ingest phase dependence on unnecessary supplied apply load con…
cjonas9 Jun 23, 2026
7e13bf3
bump go sdk to v0.6.x
cjonas9 Jun 23, 2026
8333974
bump go sdk again, merge SDK main into loadtest-patch
cjonas9 Jun 23, 2026
f3f3d58
Merge remote-tracking branch 'origin/main' into apply-load
cjonas9 Jun 23, 2026
a6241f6
update comments in light of changes
cjonas9 Jun 23, 2026
855527c
merge apply-load recent work into coordinator
cjonas9 Jun 24, 2026
8d5f523
rework handshake into instance->s3 results push, fix minor leaks + OO…
cjonas9 Jun 24, 2026
21b8045
replace polling-based ledger timing computation with daemon hook
cjonas9 Jun 24, 2026
a8931fe
remove trigger-on-push behavior
cjonas9 Jun 25, 2026
97af867
Merge branch 'apply-load' into gha-coordinator
cjonas9 Jun 25, 2026
b15e2e3
simplify significantly, refactor into on-release-push job launcher + …
cjonas9 Jun 25, 2026
fbd8b2b
moved ingest load test go programs into separate folder
cjonas9 Jun 25, 2026
237578c
refactored coordinator logic into go
cjonas9 Jun 25, 2026
4651084
Merge remote-tracking branch 'origin/main' into gha-coordinator
cjonas9 Jun 26, 2026
f1b4473
add temporary trigger and log->s3 for testing
cjonas9 Jun 26, 2026
c601be5
bring main verbosity cleanups into coordinator
cjonas9 Jun 26, 2026
d846b52
decompose shared ec2/gha programming into reusable modular components
cjonas9 Jun 29, 2026
f83c4d8
move run-load-test.sh scripting into run_leg helper in common shell s…
cjonas9 Jun 29, 2026
c91c61f
refactor into callable workflow, factor out common main Run() func
cjonas9 Jun 29, 2026
4ced1a8
Merge branch 'main' into gha-coordinator
cjonas9 Jul 1, 2026
4193e6e
gate comment posting on GHA bot user, add guard for blank comments, s…
cjonas9 Jul 8, 2026
6e760db
remove local files from gitignore
cjonas9 Jul 8, 2026
5877dc2
derive all timeout buffers from e2e deadline
cjonas9 Jul 8, 2026
6ea0d82
move leg concurrency label from workflow level to job level
cjonas9 Jul 8, 2026
c701ab2
pin renderer to workflow version, pass ec2 launch params through env
cjonas9 Jul 8, 2026
fef348f
make renderer failures abort before posting
cjonas9 Jul 8, 2026
e542699
make run-load-test.sh 644
cjonas9 Jul 8, 2026
6e0ad79
make gather its own command in its own package main
cjonas9 Jul 8, 2026
0d93c00
Merge branch 'gha-coordinator' of https://github.com/stellar/stellar-…
cjonas9 Jul 8, 2026
2bdcc22
return error in BailInstance
cjonas9 Jul 8, 2026
9e1aa87
inline running of apply-load test rather than abstracting through cal…
cjonas9 Jul 8, 2026
ac92932
drastically simplify AMI resolution
cjonas9 Jul 8, 2026
c2be14f
simplify s3 to be the sole reporting channel
cjonas9 Jul 9, 2026
38081f5
inline + simplify result fetching in gather from s3
cjonas9 Jul 9, 2026
9ddaaed
make renderer robust to comments by passing comment md as base64 JSON…
cjonas9 Jul 9, 2026
8076b9e
add gather/main.go
cjonas9 Jul 9, 2026
6c98267
pin hardcoded AMI
cjonas9 Jul 9, 2026
dce2afd
guard against stale attempts
cjonas9 Jul 9, 2026
18df31c
Merge branch 'main' into gha-coordinator
cjonas9 Jul 10, 2026
62719e2
remove temporary scaffolding in-place for debugging on this branch
cjonas9 Jul 10, 2026
ee300ed
Merge branch 'gha-coordinator' of https://github.com/stellar/stellar-…
cjonas9 Jul 10, 2026
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
264 changes: 264 additions & 0 deletions .github/workflows/ec2-leg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
name: Perf-eval EC2 leg (ephemeral)
# Generic callable leg: launches an ephemeral EC2 box, renders its user-data from
# bootstrap-common.sh + the leg's own run script, polls S3 for the result object
# the box publishes, and reports through that object (job result = leg verdict).
# Does not post to the PR -- the coordinator owns human-facing output.
# Box bootstrap: perf-eval/bootstrap-common.sh + the leg script (inputs.leg_script);
# runner-side polling: perf-eval/gather.

on:
# workflow_call is the only trigger: a leg runs through the coordinator.
workflow_call:
inputs:
target_ref:
description: 'Ref or SHA to benchmark (resolved to a SHA on checkout)'
required: true
type: string
run_label:
description: 'Leg label; folded into the S3 result key and instance name'
required: true
type: string
leg_script:
description: 'Path to the leg run script, concatenated after bootstrap-common.sh into the box user-data'
required: true
type: string
instance_type:
description: 'EC2 instance type'
required: false
type: string
default: c5.2xlarge
root_volume_gb:
description: 'Root gp3 volume size (GB)'
required: false
type: number
default: 500
volume_iops:
description: 'Root gp3 IOPS (3000 is the gp3 floor)'
required: false
type: number
default: 3000
volume_throughput:
description: 'Root gp3 throughput (MiB/s)'
required: false
type: number
default: 125
ssm_registration_timeout:
description: 'Seconds to wait for the SSM agent to register'
required: false
type: number
default: 240
budget_minutes:
description: 'End-to-end leg ceiling (= job timeout); S3 poll deadline, box self-terminate, and OIDC session derive from it (-15m/+15m/+15m). Derived session must fit the IAM role max.'
required: false
type: number
default: 225
poll_interval:
description: 'Seconds between S3 result polls'
required: false
type: number
default: 30
extra_env:
description: 'Extra `export FOO=bar` lines injected into the box user-data preamble'
required: false
type: string
default: ''
secrets:
AWS_GHA_ROLE_ARN:
description: 'OIDC role ARN to assume for EC2 + S3 access'
required: true

# Only the intrinsic infra permissions necessary
permissions:
id-token: write # OIDC AssumeRole into the GHA role
contents: read # checkout

jobs:
ec2-leg:
name: Launch + await ephemeral perf-eval box
# Non-cancelling group keyed on the test commit SHA + leg. An instance can run
# until the box’s self-terminate ceiling, so new runs queue.
concurrency:
group: ec2-leg-${{ inputs.target_ref }}-${{ inputs.run_label }}
cancel-in-progress: false
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.budget_minutes }}
env:
AWS_REGION: us-east-1
INSTANCE_TYPE: ${{ inputs.instance_type }}
ROOT_VOLUME_GB: ${{ inputs.root_volume_gb }}
BOOTSTRAP_VOLUME_IOPS: ${{ inputs.volume_iops }}
BOOTSTRAP_VOLUME_THROUGHPUT: ${{ inputs.volume_throughput }}
INSTANCE_PROFILE: stellar-rpc-ci-load-test
TEST_TAG_KEY: test
TEST_TAG_VAL: stellar-rpc-ci-load-test
SSM_REGISTRATION_TIMEOUT: ${{ inputs.ssm_registration_timeout }}
POLL_INTERVAL: ${{ inputs.poll_interval }}
DEBUG_LOG_LINES: 40
DEBUG_LOG_EVERY_POLLS: 5
PERF_EVAL_DIR: cmd/stellar-rpc/internal/integrationtest/infrastructure/perf-eval
LEG_SCRIPT: ${{ inputs.leg_script }}
BUCKET: stellar-rpc-ci-load-test
RESULT_KEY: runs/${{ github.run_id }}/${{ inputs.run_label }}/result.json # deterministic per run + leg
Comment thread
cjonas9 marked this conversation as resolved.

steps:
# budget_minutes is the job timeout and the other deadlines derive from it so
# the ordering (poll < job < self-terminate <= role session) holds by
# construction.
- name: Derive deadlines
id: deadlines
run: |
B=${{ inputs.budget_minutes }}
[ "$B" -gt 30 ] || { echo "::error::budget_minutes must exceed the 15m infra buffers"; exit 1; }
{
echo "RESULTS_TIMEOUT=$(( (B - 15) * 60 ))"
echo "SELF_TERMINATE_MINUTES=$(( B + 15 ))"
} >> "$GITHUB_ENV"
echo "role_seconds=$(( (B + 15) * 60 ))" >> "$GITHUB_OUTPUT"

# Harness (gather, bootstrap-common.sh, leg script) and the benchmarked
# code come from one SHA: target_ref is checked out here and the box rebuilds
# it. Tradeoff: an ad-hoc dispatch against an old ref also runs that ref's
# harness.
- name: Checkout target ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.target_ref }}

- name: Resolve target SHA
id: resolve
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

# The runner-side half is `go run <perf-eval>/gather`.
- uses: ./.github/actions/setup-go

- name: Configure AWS via OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_GHA_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
role-duration-seconds: ${{ steps.deadlines.outputs.role_seconds }}

- name: Render user-data
# The scripts ship verbatim; parameters travel in a preamble so the bytes
# that run on the box match the bytes in git. Order is:
# preamble exports -> bootstrap-common.sh -> the leg run script.
env:
EXTRA_ENV: ${{ inputs.extra_env }}
run: |
{
echo '#!/usr/bin/env bash'
echo "export TARGET_SHA=${{ steps.resolve.outputs.sha }} RUN_ID=${{ github.run_id }}-${{ github.run_attempt }}"
echo "export BUCKET=$BUCKET RESULT_KEY=$RESULT_KEY"
echo "export SELF_TERMINATE_MINUTES=$SELF_TERMINATE_MINUTES"
if [ -n "$EXTRA_ENV" ]; then printf '%s\n' "$EXTRA_ENV"; fi
cat "$PERF_EVAL_DIR/bootstrap-common.sh"
cat "$LEG_SCRIPT"
} > /tmp/user-data.sh

- name: Launch EC2 instance
id: launch
env:
TARGET_REF: ${{ inputs.target_ref }}
RUN_LABEL: ${{ inputs.run_label }}
run: |
COMMON_TAGS="{Key=$TEST_TAG_KEY,Value=$TEST_TAG_VAL},
{Key=ref,Value=$TARGET_REF},
{Key=sha,Value=${{ steps.resolve.outputs.sha }}},
{Key=run-id,Value=${{ github.run_id }}}"
# AMI: Ubuntu 22.04 amd64 in us-east-1 as of 2026-07-08
RUN_INSTANCES_JSON=$(aws ec2 run-instances \
--image-id ami-0d28727121d5d4a3c \
--instance-type "$INSTANCE_TYPE" \
--iam-instance-profile "Name=$INSTANCE_PROFILE" \
--user-data file:///tmp/user-data.sh \
--instance-initiated-shutdown-behavior terminate \
--block-device-mappings "[{
\"DeviceName\":\"/dev/sda1\",
\"Ebs\":{\"VolumeSize\":$ROOT_VOLUME_GB,\"VolumeType\":\"gp3\",\"Iops\":$BOOTSTRAP_VOLUME_IOPS,\"Throughput\":$BOOTSTRAP_VOLUME_THROUGHPUT,\"DeleteOnTermination\":true}
}]" \
--tag-specifications \
"ResourceType=instance,Tags=[
{Key=Name,Value=perf-eval-$RUN_LABEL},
$COMMON_TAGS
]" \
"ResourceType=volume,Tags=[
{Key=Name,Value=perf-eval-${RUN_LABEL}-root},
$COMMON_TAGS
]" \
--count 1 \
--output json)

INSTANCE_ID=$(printf '%s' "$RUN_INSTANCES_JSON" | jq -r '.Instances[0].InstanceId')
echo "instance_id=$INSTANCE_ID" >> "$GITHUB_OUTPUT"

- name: Wait for SSM agent to register
env:
INSTANCE_ID: ${{ steps.launch.outputs.instance_id }}
run: |
DEADLINE=$(( $(date +%s) + SSM_REGISTRATION_TIMEOUT ))
while [ "$(date +%s)" -lt "$DEADLINE" ]; do
PING=$(aws ssm describe-instance-information \
--filters "Key=InstanceIds,Values=$INSTANCE_ID" \
--query 'InstanceInformationList[0].PingStatus' \
--output text 2>/dev/null || echo "")
echo "[$(date -u +%FT%TZ)] ssm ping=$PING"
if [ "$PING" = "Online" ]; then
exit 0
fi
sleep 10
done
echo "::error::SSM agent never registered for $INSTANCE_ID — verify AmazonSSMManagedInstanceCore is attached to the stellar-rpc-ci-load-test role"
exit 1

# Polls S3 for the result object and relays verdict/passed + the result
# location (bucket/key) as step outputs the coordinator reads.
# RUN_ID must match the box preamble's: gather skips result objects from
# other attempts (a re-run shares RESULT_KEY with its predecessors).
- name: Poll for results
id: results
env:
INSTANCE_ID: ${{ steps.launch.outputs.instance_id }}
RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}
run: go run "./$PERF_EVAL_DIR/gather"
Comment thread
cjonas9 marked this conversation as resolved.

- name: Write results summary
if: always()
run: |
if [ -f /tmp/results.md ]; then
cat /tmp/results.md >> "$GITHUB_STEP_SUMMARY"
elif [ -f /tmp/timeout-comment.md ]; then
cat /tmp/timeout-comment.md >> "$GITHUB_STEP_SUMMARY"
fi

# Standalone-debugging convenience: the result object also lives in S3, which
# is what the coordinator reads.
- name: Upload leg results artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: perf-eval-results-${{ inputs.run_label }}
path: |
/tmp/results.md
/tmp/timeout-comment.md
/tmp/bench-results.json
if-no-files-found: warn

- name: Fail leg on timeout or leg failure
if: always()
run: |
if [ "${{ steps.results.outputs.found }}" != "true" ]; then
echo "Leg timed out before producing instance results"
exit 1
fi

if [ "${{ steps.results.outputs.passed }}" != "true" ]; then
echo "Instance reported a failing verdict"
cat /tmp/results.md 2>/dev/null || true
exit 1
fi

- name: Terminate instance
if: always() && steps.launch.outputs.instance_id != ''
run: |
aws ec2 terminate-instances \
--instance-ids ${{ steps.launch.outputs.instance_id }} || true
Loading
Loading