forked from cnoe-io/ai-platform-engineering
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·73 lines (65 loc) · 2.97 KB
/
deploy.sh
File metadata and controls
executable file
·73 lines (65 loc) · 2.97 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Usage:
# ./deploy.sh - Deploy based on .env settings (detached mode)
# ./deploy.sh --no-detach - Deploy in foreground mode
# ./deploy.sh stop - Stop all services
if [ "$1" = "stop" ]; then
echo "Stopping all services..."
ALL_PROFILES=$(grep -A1 "profiles:" docker-compose.yaml | grep -v "profiles:" | grep -v "^--$" | tr -d ' -' | sort -u | tr '\n' ',' | sed 's/,$//')
if [ -n "$ALL_PROFILES" ]; then
PROFILE_FLAGS=$(echo "$ALL_PROFILES" | sed 's/,/ --profile /g' | sed 's/^/--profile /')
docker compose $PROFILE_FLAGS down --remove-orphans -v
else
docker compose down --remove-orphans -v
fi
# Cleanup any remaining containers from this project
REMAINING=$(docker ps -aq --filter "label=com.docker.compose.project=ai-platform-engineering")
[ -n "$REMAINING" ] && docker rm -f $REMAINING
exit 0
fi
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
PROFILES=""
USE_SLIM=false
[ "${A2A_TRANSPORT:-p2p}" = "slim" ] && PROFILES="slim" && USE_SLIM=true
[ "$ENABLE_AWS" = "true" ] && PROFILES="$PROFILES,aws"
[ "$ENABLE_PETSTORE" = "true" ] && PROFILES="$PROFILES,petstore"
[ "$ENABLE_GITHUB" = "true" ] && PROFILES="$PROFILES,github"
[ "$ENABLE_WEATHER" = "true" ] && PROFILES="$PROFILES,weather"
[ "$ENABLE_BACKSTAGE" = "true" ] && PROFILES="$PROFILES,backstage"
[ "$ENABLE_ARGOCD" = "true" ] && PROFILES="$PROFILES,argocd"
[ "$ENABLE_CONFLUENCE" = "true" ] && PROFILES="$PROFILES,confluence"
[ "$ENABLE_JIRA" = "true" ] && PROFILES="$PROFILES,jira"
[ "$ENABLE_KOMODOR" = "true" ] && PROFILES="$PROFILES,komodor"
[ "$ENABLE_PAGERDUTY" = "true" ] && PROFILES="$PROFILES,pagerduty"
[ "$ENABLE_SLACK" = "true" ] && PROFILES="$PROFILES,slack"
[ "$ENABLE_SPLUNK" = "true" ] && PROFILES="$PROFILES,splunk"
[ "$ENABLE_WEBEX" = "true" ] && PROFILES="$PROFILES,webex"
[ "$ENABLE_AGENT_FORGE" = "true" ] && PROFILES="$PROFILES,agentforge"
[ "$ENABLE_RAG" = "true" ] && PROFILES="$PROFILES,rag"
[ "$ENABLE_GRAPH_RAG" = "true" ] && PROFILES="$PROFILES,rag"
[ "$ENABLE_TRACING" = "true" ] && PROFILES="$PROFILES,tracing"
PROFILES=$(echo "$PROFILES" | sed 's/^,//')
# Deploy SLIM first if needed
if [ "$USE_SLIM" = "true" ]; then
echo "Starting SLIM infrastructure..."
COMPOSE_PROFILES=slim docker compose up -d slim-dataplane slim-control-plane
echo "Waiting for SLIM to be ready..."
sleep 5
fi
# Deploy other services (exclude caipe-supervisor)
OTHER_PROFILES=$(echo "$PROFILES" | sed 's/slim,\?//')
if [ -n "$OTHER_PROFILES" ]; then
echo "Starting supporting services with profiles: $OTHER_PROFILES"
COMPOSE_PROFILES="$OTHER_PROFILES" docker compose up -d --scale caipe-supervisor=0
echo "Waiting for services to be ready..."
sleep 3
fi
# Deploy caipe-supervisor last
echo "Starting caipe-supervisor..."
if [ "$1" = "--no-detach" ] || [ "$1" = "-f" ]; then
COMPOSE_PROFILES="$PROFILES" docker compose up caipe-supervisor
else
COMPOSE_PROFILES="$PROFILES" docker compose up -d caipe-supervisor
fi