-
Notifications
You must be signed in to change notification settings - Fork 3.3k
122 lines (109 loc) · 3.94 KB
/
_flagship-apps.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
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
name: Call integration of flagship Apps
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on:
workflow_call:
inputs:
environment:
description: "Lightning environment"
required: false
default: "PROD"
type: string
workflow_dispatch:
inputs:
environment:
description: "Lightning environment"
required: true
default: "PROD"
type: choice
options:
- PROD
- STAGING
defaults:
run:
shell: bash
jobs:
run-flagships:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright/python:v1.38.0-focal
strategy:
fail-fast: false
matrix:
include:
- { app: "flashy", repo: "Lightning-Universe/Flashy-app" }
- { app: "muse", repo: "Lightning-Universe/stable-diffusion-deploy" }
- { app: "jupyter", repo: "Lightning-Universe/Jupyter-component" }
# TODO:
# - Training Studio
# - Echo
# - StreamLit / Gradio
# - All homepage & docs apps
env:
HEADLESS: "1"
PACKAGE_LIGHTNING: "1"
CLOUD: "1"
VIDEO_LOCATION: "./videos"
HAR_LOCATION: "./artifacts/hars"
SLOW_MO: "50"
LIGHTNING_DEBUG: "1"
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: basic setup
timeout-minutes: 20
run: |
mkdir -p tests/_flagships
mkdir -p $VIDEO_LOCATION
pip --version
pip list
# for some reason the python package playwright is missing
pip install -r requirements/app/test.txt
python -m playwright install # --with-deps
- name: Clone the Repo/App
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
path: tests/_flagship-app
- name: Adjust env. for this App
uses: ./.github/actions/prep-apps
with:
name: ${{ matrix.app }}
- name: Install Lightning package
timeout-minutes: 20
run: pip install -e .[cloud,test] -f $TORCH_URL
- name: List pip dependency
run: pip --version && pip list
- name: Run the tests
working-directory: tests/
env:
LIGHTNING_USER_ID: ${{ secrets[format('LIGHTNING_USER_ID_{0}', inputs.environment)] }}
LIGHTNING_API_KEY: ${{ secrets[format('LIGHTNING_API_KEY_{0}', inputs.environment)] }}
LIGHTNING_USERNAME: ${{ secrets[format('LIGHTNING_USERNAME_{0}', inputs.environment)] }}
LIGHTNING_CLOUD_URL: ${{ secrets[format('LIGHTNING_CLOUD_URL_{0}', inputs.environment)] }}
LAI_USER: ${{ secrets.LAI_SSH_USER }}
LAI_PASS: ${{ secrets.LAI_SSH_PASS }}
run: |
ls -l _flagship-app
python -m pytest integrations_app/flagship/test_${{ matrix.app }}.py \
--capture=no -v --color=yes
- name: Upload recordings
uses: actions/upload-artifact@v4
if: failure()
with:
name: flahship-app-${{ matrix.app }}
path: ${{ env.VIDEO_LOCATION }}
- name: Clean Previous Apps
if: always()
timeout-minutes: 3
env:
LIGHTNING_USER_ID: ${{ secrets[format('LIGHTNING_USER_ID_{0}', inputs.environment)] }}
LIGHTNING_API_KEY: ${{ secrets[format('LIGHTNING_API_KEY_{0}', inputs.environment)] }}
LIGHTNING_USERNAME: ${{ secrets[format('LIGHTNING_USERNAME_{0}', inputs.environment)] }}
LIGHTNING_CLOUD_URL: ${{ secrets[format('LIGHTNING_CLOUD_URL_{0}', inputs.environment)] }}
LAI_USER: ${{ secrets.LAI_SSH_USER }}
LAI_PASS: ${{ secrets.LAI_SSH_PASS }}
run: |
time python -c "from lightning.app import testing; testing.delete_cloud_lightning_apps()"