-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-and-deploy.sh
More file actions
executable file
·51 lines (45 loc) · 1.54 KB
/
build-and-deploy.sh
File metadata and controls
executable file
·51 lines (45 loc) · 1.54 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
47
48
49
50
51
#!/bin/bash
# Build and deploy Thread Flare debug container with variant support
set -e
IMAGE_NAME="thread-flare"
TAG="latest"
VARIANT="${1:-slim}" # Default to slim, accept slim/cuda as argument
case "$VARIANT" in
"slim")
DOCKERFILE="Dockerfile.slim"
FULL_IMAGE_NAME="${IMAGE_NAME}-slim:${TAG}"
echo "Building Thread Flare SLIM container (CPU-only)..."
;;
"cuda")
DOCKERFILE="Dockerfile.cuda"
FULL_IMAGE_NAME="${IMAGE_NAME}-cuda:${TAG}"
echo "Building Thread Flare CUDA container (GPU-enabled)..."
;;
*)
echo "Usage: $0 [slim|cuda]"
echo " slim: CPU-only container (default)"
echo " cuda: GPU-enabled container with CUDA support"
exit 1
;;
esac
docker build -f ${DOCKERFILE} -t ${FULL_IMAGE_NAME} .
echo "Thread Flare container built successfully!"
echo "Image: ${FULL_IMAGE_NAME}"
echo "Dockerfile: ${DOCKERFILE}"
echo ""
echo "To deploy to Kubernetes:"
echo "1. Update pod.yaml image to: ${FULL_IMAGE_NAME}"
echo "2. Apply pod: kubectl apply -f pod.yaml"
echo "3. Wait for ready: kubectl wait --for=condition=Ready pod/thread-flare --timeout=300s"
echo "4. View logs: kubectl logs -f pod/thread-flare"
echo ""
echo "To run locally:"
if [[ "$VARIANT" == "cuda" ]]; then
echo "docker run --gpus all --rm -it ${FULL_IMAGE_NAME}"
else
echo "docker run --rm -it ${FULL_IMAGE_NAME}"
fi
echo ""
echo "Available variants:"
echo " ./build-and-deploy.sh slim # CPU-only, smaller image"
echo " ./build-and-deploy.sh cuda # GPU-enabled, larger image"