-
Notifications
You must be signed in to change notification settings - Fork 683
Expand file tree
/
Copy pathdeploy-to-kind
More file actions
executable file
·46 lines (35 loc) · 1.35 KB
/
deploy-to-kind
File metadata and controls
executable file
·46 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
SRC_DIR=${REPO_ROOT}/modelserving
cd "${SRC_DIR}"
# Pick a probably-unique tag
export TAG=`date +%Y%m%d%H%M%S`
# If we're building for kind, default to only building on cpu
if [[ -z "${ARCHITECTURES:-}" ]]; then
ARCHITECTURES=cpu
export ARCHITECTURES
fi
if [[ -z "${KUBE_CONTEXT:-}" ]]; then
KUBE_CONTEXT=kind-kind
echo "Defaulting to kube context: ${KUBE_CONTEXT}"
fi
# Build the image
echo "Building images"
export IMAGE_PREFIX=fake.registry/
BUILDX_ARGS=--load dev/tasks/build-images
MODEL_IMAGE="${IMAGE_PREFIX:-}llamacpp-gemma3-12b-it-cpu:${TAG}"
RPCSERVER_IMAGE="${IMAGE_PREFIX:-}rpc-server-cpu:${TAG}"
# Load the image into kind
echo "Loading images into kind: ${MODEL_IMAGE}, ${RPCSERVER_IMAGE}"
kind load docker-image ${MODEL_IMAGE} ${RPCSERVER_IMAGE}
# Deploy manifests
echo "Deploying manifests"
cat k8s/llm-server-cpu.yaml | sed s@llamacpp-gemma3-12b-it-cpu:latest@${MODEL_IMAGE}@g | \
kubectl apply --context=${KUBE_CONTEXT} --server-side -f -
cat k8s/rpc-server-cpu.yaml | sed s@rpc-server-cpu:latest@${RPCSERVER_IMAGE}@g | \
kubectl apply --context=${KUBE_CONTEXT} --server-side -f -
cat k8s/llm-server-rpc.yaml | sed s@llamacpp-gemma3-12b-it-cpu:latest@${MODEL_IMAGE}@g | \
kubectl apply --context=${KUBE_CONTEXT} --server-side -f -