Skip to content

Commit

Permalink
Merge pull request #50 from gyohuangxin/fix_stop
Browse files Browse the repository at this point in the history
Fix stop runners failures
  • Loading branch information
gyohuangxin authored Apr 28, 2022
2 parents 689a4f9 + 9523c92 commit 5d33f1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ needs.start-runner.outputs.hostname }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scheduled-benchmarks-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ needs.start-runners-manual.outputs.github_run_id }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
Expand Down Expand Up @@ -271,6 +272,7 @@ jobs:
shell: bash

- name: Remove CNCF CIL runner from github repository
if: always()
run: |
runner_id=$(curl -s -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners | jq '.runners[] | select(.name == "${{ matrix.service-mesh }}-${{ matrix.load-generator }}-${{ matrix.test-configuration }}-${{ needs.start-runners-scheduled.outputs.github_run_id }}") | {id}' | jq -r .id)
curl -X DELETE -H 'Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{github.repository}}/actions/runners/$runner_id
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/stop-cil-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ device_id=$3
if [[ -z $device_id ]]; then
# If it's a scheduled benchmark test, we cannot get the orrespondence between hostname and
# device_id from previous job, so we need to use hostname to retrive device_id
device_id=$(curl -H "X-Auth-Token: $token " https://api.equinix.com/metal/v1/projects/96a9d336-541b-42f7-9827-d845010da550/devices | jq '.devices[] | select(.hostname == '\"$hostname\"') | {id}' | jq -r .id)
device_id=$(curl -H "X-Auth-Token: $token " https://api.equinix.com/metal/v1/projects/96a9d336-541b-42f7-9827-d845010da550/devices?hostname=${hostname} | jq '.devices[] | {id}' | jq -r .id)
fi

echo "Removing CNCF CIL machine: $hostname, device id: $device_id..."
Expand Down

0 comments on commit 5d33f1e

Please # to comment.