Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
WIP deploy tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthelaw committed Oct 2, 2024
1 parent c04ea21 commit 8e4c033
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 1 deletion.
36 changes: 36 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ includes:
- create: ./tasks/create.yaml
- publish: ./tasks/publish.yaml
- setup: ./tasks/setup.yaml
- deploy: ./tasks/deploy.yaml

tasks:
#######
Expand Down Expand Up @@ -89,3 +90,38 @@ tasks:
- task: create:vllm
- task: create:text-embeddings
- task: create:whisper

########
# DEPLOY
########
- name: deploy-all
description: "Deploys all Zarf packages within the LeapfrogAI repository"
actions:
- task: deploy:supabase
- task: deploy:api
- task: deploy:ui
- task: deploy:repeater
- task: deploy:vllm
- task: deploy:llama-cpp-python
- task: deploy:text-embeddings
- task: deploy:whisper

- name: deploy-cpu
description: "Deploys CPU deployment Zarf packages within the LeapfrogAI repository"
actions:
- task: deploy:supabase
- task: deploy:api
- task: deploy:ui
- task: deploy:llama-cpp-python
- task: deploy:text-embeddings
- task: deploy:whisper

- name: deploy-gpu
description: "Deploys GPU deployment Zarf packages within the LeapfrogAI repository"
actions:
- task: deploy:supabase
- task: deploy:api
- task: deploy:ui
- task: deploy:vllm
- task: deploy:text-embeddings
- task: deploy:whisper
7 changes: 6 additions & 1 deletion tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ tasks:
description: "Image repository for the image tag"
required: true
actions:
- cmd: |
printf "\n🐸 Creating image at ${{ .inputs.dockerfile }}\n\n"
- description: "Build the Docker image"
shell:
linux: bash
Expand Down Expand Up @@ -120,6 +122,8 @@ tasks:
description: "Set the version of the Zarf package and target image(s)"
required: true
actions:
- cmd: |
printf "\n🐸 Creating package at ${{ .inputs.path }}\n\n"
- description: "Create the Zarf package"
task: create-common:package
env:
Expand Down Expand Up @@ -151,6 +155,8 @@ tasks:
default: ""
required: false
actions:
- cmd: |
printf "\n🐸 Creating bundle at ${{ .inputs.path }}\n\n"
- description: "Create the UDS bundle"
task: create-common:test-bundle
with:
Expand Down Expand Up @@ -515,7 +521,6 @@ tasks:
with:
path: "packages/vllm"
outputPath: "packages/vllm"
zarfConfig: "packages/vllm/zarf-config.yaml"
flavor: ${FLAVOR}
architecture: ${ARCHITECTURE}
version: ${VERSION}
Expand Down
130 changes: 130 additions & 0 deletions tasks/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/uds-cli/v0.14.0/tasks.schema.json
includes:
#########################
# UDS COMMON TASK IMPORTS
#########################
- deploy-common: https://raw.githubusercontent.com/defenseunicorns/uds-common/82e63be82766a2e550a847af904b2d738c9d3478/tasks/deploy.yaml

tasks:
###########
# REUSEABLE
###########

- name: package
description: "Deploy a Zarf package"
inputs:
path:
description: "Path to the Zarf package to being deployed"
required: true
zarfConfig:
description: "Zarf Config of the Zarf package being deployed"
default: ""
required: false
options:
description: "Extra Zarf package deployment options"
default: "--log-level warn --no-progress --confirm"
required: false
actions:
- cmd: |
printf "\n🐸 Deploying package at ${{ .inputs.path }}\n\n"
- description: Get the current Zarf package name
cmd: cat ${{ .inputs.path }}/zarf.yaml | uds zarf tools yq .metadata.name
setVariables:
- name: PACKAGE_NAME
- description: "Deploy the Zarf package"
env:
- ZARF_CONFIG=${{ .inputs.zarfConfig }}
cmd: |
uds zarf package deploy ${{ .inputs.path }}/zarf-package-${PACKAGE_NAME}-${ARCHITECTURE}-${VERSION}.tar.zst ${{ .inputs.options }}
- name: bundle
description: "Deploy a UDS bundle"
inputs:
path:
description: "Path to the UDS Bundle to being deployed"
required: true
udsConfig:
description: "UDS Config of the UDS Bundle being deployed"
default: ""
required: false
options:
description: "Extra UDS Bundle deployment options"
default: "--log-level warn"
required: false
architecture:
description: "Architecture of the UDS Bundle being created"
required: true
version:
description: "Set the version of the UDS Bundle and target image(s)"
required: true
actions:
- cmd: |
printf "\n🐸 Deploying package at ${{ .inputs.path }}\n\n"
- task: deploy-common:test-bundle
env:
- UDS_ARCH=${{ .inputs.architecture }}
with:
options: ${{ .inputs.options }}
path: ${{ .inputs.path }}

##########
# PACKAGES
##########

- name: api
description: "Deploy the LeapfrogAI API Zarf package"
actions:
- task: package
with:
path: "packages/api"
zarfConfig: "packages/api/zarf-config.yaml"

- name: ui
description: "Deploy the LeapfrogAI API Zarf package"
actions:
- task: package
with:
path: "packages/ui"
zarfConfig: "packages/ui/zarf-config.yaml"

- name: supabase
description: "Deploy the Supabase Zarf package"
actions:
- task: package
with:
path: "packages/supabase"

- name: repeater
description: "Deploy the Repeater Zarf package"
actions:
- task: package
with:
path: "packages/repeater"

- name: vllm
description: "Deploy the vLLM Zarf package"
actions:
- task: package
with:
path: "packages/vllm"

- name: llama-cpp-python
description: "Deploy the LLaMA-CPP-Python Zarf package"
actions:
- task: package
with:
path: "packages/llama-cpp-python"

- name: text-embeddings
description: "Deploy the Text-Embeddings Zarf package"
actions:
- task: package
with:
path: "packages/text-embeddings"

- name: whisper
description: "Deploy the Whisper Zarf package"
actions:
- task: package
with:
path: "packages/whisper"

0 comments on commit 8e4c033

Please sign in to comment.