Skip to content

Commit f55ae39

Browse files
[CI/CD] Functionality test for helm chart (#30)
Signed-off-by: Shaoting Feng <shaotingf@uchicago.edu>
1 parent 3da6238 commit f55ae39

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.github/port-forward.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Ensure the script is run with root privileges
4+
if [[ $EUID -ne 0 ]]; then
5+
echo "This script must be run as root (use sudo)."
6+
exit 1
7+
fi
8+
9+
echo "Waiting for all llmstack pods to be in Running state..."
10+
11+
# Loop to check if all llmstack-related pods are in the Running state
12+
while true; do
13+
# Get all pods containing "vllm" in their name and extract their STATUS column
14+
pod_status=$(sudo kubectl get pods --no-headers | grep "vllm" | awk '{print $3}' | sort | uniq)
15+
pod_ready=$(sudo kubectl get pods --no-headers | grep "vllm" | awk '{print $2}' | sort | uniq)
16+
17+
# If the only unique status is "Running", break the loop and continue
18+
if [[ "$pod_status" == "Running" ]] && [[ "$pod_ready" == "1/1" ]]; then
19+
echo "All llmstack pods are now Ready and in Running state."
20+
break
21+
fi
22+
23+
echo "Not all pods are ready yet. Checking again in 5 seconds..."
24+
sleep 5
25+
done
26+
27+
# Expose router service
28+
sudo kubectl patch service vllm-router-service -p '{"spec":{"type":"NodePort"}}'
29+
ip=$(sudo minikube ip)
30+
port=$(sudo kubectl get svc vllm-router-service -o=jsonpath='{.spec.ports[0].nodePort}')
31+
32+
# Curl and save output
33+
[ ! -d "output" ] && mkdir output
34+
chmod -R 777 output
35+
result_model=$(curl -s http://$ip:$port/models | tee output/models.json)
36+
result_query=$(curl -X POST http://$ip:$port/completions -H "Content-Type: application/json" -d '{"model": "facebook/opt-125m", "prompt": "Once upon a time,", "max_tokens": 10}' | tee output/query.json)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Functionality test for helm chart
2+
run-name: ${{ github.actor }} is testing out helm chart functions 🚀
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/**'
9+
- '**.py'
10+
- 'setup.py'
11+
pull_request:
12+
paths:
13+
- '.github/workflows/**'
14+
- '**.py'
15+
- 'setup.py'
16+
merge_group:
17+
jobs:
18+
Check-Health-of-Cluster:
19+
runs-on: self-hosted
20+
steps:
21+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
22+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
23+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
24+
- name: Check out repository code
25+
uses: actions/checkout@v4
26+
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
27+
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
28+
- name: Deploy via helm charts
29+
run: |
30+
cd ${{ github.workspace }}
31+
sudo helm repo add vllm https://vllm-project.github.io/production-stack
32+
sudo helm install vllm vllm/vllm-stack -f tutorials/assets/values-01-minimal-example.yaml
33+
- name: Validate the installation and send query to the stack
34+
run: |
35+
sudo bash .github/port-forward.sh
36+
- name: Archive functionality results
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: curl-models-query
40+
path: |
41+
output/
42+
- name: Helm uninstall
43+
run: |
44+
sudo helm uninstall vllm
45+
if: always()
46+
- run: echo "🍏 This job's status is ${{ job.status }}."

0 commit comments

Comments
 (0)