Skip to content

Commit 48d9967

Browse files
authored
Merge pull request #7 from zenml-io/gh-action-discord-alerter
Integrate daily pipeline health GitHub Action with Discord failure alerts
2 parents 2d6f8fe + 1a7b7a8 commit 48d9967

File tree

2 files changed

+101
-2
lines changed

2 files changed

+101
-2
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Test Tutorial Pipelines
2+
3+
on:
4+
schedule:
5+
# Run daily at 9 AM UTC
6+
- cron: "0 9 * * *"
7+
push:
8+
branches: [main, develop]
9+
pull_request:
10+
branches: [main, develop]
11+
workflow_dispatch:
12+
13+
jobs:
14+
test-pipelines:
15+
runs-on: ubuntu-latest
16+
env:
17+
ZENML_ANALYTICS_OPT_IN: false
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: "3.11"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install zenml[server] --upgrade
32+
pip install -r requirements.txt
33+
34+
- name: Initialize ZenML
35+
run: |
36+
zenml init
37+
zenml integration install aws s3 -y
38+
39+
- name: Run all tutorial pipelines
40+
id: run_all
41+
run: |
42+
failed=()
43+
for p in \
44+
"pipelines/helloWorld/hello_pipeline.py" \
45+
"pipelines/caching/cache_pipeline.py" \
46+
"pipelines/fanOut/fan_pipeline.py" \
47+
"pipelines/metadata/meta_pipeline.py" \
48+
"pipelines/parameters/param_pipeline.py" \
49+
"pipelines/retries/robust_pipeline.py" \
50+
"pipelines/stepIO/io_pipeline.py" \
51+
"pipelines/tagging/tagged_pipeline.py" \
52+
"pipelines/visualizations/viz_pipeline.py" \
53+
"pipelines/yamlConfig/yaml_pipeline.py"; do
54+
55+
echo "Running $p…"
56+
if [[ "$p" == *"retries/robust_pipeline.py" ]]; then
57+
PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH python "$p" || echo "⚠ robust_pipeline demo: failure expected"
58+
else
59+
PYTHONPATH=$GITHUB_WORKSPACE:$PYTHONPATH python "$p" || failed+=("$p")
60+
fi
61+
done
62+
63+
if [ "${#failed[@]}" -gt 0 ]; then
64+
echo "Failed pipelines:"
65+
printf " - %s\n" "${failed[@]}"
66+
exit 1
67+
fi
68+
69+
notify-discord:
70+
needs: test-pipelines
71+
if: ${{ failure() }}
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- name: Send Discord notification on failure
76+
uses: Ilshidur/action-discord@master
77+
env:
78+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_SRE }}
79+
with:
80+
args: |
81+
**Pipeline Test Failure Alert**
82+
83+
Repository: ${{ github.repository }}
84+
Branch: ${{ github.ref_name }}
85+
Workflow: ${{ github.workflow }}
86+
Run ID: ${{ github.run_id }}
87+
88+
One or more tutorial pipelines failed with the latest ZenML version.
89+
Details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ The extension runs in two places:
4545
1. **Build extension**:
4646

4747
```bash
48-
npm run buildExtension:replace
48+
npm run buildExtension
4949
```
5050

51-
_This packages the extension and updates both repos (requires repos to be side-by-side)_
51+
_This packages the extension and replaces the current one in `.devcontainer/extensions/`_
5252

5353
2. **Test in user environment**: Test changes in both GitHub Codespaces and local dev containers
5454

@@ -72,6 +72,16 @@ The extension runs in two places:
7272
- Edit `tutorialMetadata.json`
7373
- Each section has steps with optional `doc` (markdown) and `code` (Python) files
7474

75+
### 🔔 Pipeline Health Checks
76+
77+
**Workflow**: [`.github/workflows/test-pipelines.yml`](.github/workflows/test-pipelines.yml)
78+
79+
| Trigger | Action | Alert |
80+
| -------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------- |
81+
| Daily @ 09:00 UTC + on push/PR to `main`/`develop` | Run all tutorial pipelines with latest ZenML | On any failure, sends a single message to `#sre-alerts` via `DISCORD_WEBHOOK_SRE` |
82+
83+
This ensures we catch any breaking changes in ZenML or our tutorials before users do.
84+
7585
## 🐳 Docker Image
7686

7787
The user-facing repository uses a pre-built Docker image for faster startup.

0 commit comments

Comments
 (0)