mirror of
https://github.com/prometheus/prometheus.git
synced 2026-02-11 02:41:03 +01:00
the start job requires the node pools to be gone before creating them, and the cleanup and restart jobs require the pools to be running to delete them, When the initial start is partial (only one pool was created), no command can move forward... the preconditions should be relaxed, for more robustness. Signed-off-by: machine424 <ayoubmrini424@gmail.com>
131 lines
5.8 KiB
YAML
131 lines
5.8 KiB
YAML
on:
|
|
repository_dispatch:
|
|
types: [prombench_start, prombench_restart, prombench_stop]
|
|
name: Prombench Workflow
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
AUTH_FILE: ${{ secrets.TEST_INFRA_PROVIDER_AUTH }}
|
|
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 }}
|
|
GKE_PROJECT_ID: macro-mile-203600
|
|
PR_NUMBER: ${{ github.event.client_payload.PR_NUMBER }}
|
|
PROVIDER: gke
|
|
RELEASE: ${{ github.event.client_payload.RELEASE }}
|
|
BENCHMARK_VERSION: ${{ github.event.client_payload.BENCHMARK_VERSION }}
|
|
BENCHMARK_DIRECTORY: ${{ github.event.client_payload.BENCHMARK_DIRECTORY }}
|
|
ZONE: europe-west3-a
|
|
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"
|
|
--data '{"state":"pending", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
- name: Run make deploy to start test
|
|
id: make_deploy
|
|
uses: docker://prominfra/prombench:master
|
|
with:
|
|
args: >-
|
|
make deploy;
|
|
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
|
- name: Update status to failure
|
|
if: failure()
|
|
run: >-
|
|
curl -i -X POST
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
-H "Content-Type: application/json"
|
|
--data '{"state":"failure", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"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"
|
|
--data '{"state":"success", "context": "prombench-status-update-start", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"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"
|
|
--data '{"state":"pending", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
- name: Run make clean to stop test
|
|
id: make_clean
|
|
uses: docker://prominfra/prombench:master
|
|
with:
|
|
args: >-
|
|
make clean;
|
|
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
|
- name: Update status to failure
|
|
if: failure()
|
|
run: >-
|
|
curl -i -X POST
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
-H "Content-Type: application/json"
|
|
--data '{"state":"failure", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"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"
|
|
--data '{"state":"success", "context": "prombench-status-update-cancel", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"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"
|
|
--data '{"state":"pending", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
- name: Run make clean then make deploy to restart test
|
|
id: make_restart
|
|
uses: docker://prominfra/prombench:master
|
|
with:
|
|
args: >-
|
|
make clean;
|
|
until make all_nodes_deleted; do echo "waiting for nodepools to be deleted"; sleep 10; done;
|
|
make deploy;
|
|
until make all_nodes_running; do echo "waiting for nodepools to be created"; sleep 10; done;
|
|
- name: Update status to failure
|
|
if: failure()
|
|
run: >-
|
|
curl -i -X POST
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
-H "Content-Type: application/json"
|
|
--data '{"state":"failure", "context": "prombench-status-update-restart", "target_url": "'$GITHUB_STATUS_TARGET_URL'"}'
|
|
"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"
|
|
--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"
|