Skip to content

Commit

Permalink
chore: experiment with reusable actions for llama e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
YrrepNoj committed Jul 29, 2024
1 parent 28de723 commit 7ef485e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 37 deletions.
20 changes: 20 additions & 0 deletions .github/actions/lfai-core/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: setup-lfai-core
description: "Setup Supabase and LFAI-API"

runs:
using: composite
steps:
- name: Deploy Supabase
shell: bash
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
shell: bash
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"
14 changes: 14 additions & 0 deletions .github/actions/python/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: setup-python
description: "Setup Python and library dependencies"

runs:
using: composite
steps:
- 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]"
shell: bash
22 changes: 22 additions & 0 deletions .github/actions/uds-cluster/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: setup-uds
description: "Setup UDS Cluster"

inputs:
registry1Username:
description: Registry1 Username
registry1Password:
description: Registry1 Password

runs:
using: composite
steps:
- name: Setup UDS Environment
uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5
with:
username: ${{ inputs.registry1Username }}
password: ${{ inputs.registry1Password }}

- name: Create UDS Cluster
shell: bash
run: |
uds deploy k3d-core-slim-dev:0.22.2 --confirm
40 changes: 5 additions & 35 deletions .github/workflows/e2e-llama-cpp-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,48 +59,18 @@ 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

##########
# 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

##########
# llama
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
- 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 }}
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}

########## c
# vLLM
Expand Down

0 comments on commit 7ef485e

Please sign in to comment.