2023-02-07 11:03:59 +00:00
|
|
|
name: Call integration of flagship Apps
|
2023-02-02 22:19:17 +00:00
|
|
|
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
environment:
|
2023-09-25 12:34:41 +00:00
|
|
|
description: "Lightning environment"
|
2023-02-02 22:19:17 +00:00
|
|
|
required: false
|
2023-09-25 12:34:41 +00:00
|
|
|
default: "PROD"
|
2023-02-02 22:19:17 +00:00
|
|
|
type: string
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
environment:
|
2023-09-25 12:34:41 +00:00
|
|
|
description: "Lightning environment"
|
2023-02-02 22:19:17 +00:00
|
|
|
required: true
|
2023-09-25 12:34:41 +00:00
|
|
|
default: "PROD"
|
2023-02-02 22:19:17 +00:00
|
|
|
type: choice
|
|
|
|
options:
|
2023-09-25 12:34:41 +00:00
|
|
|
- PROD
|
|
|
|
- STAGING
|
2023-02-02 22:19:17 +00:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-flagships:
|
|
|
|
if: github.event.pull_request.draft == false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2023-10-02 20:44:10 +00:00
|
|
|
image: mcr.microsoft.com/playwright/python:v1.38.0-focal
|
2023-02-02 22:19:17 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-09-25 12:34:41 +00:00
|
|
|
- { app: "flashy", repo: "Lightning-Universe/Flashy-app" }
|
|
|
|
- { app: "muse", repo: "Lightning-Universe/stable-diffusion-deploy" }
|
|
|
|
- { app: "jupyter", repo: "Lightning-Universe/Jupyter-component" }
|
2023-02-02 22:19:17 +00:00
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# - Training Studio
|
|
|
|
# - Echo
|
|
|
|
# - StreamLit / Gradio
|
|
|
|
# - All homepage & docs apps
|
|
|
|
|
|
|
|
env:
|
2023-09-25 12:34:41 +00:00
|
|
|
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"
|
2023-02-02 22:19:17 +00:00
|
|
|
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
|
|
|
timeout-minutes: 20
|
|
|
|
|
|
|
|
steps:
|
2023-10-03 19:42:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-02 22:19:17 +00:00
|
|
|
|
|
|
|
- name: basic setup
|
2023-10-03 18:40:43 +00:00
|
|
|
timeout-minutes: 20
|
2023-02-02 22:19:17 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p tests/_flagships
|
|
|
|
mkdir -p $VIDEO_LOCATION
|
2023-09-25 17:55:51 +00:00
|
|
|
pip --version
|
|
|
|
pip list
|
|
|
|
# for some reason the python package playwright is missing
|
|
|
|
pip install -r requirements/app/test.txt
|
2023-02-02 22:19:17 +00:00
|
|
|
python -m playwright install # --with-deps
|
|
|
|
|
|
|
|
- name: Clone the Repo/App
|
2023-10-03 19:42:18 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-02-02 22:19:17 +00:00
|
|
|
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
|
2023-10-03 18:40:43 +00:00
|
|
|
timeout-minutes: 20
|
2023-02-02 22:19:17 +00:00
|
|
|
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@v3
|
|
|
|
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()"
|