-
Notifications
You must be signed in to change notification settings - Fork 710
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
5 changed files
with
131 additions
and
109 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,33 @@ | ||
name: 'Run a shell command with github env vars set' | ||
description: 'Run the provided command with github env vars set (helpful for enabling monitoring of tmpnet networks)' | ||
|
||
inputs: | ||
run: | ||
description: "the bash command to run" | ||
required: true | ||
repo: | ||
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_id: | ||
default: ${{ github.job }} | ||
|
||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Run command | ||
shell: bash | ||
run: ${{ inputs.run }} | ||
env: | ||
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 }} |
44 changes: 44 additions & 0 deletions
44
.github/actions/start-monitoring-tmpnet-networks/action.yml
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,44 @@ | ||
name: 'Start monitoring tmpnet networks' | ||
description: 'Start collectors for logs and metrics from tmpnet networks' | ||
|
||
inputs: | ||
owner: | ||
description: "the owner the metrics link should filter by" | ||
default: "" | ||
job: | ||
default: ${{ github.job }} | ||
run_id: | ||
default: ${{ github.run_id }} | ||
run_attempt: | ||
default: ${{ github.run_attempt }} | ||
prometheus_id: | ||
required: true | ||
prometheus_password: | ||
required: true | ||
loki_id: | ||
required: true | ||
loki_password: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Start prometheus | ||
shell: bash | ||
run: bash -x ./scripts/run_prometheus.sh | ||
env: | ||
PROMETHEUS_ID: ${{ inputs.prometheus_id }} | ||
PROMETHEUS_PASSWORD: ${{ inputs.prometheus_password }} | ||
- name: Start promtail | ||
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 | ||
shell: bash | ||
run: .github/actions/start-monitoring-tmpnet-networks/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%7Cava-labs%2Favalanchego&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.owner }} |
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