Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try out an integration test workflow #516

Merged
merged 5 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this coming from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might make it more obvious, its coming from create-pod.sh

I now see that I didn't commit that folder...


- 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)