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
87 changes: 87 additions & 0 deletions .github/workflows/benchmark-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: 'Dispatch SWE-bench Verified Benchmark'

on:
release:
types: [published]

Check failure on line 5 in .github/workflows/benchmark-dispatch.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

5:13 [quoted-strings] string value is not quoted with single quotes
workflow_dispatch:
inputs:
qwen_ref:
description: 'Qwen Code release tag to benchmark.'
required: true
type: 'string'
suite:
description: 'Allowlisted benchmark suite.'
required: true
type: 'choice'
default: 'swebench_verified_harbor_smoke'
options:
- 'swebench_verified_harbor_smoke'
- 'swebench_verified_gold_smoke'
- 'swebench_verified_qwen_smoke'
release_id:
description: 'Optional existing prerelease ID to update after a manual test.'
required: false
type: 'string'

jobs:
dispatch:
name: 'Submit benchmark run'
if: '${{ github.event_name != ''release'' || github.event.release.prerelease == false }}'
runs-on: [self-hosted, Linux, X64, qwen-benchmark]

Check failure on line 30 in .github/workflows/benchmark-dispatch.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

30:40 [quoted-strings] string value is not quoted with single quotes

Check failure on line 30 in .github/workflows/benchmark-dispatch.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

30:35 [quoted-strings] string value is not quoted with single quotes

Check failure on line 30 in .github/workflows/benchmark-dispatch.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

30:28 [quoted-strings] string value is not quoted with single quotes

Check failure on line 30 in .github/workflows/benchmark-dispatch.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

30:15 [quoted-strings] string value is not quoted with single quotes
timeout-minutes: 10
permissions:
contents: 'read'

steps:
- name: 'Resolve immutable release commit'
id: 'revision'
shell: 'bash'
env:
QWEN_REF: '${{ github.event.release.tag_name || inputs.qwen_ref }}'
GH_TOKEN: '${{ github.token }}'
run: |-
set -euo pipefail
object="$(curl --fail --silent --show-error \
--header "Authorization: Bearer ${GH_TOKEN}" \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/ref/tags/${QWEN_REF}")"
object_type="$(jq -r '.object.type' <<<"${object}")"
object_sha="$(jq -r '.object.sha' <<<"${object}")"
while [[ "${object_type}" == 'tag' ]]; do
object="$(curl --fail --silent --show-error \
--header "Authorization: Bearer ${GH_TOKEN}" \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/tags/${object_sha}")"
object_type="$(jq -r '.object.type' <<<"${object}")"
object_sha="$(jq -r '.object.sha' <<<"${object}")"
done
[[ "${object_type}" == 'commit' && "${object_sha}" =~ ^[0-9a-f]{40}$ ]]
echo "commit=${object_sha}" >> "${GITHUB_OUTPUT}"

- name: 'Submit benchmark request to local ECS queue'
env:
QWEN_REF: '${{ github.event.release.tag_name || inputs.qwen_ref }}'
QWEN_COMMIT: '${{ steps.revision.outputs.commit }}'
SUITE: "${{ inputs.suite || 'swebench_verified_harbor_smoke' }}"
RELEASE_ID: '${{ github.event.release.id || inputs.release_id }}'
TRIGGER: '${{ github.event_name }}'
run: |-
set -euo pipefail
args=(
--repository "${GITHUB_REPOSITORY}"
--qwen-ref "${QWEN_REF}"
--qwen-commit "${QWEN_COMMIT}"
--suite "${SUITE}"
--trigger "${TRIGGER}"
--github-run-id "${GITHUB_RUN_ID}"
--github-run-attempt "${GITHUB_RUN_ATTEMPT}"
)
if [[ -n "${RELEASE_ID}" ]]; then
args+=(--release-id "${RELEASE_ID}")
fi
response="$(sudo -n /usr/local/sbin/qwen-benchmark-dispatch "${args[@]}")"
echo "${response}" | jq .
echo "### Benchmark queued" >> "$GITHUB_STEP_SUMMARY"
echo "${response}" | jq -r '"- Run ID: `" + .run_id + "`\n- Status: `" + .status + "`"' >> "$GITHUB_STEP_SUMMARY"
86 changes: 86 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,33 @@
schedule:
- cron: '30 0 * * *'
workflow_dispatch:
inputs:
benchmark_poc:
description: 'Run the ECS benchmark POC instead of stale triage.'
required: false
type: boolean

Check failure on line 14 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

14:15 [quoted-strings] string value is not quoted with single quotes
default: false
qwen_ref:
description: 'Published Qwen Code tag to benchmark.'
required: false
type: string

Check failure on line 19 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

19:15 [quoted-strings] string value is not quoted with single quotes
default: ''
suite:
description: 'Allowlisted benchmark suite.'
required: false
type: choice

Check failure on line 24 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

24:15 [quoted-strings] string value is not quoted with single quotes
default: 'swebench_verified_gold_smoke'
options:
- 'swebench_verified_gold_smoke'
- 'swebench_verified_harbor_smoke'
release_id:
description: 'Optional GitHub Release ID to update after the benchmark.'
required: false
type: string

Check failure on line 32 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

32:15 [quoted-strings] string value is not quoted with single quotes

jobs:
stale:
if: '${{ github.event_name != ''workflow_dispatch'' || inputs.benchmark_poc == false }}'
runs-on: 'ubuntu-latest'
permissions:
issues: 'write'
Expand Down Expand Up @@ -45,3 +69,65 @@
# Cap per-run API operations to stay well under GitHub's hourly rate limit
# and give the current PR backlog (~150) enough headroom across a few runs.
operations-per-run: 100

benchmark-poc:
if: '${{ github.event_name == ''workflow_dispatch'' && inputs.benchmark_poc == true && github.repository == ''QwenLM/qwen-code'' }}'
name: 'ECS benchmark POC'
runs-on: [self-hosted, Linux, X64, qwen-benchmark]

Check failure on line 76 in .github/workflows/stale.yml

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, Node 22.x)

76:15 [quoted-strings] string value is not quoted with single quotes
timeout-minutes: 10
permissions:
contents: read

steps:
- name: 'Resolve immutable release commit'
id: revision
shell: bash
env:
QWEN_REF: '${{ inputs.qwen_ref }}'
GH_TOKEN: '${{ github.token }}'
run: |-
set -euo pipefail
object="$(curl --fail --silent --show-error \
--header "Authorization: Bearer ${GH_TOKEN}" \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/ref/tags/${QWEN_REF}")"
object_type="$(jq -r '.object.type' <<<"${object}")"
object_sha="$(jq -r '.object.sha' <<<"${object}")"
while [[ "${object_type}" == 'tag' ]]; do
object="$(curl --fail --silent --show-error \
--header "Authorization: Bearer ${GH_TOKEN}" \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/tags/${object_sha}")"
object_type="$(jq -r '.object.type' <<<"${object}")"
object_sha="$(jq -r '.object.sha' <<<"${object}")"
done
[[ "${object_type}" == 'commit' && "${object_sha}" =~ ^[0-9a-f]{40}$ ]]
echo "commit=${object_sha}" >> "${GITHUB_OUTPUT}"

- name: 'Queue benchmark in local ECS worker'
env:
QWEN_REF: '${{ inputs.qwen_ref }}'
QWEN_COMMIT: '${{ steps.revision.outputs.commit }}'
SUITE: '${{ inputs.suite }}'
RELEASE_ID: '${{ inputs.release_id }}'
TRIGGER: workflow_dispatch
run: |-
set -euo pipefail
args=(
--repository "${GITHUB_REPOSITORY}"
--qwen-ref "${QWEN_REF}"
--qwen-commit "${QWEN_COMMIT}"
--suite "${SUITE}"
--trigger "${TRIGGER}"
--github-run-id "${GITHUB_RUN_ID}"
--github-run-attempt "${GITHUB_RUN_ATTEMPT}"
)
if [[ -n "${RELEASE_ID}" ]]; then
args+=(--release-id "${RELEASE_ID}")
fi
response="$(sudo -n /usr/local/sbin/qwen-benchmark-dispatch "${args[@]}")"
echo "${response}" | jq .
echo "### Benchmark queued" >> "$GITHUB_STEP_SUMMARY"
echo "${response}" | jq -r '"- Run ID: `" + .run_id + "`\n- Status: `" + .status + "`"' >> "$GITHUB_STEP_SUMMARY"
7 changes: 7 additions & 0 deletions benchmark-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.artifacts/
.pytest_cache/
.state/
.venv/
.work/
*.egg-info/
__pycache__/
Loading
Loading