-
Notifications
You must be signed in to change notification settings - Fork 37
84 lines (73 loc) · 2.54 KB
/
run-notebooks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Run Notebook and Commit Version With Output
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
jobs:
run-notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jupyter nbconvert
- name: Create env file
run: |
echo "${{ secrets.WORKSHOP_ENV }}" > ws.env
- name: Create Aura instance
run: |
source ws.env
python .github/scripts/aura.py configure \
--tenant-id $AURA_TENANT_ID \
--client-id $AURA_CLIENT_ID \
--client-secret $AURA_CLIENT_SECRET \
--region $AURA_REGION \
--cloud-provider $AURA_CLOUD_PROVIDER \
>> ws.env
env:
ENV_FILE: ws.env
- name: Run data loading notebook
run: |
jupyter nbconvert --to notebook --ExecutePreprocessor.timeout=1200 --execute data-load.ipynb
rm data-load.nbconvert.ipynb
env:
ENV_FILE: ws.env
- name: Run and save workshop notebook
run: |
export AUTOMATED_RUN=true
jupyter nbconvert --to notebook --ExecutePreprocessor.timeout=1200 --execute genai-workshop.ipynb
mv genai-workshop.nbconvert.ipynb genai-workshop-w-outputs.ipynb
env:
ENV_FILE: ws.env
- name: Run example-app-only notebook
run: |
export AUTOMATED_RUN=true
jupyter nbconvert --to notebook --ExecutePreprocessor.timeout=1200 --execute genai-example-app-only.ipynb
rm genai-example-app-only.nbconvert.ipynb
env:
ENV_FILE: ws.env
- name: Delete Aura instance
run: |
source ws.env
python .github/scripts/aura.py delete \
--tenant-id $AURA_TENANT_ID \
--client-id $AURA_CLIENT_ID \
--client-secret $AURA_CLIENT_SECRET \
--instance-id $AURA_INSTANCEID
env:
ENV_FILE: ws.env
- name: Commit and push notebook with outputs
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add genai-workshop-w-outputs.ipynb
git commit -m "Auto-commit: Run notebook and update notebook with output file"
git push