Skip to content

Commit ed2d99d

Browse files
committed
Select versioned Paper benchmark channels
1 parent 1bfe489 commit ed2d99d

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

.github/workflows/phase2-runtime-ab.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
paper_version:
9-
description: "Stable Paper runtime under test"
9+
description: "Paper runtime under test (26.2 currently uses the BETA channel)"
1010
required: true
1111
default: "26.1.2"
1212
type: choice
@@ -111,20 +111,32 @@ jobs:
111111
- name: Build and test the production plugin
112112
run: ./gradlew clean check shadowJar --no-daemon --no-build-cache --rerun-tasks
113113

114-
- name: Download selected stable Paper runtime
114+
- name: Download selected Paper runtime
115115
env:
116116
PAPER_USER_AGENT: InteractionVisualizer-Phase2/1.0 (https://github.com/EllanServer/InteractionVisualizer)
117117
PAPER_VERSION: ${{ env.CAMPAIGN_PAPER_VERSION }}
118118
run: |
119119
mkdir -p phase2-dependencies
120+
case "$PAPER_VERSION" in
121+
26.1.2) PAPER_CHANNEL=STABLE ;;
122+
26.2) PAPER_CHANNEL=BETA ;;
123+
*) echo "Unsupported Paper version: $PAPER_VERSION" >&2; exit 64 ;;
124+
esac
120125
BUILDS=$(curl --fail --silent --show-error \
121126
-H "User-Agent: $PAPER_USER_AGENT" \
122127
"https://fill.papermc.io/v3/projects/paper/versions/$PAPER_VERSION/builds")
123-
PAPER_URL=$(echo "$BUILDS" | jq -r 'first(.[] | select(.channel == "STABLE") | .downloads."server:default".url) // empty')
124-
test -n "$PAPER_URL"
128+
PAPER_RECORD=$(echo "$BUILDS" | jq -c --arg channel "$PAPER_CHANNEL" \
129+
'first(.[] | select(.channel == $channel)) // empty')
130+
test -n "$PAPER_RECORD"
131+
PAPER_URL=$(echo "$PAPER_RECORD" | jq -r '.downloads."server:default".url')
132+
PAPER_SHA256=$(echo "$PAPER_RECORD" | jq -r '.downloads."server:default".checksums.sha256')
133+
PAPER_BUILD_ID=$(echo "$PAPER_RECORD" | jq -r '.id')
125134
curl --fail --location --show-error \
126135
-H "User-Agent: $PAPER_USER_AGENT" \
127136
--output phase2-dependencies/paper.jar "$PAPER_URL"
137+
echo "$PAPER_SHA256 phase2-dependencies/paper.jar" | sha256sum --check
138+
echo "SELECTED_PAPER_CHANNEL=$PAPER_CHANNEL" >> "$GITHUB_ENV"
139+
echo "SELECTED_PAPER_BUILD_ID=$PAPER_BUILD_ID" >> "$GITHUB_ENV"
128140
129141
- name: Prepare immutable protocol client artifact
130142
run: bash tools/perf/prepare-phase2-protocol-client.sh phase2-dependencies/protocol-client
@@ -133,6 +145,8 @@ jobs:
133145
env:
134146
AB_FACTOR: ${{ env.CAMPAIGN_AB_FACTOR }}
135147
PAPER_VERSION: ${{ env.CAMPAIGN_PAPER_VERSION }}
148+
PAPER_CHANNEL: ${{ env.SELECTED_PAPER_CHANNEL }}
149+
PAPER_BUILD_ID: ${{ env.SELECTED_PAPER_BUILD_ID }}
136150
SCENARIO: ${{ env.CAMPAIGN_SCENARIO }}
137151
RUNS: ${{ env.CAMPAIGN_RUNS }}
138152
ITEMS: ${{ env.CAMPAIGN_ITEMS }}
@@ -269,6 +283,8 @@ jobs:
269283
PHASE2_PLUGIN_JAR="$PLUGIN_JAR" \
270284
PHASE2_PAPER_JAR=phase2-dependencies/paper.jar \
271285
PHASE2_PAPER_VERSION="$PAPER_VERSION" \
286+
PHASE2_PAPER_CHANNEL="$PAPER_CHANNEL" \
287+
PHASE2_PAPER_BUILD_ID="$PAPER_BUILD_ID" \
272288
PHASE2_CLIENT_ROOT=phase2-dependencies/protocol-client \
273289
PHASE2_OUTPUT_ROOT="$EVIDENCE_ROOT" \
274290
PHASE2_RUN_ID="$run_id" \

tools/perf/run-phase2-runtime-once.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ done
2626
plugin_jar="$(realpath "$PHASE2_PLUGIN_JAR")"
2727
paper_jar="$(realpath "$PHASE2_PAPER_JAR")"
2828
paper_version="${PHASE2_PAPER_VERSION:-26.1.2}"
29+
paper_channel="${PHASE2_PAPER_CHANNEL:-UNKNOWN}"
30+
paper_build_id="${PHASE2_PAPER_BUILD_ID:-0}"
2931
client_root="$(realpath "$PHASE2_CLIENT_ROOT")"
3032
output_root="$(realpath -m "$PHASE2_OUTPUT_ROOT")"
3133
run_id="$PHASE2_RUN_ID"
@@ -56,6 +58,12 @@ case "$paper_version" in
5658
26.1.2|26.2) ;;
5759
*) echo "PHASE2_PAPER_VERSION must be 26.1.2 or 26.2" >&2; exit 64 ;;
5860
esac
61+
case "$paper_channel" in
62+
STABLE|BETA|UNKNOWN) ;;
63+
*) echo "PHASE2_PAPER_CHANNEL must be STABLE, BETA, or UNKNOWN" >&2; exit 64 ;;
64+
esac
65+
[[ "$paper_build_id" =~ ^[0-9]+$ ]] \
66+
|| { echo "PHASE2_PAPER_BUILD_ID must be numeric" >&2; exit 64; }
5967
case "$scenario" in
6068
static-steady|static-spawn|visibility-return|visibility-itemdisplay-return|visibility-textdisplay-return|dropped-items|block-idle|block-active|block-direct-write) ;;
6169
*) echo "Unsupported PHASE2_SCENARIO: $scenario" >&2; exit 64 ;;
@@ -1721,6 +1729,8 @@ cat > "$run_directory/run-manifest.json" <<EOF
17211729
"runId": "$run_id",
17221730
"scenario": "$scenario",
17231731
"paperVersion": "$paper_version",
1732+
"paperChannel": "$paper_channel",
1733+
"paperBuildId": $paper_build_id,
17241734
"variant": "$variant",
17251735
"abFactor": "$ab_factor",
17261736
"droppedSourceOwnedSectionCandidates": $dropped_source_owned_candidates,

0 commit comments

Comments
 (0)