-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: YouXam <[email protected]>
- Loading branch information
Showing
5 changed files
with
132 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 |
---|---|---|
|
@@ -26,3 +26,5 @@ go.work | |
*.swp | ||
*.swo | ||
*~ | ||
|
||
*.mp4 |
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,96 @@ | ||
Output demo.mp4 | ||
|
||
Set FontSize 36 | ||
Set Width 2400 | ||
Set Height 1000 | ||
Set Shell zsh | ||
Set FontFamily "MesloLGS NF" | ||
Set TypingSpeed 0.1 | ||
|
||
|
||
Hide | ||
Type "source ~/.zshrc" | ||
Enter | ||
Sleep 1s | ||
Type "clear" | ||
Enter | ||
Sleep 1s | ||
Show | ||
|
||
|
||
Type "# There are currently no objects in the cluster." | ||
Enter | ||
Sleep 1s | ||
|
||
Type "kubectl get aimodel,pod,deploy" | ||
Enter | ||
Sleep 4s | ||
|
||
Type "bat demo.yaml" | ||
Enter | ||
Sleep 5s | ||
|
||
Type "# Now create one" | ||
Enter | ||
Sleep 1s | ||
Type "kubectl apply -f demo.yaml" | ||
Enter | ||
Sleep 1s | ||
|
||
Type "# Now there is one AI model with three corresponding pods." | ||
Enter | ||
Sleep 3s | ||
Type "kubectl get aimodel,pod,deploy" | ||
Enter | ||
Sleep 6s | ||
|
||
Type "# Set replicas to 2." | ||
Enter | ||
Sleep 1s | ||
Type "yq eval '.spec.replicas = 2' demo.yaml -i && bat demo.yaml" | ||
Enter | ||
Sleep 3s | ||
|
||
Type "# Now update the ai model" | ||
Enter | ||
Sleep 1s | ||
Type "kubectl apply -f demo.yaml" | ||
Enter | ||
Sleep 1s | ||
|
||
Type "# Now there are 2 pods corresponding to the ai model." | ||
Enter | ||
Sleep 3s | ||
Type "kubectl get aimodel,pod,deploy" | ||
Enter | ||
Sleep 4s | ||
|
||
|
||
Type "# The status of the ai model should be 'Running'." | ||
Enter | ||
Sleep 2s | ||
Type "kubectl get aimodel ai-model-sample -o=jsonpath='{.status}' | jq" | ||
Enter | ||
Sleep 2s | ||
|
||
Type "# Trigger an error" | ||
Enter | ||
Sleep 1s | ||
Type "./trigger.sh ConfigurationError some_error" | ||
Enter | ||
Sleep 3s | ||
|
||
Type "# The status of the ai model should be 'Failed'." | ||
Enter | ||
Sleep 2s | ||
Type "kubectl get aimodel ai-model-sample -o=jsonpath='{.status}' | jq" | ||
Enter | ||
Sleep 2s | ||
|
||
Hide | ||
Type "kubectl delete -f demo.yaml" | ||
Enter | ||
Sleep 2s | ||
Type "yq eval '.spec.replicas = 3' demo.yaml -i" | ||
Enter | ||
Sleep 1s |
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 @@ | ||
apiVersion: model.youxam.com/v1alpha1 | ||
kind: AIModel | ||
metadata: | ||
name: ai-model-sample | ||
spec: | ||
type: local | ||
model: TinyLlama-1.1B | ||
replicas: 3 | ||
image: youxam/uplion-aimodel-operator-test-worker:latest | ||
|
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,11 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ai-model-svc | ||
spec: | ||
selector: | ||
aimodel-internel-selector: ai-model-sample | ||
ports: | ||
- protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 |
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,13 @@ | ||
#!/bin/bash | ||
echo -e "\033[33mTriggering an error...\033[0m" | ||
reason=${1:-"Unknown reason"} | ||
message=${2:-"Unknown message"} | ||
echo -e "\033[31m\t$reason: $message\033[0m" | ||
kubectl apply -f service.yaml > /dev/null | ||
sleep 1 | ||
kubectl port-forward svc/ai-model-svc 9999:8080 > /dev/null & | ||
bg_pid=$! | ||
sleep 0.5 | ||
trap "kill $bg_pid; exit" EXIT | ||
curl -s "http://localhost:9999/?reason=$reason&message=$message" | jq -r '.message + " " + .status' | ||
kubectl delete -f service.yaml > /dev/null |