Skip to content

Commit

Permalink
try out an integration test workflow (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
noyoshi committed Jun 14, 2024
1 parent 9bed4da commit cfc1e19
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: integration-tests
on:
workflow_call:
inputs:
lorax_tag:
required: true
type: string
secrets:
RUNPOD_API_KEY:
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install runpod
run: |
wget -qO- cli.runpod.net | sudo bash
- name: Config runpod cli
run: |
runpodctl config --apiKey ${{ secrets.RUNPOD_API_KEY }}
- uses: actions/setup-python@v4
with:
python-version: 3.x

# Install the client
- run: pip install -e clients/python
- name: create the pod and then delete the pod
run: |
bash tests/create-pod.sh ${{ inputs.lorax_tag }}
- name: Run tests
run: |
POD_ID=`cat pod_name.txt`
python3 tests/test.py $POD_ID
- name: Delete the pod
run: |
POD_ID=`cat pod_name.txt`
runpodctl remove pod $POD_ID
10 changes: 10 additions & 0 deletions tests/create-pod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
IMAGE_NAME="$1"

runpodctl create pods \
--name lorax-tests-new \
--gpuType "NVIDIA A40" \
--imageName "$IMAGE_NAME" \
--containerDiskSize 100 \
--volumeSize 100 \
--ports "8080/http" \
--args "--port 8080 --model-id predibase/Mistral-7B-v0.1-dequantized --adapter-source hub --default-adapter-source pbase --max-batch-prefill-tokens 32768 --max-total-tokens 8192 --max-input-length 8191 --max-concurrent-requests 1024" | awk '{print $2}' > pod_name.txt
9 changes: 9 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from lorax import Client
import sys

pod_id = sys.argv[1]

client = Client(f"https://{pod_id}-8080.proxy.runpod.net")

response = client.generate("hello!", max_new_tokens=10)
print(response)

0 comments on commit cfc1e19

Please sign in to comment.