-
Notifications
You must be signed in to change notification settings - Fork 5
132 lines (122 loc) · 4.16 KB
/
ci-examples.yaml
File metadata and controls
132 lines (122 loc) · 4.16 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: examples
on:
push:
branches: ["main"]
release:
types:
- created
pull_request:
types: [ opened, reopened, ready_for_review, synchronize ]
jobs:
examples:
name: ${{ matrix.name }} (${{ matrix.auth_mode }})
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
include:
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "guest"
name: "standalone_usage.py"
extra_packages: ""
run: "uv run python examples/standalone_usage.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "user"
name: "standalone_usage.py"
extra_packages: ""
run: "uv run python examples/standalone_usage.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "guest"
name: "file_media_model_usage.py"
extra_packages: ""
run: "uv run python examples/file_media_model_usage.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "user"
name: "file_media_model_usage.py"
extra_packages: ""
run: "uv run python examples/file_media_model_usage.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "guest"
name: "lightning_autoencoder.py"
extra_packages: ""
run: "uv run python examples/lightning_autoencoder.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "user"
name: "lightning_autoencoder.py"
extra_packages: ""
run: "uv run python examples/lightning_autoencoder.py"
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "guest"
name: "complete_workflow"
extra_packages: ""
run: |
uv run python examples/complete_workflow/train.py
uv run python examples/complete_workflow/fetch.py
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "user"
name: "complete_workflow"
extra_packages: ""
run: |
uv run python examples/complete_workflow/train.py
uv run python examples/complete_workflow/fetch.py
- os: "ubuntu-latest"
python-version: "3.10"
auth_mode: "guest"
name: "litserve_inference.py"
extra_packages: "litgpt litserve"
run: |
uv run python -c "import runpy; runpy.run_path('examples/litserve_inference.py', run_name='litserve_example_smoke')"
timeout-minutes: 15
env:
LIGHTNING_CLOUD_URL: https://staging.gridai.dev
UV_TORCH_BACKEND: cpu
steps:
- uses: actions/checkout@v5
- name: Install uv and setup python
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: |
uv sync --group tests
uv pip list
- name: Install example-specific dependencies
if: matrix.extra_packages != ''
run: uv pip install ${{ matrix.extra_packages }}
- name: Enable Guest Mode
if: matrix.auth_mode == 'guest'
shell: bash
run: echo "TEST_GUEST_MODE=1" >> $GITHUB_ENV
- name: Set Auth Credentials
if: matrix.auth_mode == 'user'
shell: bash
run: |
echo "LIGHTNING_USER_ID=${{ secrets.LIGHTNING_STAGING_USER_ID }}" >> $GITHUB_ENV
echo "LIGHTNING_API_KEY=${{ secrets.LIGHTNING_STAGING_API_KEY }}" >> $GITHUB_ENV
- name: Run example
shell: bash
run: ${{ matrix.run }}
guardian-examples:
runs-on: ubuntu-latest
needs: examples
if: always()
steps:
- run: echo "${{ needs.examples.result }}"
- name: failing...
if: needs.examples.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.examples.result)
timeout-minutes: 1
run: sleep 90