-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
137 additions
and
19 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
8 changes: 5 additions & 3 deletions
8
.github/workflows/integration.yml → .github/workflows/integration-tests.yml
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
name: Integration tests | ||
run-name: ${{ github.actor }} triggered integration tests 🚀 | ||
on: [pull_request] | ||
on: | ||
pull_request: | ||
merge_group: | ||
jobs: | ||
unit-tests: | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- run: make test | ||
- run: make test-integration |
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,20 @@ | ||
name: System tests | ||
run-name: ${{ github.actor }} triggered integration tests 🚀 | ||
on: | ||
push: | ||
branches: | ||
# Must run after docker images are built and pushed. | ||
# Should run before a release. | ||
- main | ||
workflow_run: | ||
workflows: [Run Tests] | ||
types: | ||
- completed | ||
jobs: | ||
system-tests: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- run: make test-system |
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
File renamed without changes.
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
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,4 @@ | ||
# System Tests | ||
|
||
System tests create a cluster, install Substratus (using pushed container images), and runs kubectl commands to test the system as a whole from the outside. | ||
|
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,7 @@ | ||
resources: | ||
- ../../../config/install-kind/ | ||
images: | ||
- name: docker.io/substratusai/sci-kind | ||
newTag: main | ||
- name: docker.io/substratusai/controller-manager | ||
newTag: main |
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,73 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
cloud=$1 | ||
repo=$(git rev-parse --show-toplevel) | ||
example="facebook-opt-125m" | ||
|
||
if [[ -z "$cloud" ]]; then | ||
echo "Must provide <cloud> arg" | ||
exit 1 | ||
fi | ||
|
||
echo "Running test for cloud: $cloud" | ||
|
||
function down { | ||
if [ "${DOWN}" == "no" ]; then | ||
echo "Skipping DOWN..." | ||
else | ||
echo "Running DOWN..." | ||
./install/${cloud}/down.sh | ||
fi | ||
} | ||
trap down EXIT | ||
|
||
if [ "${UP}" == "no" ]; then | ||
echo "Skipping UP..." | ||
else | ||
./install/${cloud}/up.sh | ||
fi | ||
|
||
kubectl get events -A -w & | ||
|
||
# Install Substratus | ||
kubectl apply -k ${repo}/test/install/${cloud} | ||
|
||
# Import a Model | ||
kubectl apply -f ${repo}/examples/${example}/base-model.yaml | ||
|
||
# Serve the Model | ||
kubectl apply -f ${repo}/examples/${example}/base-server.yaml | ||
|
||
# Wait until both are ready | ||
# TODO: Consider adding common "Ready" condition to make this check easier. | ||
kubectl wait --for=condition=modelled models --all --timeout 720s | ||
kubectl wait --for=condition=deployed servers --all --timeout 720s | ||
|
||
# Forward ports to localhost | ||
kubectl port-forward service/$example-server 8080:8080 & | ||
port_forward_pid=$! | ||
|
||
function stop_port_forward { | ||
kill $port_forward_pid | ||
# Allow for the port-forward to stop | ||
sleep 1 | ||
# Trap will only call 1 function, so we must call the previous trap function | ||
down | ||
} | ||
trap stop_port_forward EXIT | ||
|
||
# Wait for port-forward to be ready (client-side) | ||
sleep 3 | ||
|
||
# Send example request | ||
curl http://localhost:8080/v1/completions \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ \ | ||
"prompt": "What is your favorite color? ", \ | ||
"max_tokens": 3\ | ||
}' | ||
|
||
kill $port_forward_pid |