mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
CI: use new self-hosted runner servers (#35002)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
28c9ceedf6
commit
2cd5e1356c
1 changed files with 23 additions and 21 deletions
26
.github/workflows/self-hosted-runner-select.yml
vendored
26
.github/workflows/self-hosted-runner-select.yml
vendored
|
@ -12,10 +12,6 @@ on:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: /orgs/${{ github.repository_owner }}/actions/runners
|
default: /orgs/${{ github.repository_owner }}/actions/runners
|
||||||
monitor-api-base-url:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: https://ci0.servo.org
|
|
||||||
force-github-hosted-runner:
|
force-github-hosted-runner:
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -46,7 +42,6 @@ jobs:
|
||||||
github_hosted_runner_label='${{ inputs.github-hosted-runner-label }}'
|
github_hosted_runner_label='${{ inputs.github-hosted-runner-label }}'
|
||||||
self_hosted_image_name='${{ inputs.self-hosted-image-name }}'
|
self_hosted_image_name='${{ inputs.self-hosted-image-name }}'
|
||||||
self_hosted_runner_scope='${{ inputs.self-hosted-runner-scope }}'
|
self_hosted_runner_scope='${{ inputs.self-hosted-runner-scope }}'
|
||||||
monitor_api_base_url='${{ inputs.monitor-api-base-url }}'
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
@ -77,22 +72,29 @@ jobs:
|
||||||
fall_back_to_github_hosted
|
fall_back_to_github_hosted
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for monitor_api_base_url in $(printf \%s\\n \
|
||||||
|
https://ci0.servo.org \
|
||||||
|
https://ci1.servo.org \
|
||||||
|
https://ci2.servo.org \
|
||||||
|
| shuf); do
|
||||||
# Use the monitor API to reserve a runner. If we get an object with
|
# Use the monitor API to reserve a runner. If we get an object with
|
||||||
# runner details, we succeeded. If we get null, we failed.
|
# runner details, we succeeded. If we get null, we failed.
|
||||||
take_runner_url=$monitor_api_base_url/profile/$self_hosted_image_name/take\?unique_id=$unique_id\&qualified_repo=${{ github.repository }}\&run_id=${{ github.run_id }}
|
take_runner_url=$monitor_api_base_url/profile/$self_hosted_image_name/take\?unique_id=$unique_id\&qualified_repo=${{ github.repository }}\&run_id=${{ github.run_id }}
|
||||||
result=$(mktemp)
|
result=$(mktemp)
|
||||||
echo
|
echo
|
||||||
echo POST "$take_runner_url"
|
echo POST "$take_runner_url"
|
||||||
if ! curl -sS --fail-with-body --connect-timeout 5 --max-time 30 -X POST "$take_runner_url" \
|
if curl -sS --fail-with-body --connect-timeout 5 --max-time 30 -X POST "$take_runner_url" \
|
||||||
-H 'Authorization: Bearer ${{ secrets.SERVO_CI_MONITOR_API_TOKEN }}' > $result \
|
-H 'Authorization: Bearer ${{ secrets.SERVO_CI_MONITOR_API_TOKEN }}' > $result \
|
||||||
|| ! jq -e . $result > /dev/null; then
|
&& jq -e . $result > /dev/null; then
|
||||||
|
echo
|
||||||
|
echo "selected_runner_label=reserved-for:$unique_id" | tee -a $GITHUB_OUTPUT
|
||||||
|
echo 'is_self_hosted=true' | tee -a $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
cat $result
|
cat $result
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo 'No self-hosted runners available!'
|
echo 'No self-hosted runners available!'
|
||||||
fall_back_to_github_hosted
|
fall_back_to_github_hosted
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "selected_runner_label=reserved-for:$unique_id" | tee -a $GITHUB_OUTPUT
|
|
||||||
echo 'is_self_hosted=true' | tee -a $GITHUB_OUTPUT
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue