Skip to content

Commit

Permalink
Bugfix: configurable deployment options (#121)
Browse files Browse the repository at this point in the history
* feat: adjustable deployment strategy

Signed-off-by: BrianPark314 <[email protected]>
  • Loading branch information
BrianPark314 authored Feb 17, 2025
1 parent 93ad1cd commit aec9264
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/curl-02-two-pods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Curl and save output
[ ! -d "output-02-two-pods" ] && mkdir output-02-two-pods
chmod -R 777 output-02-two-pods
# shellcheck disable=SC2034 # result_model appears unused. Verify it or export it.
result_model=$(curl -s http://"$1":"$2"/models | tee output-02-two-pods/output-02-two-pods.json)
# shellcheck disable=SC2034 # result_query appears unused. Verify it or export it.
result_query=$(curl -X POST http://"$1":"$2"/completions -H "Content-Type: application/json" -d '{"model": "facebook/opt-125m", "prompt": "Once upon a time,", "max_tokens": 10}' | tee output-02-two-pods/output-02-two-pods.json)
30 changes: 30 additions & 0 deletions .github/workflows/functionality-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,36 @@ jobs:
if: always()
- run: echo "🍏 This job's status is ${{ job.status }}."

Two-Pods-Minimal-Example:
runs-on: self-hosted
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Deploy via helm charts
run: |
cd ${{ github.workspace }}
sudo helm install vllm ./helm -f tutorials/assets/values-01-2pods-minimal-example.yaml
- name: Validate the installation and send query to the stack
run: |
sudo bash .github/port-forward.sh curl-02-two-pods
timeout-minutes: 2
- name: Archive functionality results
uses: actions/upload-artifact@v4
with:
name: output-02-two-pods
path: |
output-02-two-pods/
- name: Helm uninstall
run: |
sudo helm uninstall vllm
if: always()
- run: echo "🍏 This job's status is ${{ job.status }}."

Multiple-Models:
runs-on: self-hosted
needs: Minimal-Example
Expand Down
8 changes: 4 additions & 4 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ If .Values.engineStrategy is defined, use it.
Otherwise, fall back to the default rolling update strategy.
*/}}
{{- define "chart.engineStrategy" -}}
strategy:
{{- if .Values.servingEngineSpec.strategy }}
{{ toYaml .Values.servingEngineSpec.strategy | nindent 2 }}
{{- toYaml .Values.servingEngineSpec.strategy | nindent 2 }}
{{- else }}
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
Expand All @@ -52,10 +52,10 @@ If .Values.routerStrategy is defined, use it.
Otherwise, fall back to the default rolling update strategy.
*/}}
{{- define "chart.routerStrategy" -}}
strategy:
{{- if .Values.routerSpec.strategy }}
{{ toYaml .Values.routerSpec.strategy | nindent 2 }}
{{- toYaml .Values.routerSpec.strategy | nindent 2 }}
{{- else }}
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
Expand Down
2 changes: 2 additions & 0 deletions tutorials/assets/values-01-2pods-minimal-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
servingEngineSpec:
strategy:
type: Recreate
runtimeClassName: ""
modelSpec:
- name: "opt125m"
Expand Down

0 comments on commit aec9264

Please sign in to comment.