-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Simplify ci monitoring with custom actions
- Loading branch information
Showing
4 changed files
with
117 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: 'Run the provided command in an environment configured to monitor tmpnet networks' | ||
description: 'Run the provided command in an environment configured to monitor tmpnet networks' | ||
|
||
inputs: | ||
run: | ||
description: "the bash command to run" | ||
required: true | ||
url_encoded_repo: | ||
# TODO(marun) Process github.repository into this url-encoded form | ||
default: 'ava-labs%2Favalanchego' | ||
filter_by_owner: | ||
default: '' | ||
prometheus_id: | ||
required: true | ||
prometheus_password: | ||
required: true | ||
loki_id: | ||
required: true | ||
loki_password: | ||
required: true | ||
# The following inputs need never be provided by the caller. They | ||
# default to context values that the action's steps are unable to | ||
# acccess directly. | ||
repository: | ||
default: ${{ github.repository }} | ||
workflow: | ||
default: ${{ github.workflow }} | ||
run_id: | ||
default: ${{ github.run_id }} | ||
run_number: | ||
default: ${{ github.run_number }} | ||
run_attempt: | ||
default: ${{ github.run_attempt }} | ||
job: | ||
default: ${{ github.job }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Start prometheus | ||
# Only run for the original repo; a forked repo won't have access to the monitoring credentials | ||
if: (inputs.prometheus_id != '') | ||
shell: bash | ||
run: bash -x ./scripts/run_prometheus.sh | ||
env: | ||
PROMETHEUS_ID: ${{ inputs.prometheus_id }} | ||
PROMETHEUS_PASSWORD: ${{ inputs.prometheus_password }} | ||
- name: Start promtail | ||
if: (inputs.prometheus_id != '') | ||
shell: bash | ||
run: bash -x ./scripts/run_promtail.sh | ||
env: | ||
LOKI_ID: ${{ inputs.loki_id }} | ||
LOKI_PASSWORD: ${{ inputs.loki_password }} | ||
- name: Notify of metrics availability | ||
if: (inputs.prometheus_id != '') | ||
shell: bash | ||
run: .github/actions/run-monitored-tmpnet-cmd/notify-metrics-availability.sh | ||
env: | ||
GRAFANA_URL: https://grafana-experimental.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7C${{ inputs.url_encoded_repo }}&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }} | ||
GH_JOB_ID: ${{ inputs.job }} | ||
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }} | ||
- name: Run command | ||
shell: bash | ||
run: ${{ inputs.run }} | ||
env: | ||
GH_REPO: ${{ inputs.repository }} | ||
GH_WORKFLOW: ${{ inputs.workflow }} | ||
GH_RUN_ID: ${{ inputs.run_id }} | ||
GH_RUN_NUMBER: ${{ inputs.run_number }} | ||
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }} | ||
GH_JOB_ID: ${{ inputs.job }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Upload an artifact of tmpnet data' | ||
description: 'Upload an artifact of data in the ~/.tmpnet path' | ||
|
||
inputs: | ||
name: | ||
description: "the name of the artifact to upload" | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Upload tmpnet data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.name }} | ||
path: | | ||
~/.tmpnet/networks | ||
~/.tmpnet/prometheus/prometheus.log | ||
~/.tmpnet/promtail/promtail.log | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters