Skip to content

Commit

Permalink
chore: use custom actions to make workflows more DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
YrrepNoj committed Jul 29, 2024
1 parent d96c607 commit 06f3aa4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 125 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/e2e-llama-cpp-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ jobs:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}



- name: Setup LFAI-API and Supabase
uses: ./.github/actions/lfai-core

Expand Down
50 changes: 9 additions & 41 deletions .github/workflows/e2e-playwright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c #v5.0.0
with:
python-version-file: 'pyproject.toml'

- name: Install Python Deps
run: python -m pip install ".[dev]"

- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
Expand All @@ -75,47 +67,23 @@ jobs:
npm --prefix src/leapfrogai_ui ci
npx --prefix src/leapfrogai_ui playwright install
- name: Setup UDS Environment
uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5
with:
username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

- name: Create UDS Cluster
run: |
uds deploy k3d-core-slim-dev:0.22.2 --confirm
- name: Setup Python
uses: ./.github/actions/python

##########
# Supabase
##########
- name: Deploy Supabase
run: |
make build-supabase LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf tools kubectl create namespace leapfrogai
uds zarf package deploy packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst --confirm
rm packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst
- name: Setup UDS Cluster
uses: ./.github/actions/uds-cluster
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

- name: Set environment variable
id: set-env-var
run: |
echo "ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV"
- name: Setup LFAI-API and Supabase
uses: ./.github/actions/lfai-core

- name: Test Supabase
run: |
python -m pip install requests
python -m pytest ./tests/e2e/test_supabase.py -v
##########
# API
##########
- name: Deploy LFAI-API
run: |
make build-api LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm
rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst
- name: Test API
run: |
python -m pip install requests
Expand Down
50 changes: 7 additions & 43 deletions .github/workflows/e2e-text-embeddings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,48 +61,16 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c #v5.0.0
with:
python-version-file: 'pyproject.toml'

- name: Install Python Deps
run: python -m pip install "."
uses: ./.github/actions/python

- name: Setup UDS Environment
uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5
- name: Setup UDS Cluster
uses: ./.github/actions/uds-cluster
with:
username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

- name: Create UDS Cluster
run: |
uds deploy k3d-core-slim-dev:0.23.0 --confirm
##########
# Supabase
##########
- name: Deploy Supabase
run: |
make build-supabase LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf tools kubectl create namespace leapfrogai
uds zarf package deploy packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst --confirm
rm packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst
- name: Set environment variable
id: set-env-var
run: |
echo "ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV"
##########
# API
##########
- name: Deploy LFAI-API
run: |
make build-api LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm
rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst
- name: Setup LFAI-API and Supabase
uses: ./.github/actions/lfai-core

##########
# text-embeddings
Expand All @@ -117,7 +85,3 @@ jobs:
- name: Test text-embeddings
run: |
python -m pytest ./tests/e2e/test_text_embeddings.py -v
- name: Cleanup text-embeddings
run: |
uds zarf package remove text-embeddings -l=trace --confirm
46 changes: 7 additions & 39 deletions .github/workflows/e2e-whisper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,48 +59,16 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c #v5.0.0
with:
python-version-file: 'pyproject.toml'

- name: Install Python Deps
run: python -m pip install "."
uses: ./.github/actions/python

- name: Setup UDS Environment
uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5
- name: Setup UDS Cluster
uses: ./.github/actions/uds-cluster
with:
username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

- name: Create UDS Cluster
run: |
uds deploy k3d-core-slim-dev:0.22.2 --confirm
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

##########
# Supabase
##########
- name: Deploy Supabase
run: |
make build-supabase LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf tools kubectl create namespace leapfrogai
uds zarf package deploy packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst --confirm
rm packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst
- name: Set environment variable
id: set-env-var
run: |
echo "ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV"
##########
# API
##########
- name: Deploy LFAI-API
run: |
make build-api LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm
rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst
- name: Setup LFAI-API and Supabase
uses: ./.github/actions/lfai-core

##########
# whisper
Expand Down

0 comments on commit 06f3aa4

Please sign in to comment.