diff --git a/.github/actions/lfai-core/action.yaml b/.github/actions/lfai-core/action.yaml new file mode 100644 index 0000000000..0c9ae40904 --- /dev/null +++ b/.github/actions/lfai-core/action.yaml @@ -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" diff --git a/.github/actions/python/action.yaml b/.github/actions/python/action.yaml new file mode 100644 index 0000000000..20e4754cfd --- /dev/null +++ b/.github/actions/python/action.yaml @@ -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 diff --git a/.github/actions/uds-cluster/action.yaml b/.github/actions/uds-cluster/action.yaml new file mode 100644 index 0000000000..097db0c7e5 --- /dev/null +++ b/.github/actions/uds-cluster/action.yaml @@ -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 diff --git a/.github/workflows/e2e-llama-cpp-python.yaml b/.github/workflows/e2e-llama-cpp-python.yaml index 12f1e1fac8..4b6dfaba87 100644 --- a/.github/workflows/e2e-llama-cpp-python.yaml +++ b/.github/workflows/e2e-llama-cpp-python.yaml @@ -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 }} + registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + registry1Password: ${{ 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