-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try out an integration test workflow (#516)
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |