2020-08-05 00:46:11 -07:00
|
|
|
on:
|
2020-08-04 12:55:24 -07:00
|
|
|
repository_dispatch:
|
|
|
|
types: [prombench_start,prombench_restart,prombench_stop]
|
2020-01-27 08:06:28 -08:00
|
|
|
name: Prombench Workflow
|
2020-05-07 01:17:46 -07:00
|
|
|
env:
|
2020-08-16 05:00:32 -07:00
|
|
|
AUTH_FILE: ${{ secrets.TEST_INFRA_PROVIDER_AUTH }}
|
2020-05-07 01:17:46 -07:00
|
|
|
CLUSTER_NAME: test-infra
|
|
|
|
DOMAIN_NAME: prombench.prometheus.io
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
GITHUB_ORG: prometheus
|
|
|
|
GITHUB_REPO: prometheus
|
|
|
|
GITHUB_STATUS_TARGET_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
|
|
|
|
LAST_COMMIT_SHA: ${{ github.event.client_payload.LAST_COMMIT_SHA }}
|
2020-08-16 05:00:32 -07:00
|
|
|
GKE_PROJECT_ID: macro-mile-203600
|
2020-05-07 01:17:46 -07:00
|
|
|
PR_NUMBER: ${{ github.event.client_payload.PR_NUMBER }}
|
2020-08-16 05:00:32 -07:00
|
|
|
PROVIDER: gke
|
2020-05-07 01:17:46 -07:00
|
|
|
RELEASE: ${{ github.event.client_payload.RELEASE }}
|
|
|
|
ZONE: europe-west3-a
|
2020-01-27 08:06:28 -08:00
|
|
|
jobs:
|
|
|
|
benchmark_start:
|
|
|
|
name: Benchmark Start
|
|
|
|
if: github.event.action == 'prombench_start'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Update status to pending
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"pending", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Run make deploy to start test
|
|
|
|
id: make_deploy
|
2020-03-04 05:06:02 -08:00
|
|
|
uses: docker://prominfra/prombench:master
|
2020-01-27 08:06:28 -08:00
|
|
|
with:
|
|
|
|
args: >-
|
|
|
|
until make all_nodepools_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
|
|
|
make deploy;
|
|
|
|
- name: Update status to failure
|
|
|
|
if: failure()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"failure", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Update status to success
|
|
|
|
if: success()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"success", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
benchmark_cancel:
|
|
|
|
name: Benchmark Cancel
|
|
|
|
if: github.event.action == 'prombench_stop'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Update status to pending
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"pending", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Run make clean to stop test
|
|
|
|
id: make_clean
|
2020-03-04 05:06:02 -08:00
|
|
|
uses: docker://prominfra/prombench:master
|
2020-01-27 08:06:28 -08:00
|
|
|
with:
|
|
|
|
args: >-
|
|
|
|
until make all_nodepools_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
|
|
|
make clean;
|
|
|
|
- name: Update status to failure
|
|
|
|
if: failure()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"failure", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Update status to success
|
|
|
|
if: success()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"success", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
benchmark_restart:
|
|
|
|
name: Benchmark Restart
|
|
|
|
if: github.event.action == 'prombench_restart'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Update status to pending
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"pending", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Run make clean then make deploy to restart test
|
|
|
|
id: make_restart
|
2020-03-04 05:06:02 -08:00
|
|
|
uses: docker://prominfra/prombench:master
|
2020-01-27 08:06:28 -08:00
|
|
|
with:
|
|
|
|
args: >-
|
|
|
|
until make all_nodepools_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
|
|
|
make clean;
|
|
|
|
until make all_nodepools_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
|
|
|
make deploy;
|
|
|
|
- name: Update status to failure
|
|
|
|
if: failure()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"failure", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
2020-01-27 08:06:28 -08:00
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Update status to success
|
|
|
|
if: success()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
2020-05-07 01:17:46 -07:00
|
|
|
--data '{"state":"success", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|