Skip to content

Commit 6e33700

Browse files
committed
AUS-1011: Accept a branch, tag or any commit as the job ref
git fetch refuses a short hash, which is what the first launch passed. The runner now fetches when it can and otherwise checks the ref out from the full clone; the README and the usage lines say what a ref may be.
1 parent 2c6aae1 commit 6e33700

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ dotnet run --project samples/WasmHost # browser: "
630630

631631
The three modes measure different things and are named for the entry point they call. `Process(bytes), dedicated threads` measures the library alone. `ProcessAsync(bytes), awaited workers` measures the entry point an asynchronous host calls. `Legacy Process(string), scheduled synchronous work` measures the 1.x string overloads through the thread pool. The Kestrel rows say whether `EnableAsyncMethods` was on.
632632

633-
On Hugging Face Jobs, run `benchmarks/hf/launch.sh <ref> <flavor> [runs]` and retrieve JSON with `benchmarks/hf/fetch.py <job id> <out dir>`; `cpu-upgrade` is 8 vCPU ($0.03/h), `cpu-xl` is 16 vCPU ($1/h), and `cpu-performance` is 32 vCPU ($1.90/h), while `cpu-basic` is 2 vCPU for smoke runs only. These are shared vCPUs, so each job's figures belong to its own machine row and are never merged into the reference-box tables.
633+
On Hugging Face Jobs, run `benchmarks/hf/launch.sh <ref> <flavor> [runs]` (`<ref>` is a branch, tag or commit) and retrieve JSON with `benchmarks/hf/fetch.py <job id> <out dir>`; `cpu-upgrade` is 8 vCPU ($0.03/h), `cpu-xl` is 16 vCPU ($1/h), and `cpu-performance` is 32 vCPU ($1.90/h), while `cpu-basic` is 2 vCPU for smoke runs only. These are shared vCPUs, so each job's figures belong to its own machine row and are never merged into the reference-box tables.
634634

635635
### Sync: the library alone
636636

‎benchmarks/hf/launch.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
if [[ $# -lt 2 || $# -gt 3 ]]; then
5-
echo "usage: launch.sh <ref> <flavor> [runs]" >&2
5+
echo "usage: launch.sh <ref: branch, tag or commit> <flavor> [runs]" >&2
66
exit 2
77
fi
88
ref=$1
@@ -14,5 +14,5 @@ if ! [[ $runs =~ ^[1-9][0-9]*$ ]]; then
1414
fi
1515

1616
hf jobs run --detach --flavor "$flavor" --timeout 2h --name "jsonrpc-bench-$flavor" mcr.microsoft.com/dotnet/sdk:10.0 bash -c \
17-
'git clone https://github.com/Astn/JSON-RPC.NET.git /tmp/jsonrpc-runner && git -C /tmp/jsonrpc-runner fetch origin "$1" && git -C /tmp/jsonrpc-runner checkout --detach FETCH_HEAD && exec bash /tmp/jsonrpc-runner/benchmarks/hf/run.sh "$1" "$2"' \
17+
'git clone https://github.com/Astn/JSON-RPC.NET.git /tmp/jsonrpc-runner && (git -C /tmp/jsonrpc-runner fetch origin "$1" && git -C /tmp/jsonrpc-runner checkout --detach FETCH_HEAD || git -C /tmp/jsonrpc-runner checkout --detach "$1") && exec bash /tmp/jsonrpc-runner/benchmarks/hf/run.sh "$1" "$2"' \
1818
bash "$ref" "$runs"

‎benchmarks/hf/run.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
if [[ $# -lt 1 || $# -gt 2 ]]; then
5-
echo "usage: run.sh <ref> [runs]" >&2
5+
echo "usage: run.sh <ref: branch, tag or commit> [runs]" >&2
66
exit 2
77
fi
88
ref=$1
@@ -22,8 +22,8 @@ fi
2222

2323
work=$(mktemp -d)
2424
git clone https://github.com/Astn/JSON-RPC.NET.git "$work"
25-
git -C "$work" fetch origin "$ref"
26-
git -C "$work" checkout --detach FETCH_HEAD
25+
# A branch, tag or full hash is fetched; anything else (a short hash) is resolved from the full clone.
26+
git -C "$work" fetch origin "$ref" && git -C "$work" checkout --detach FETCH_HEAD || git -C "$work" checkout --detach "$ref"
2727
cd "$work"
2828
dotnet build -c Release TestServer_Console -nodeReuse:false
2929
dotnet run -c Release --no-build --project TestServer_Console -- --machine

0 commit comments

Comments
 (0)