-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·69 lines (61 loc) · 2.15 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·69 lines (61 loc) · 2.15 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
#!/bin/bash
set -e
# Helper script to start Osprey with different configurations
# Usage:
# ./start.sh # Start with worker directly consuming from Kafka
# ./start.sh --with-coordinator # Start with Osprey Coordinator
# ./start.sh --help # Show this help
show_help() {
echo "Osprey Startup Helper"
echo ""
echo "Usage: ./start.sh [OPTIONS] [COMPOSE_ARGS...]"
echo ""
echo "Options:"
echo " --with-coordinator Start Osprey with Coordinator (workers connect to coordinator)"
echo " --help, -h Show this help message"
echo ""
echo "Examples:"
echo " ./start.sh # Direct Kafka consumption"
echo " ./start.sh --with-coordinator # With coordinator"
echo " ./start.sh --with-coordinator up -d # With coordinator in detached mode"
echo " ./start.sh --with-coordinator --profile test_data up # With test data producer"
echo ""
echo "When using --with-coordinator, the following services are added:"
echo " - osprey-coordinator: Action distribution and load balancing"
echo " - etcd: Service discovery for coordinator"
echo ""
}
USE_COORDINATOR=false
COMPOSE_FILES="-f docker-compose.yaml"
COMPOSE_ARGS=()
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--with-coordinator)
USE_COORDINATOR=true
shift
;;
--help|-h)
show_help
exit 0
;;
*)
# Pass remaining args to docker compose
COMPOSE_ARGS+=("$1")
shift
;;
esac
done
if [ "$USE_COORDINATOR" = true ]; then
echo "Starting Osprey with Coordinator..."
COMPOSE_FILES="$COMPOSE_FILES -f example_docker_compose/run_osprey_with_coordinator/docker-compose.coordinator.yaml"
else
echo "Starting Osprey without Coordinator (direct Kafka consumption)..."
fi
# If no compose args provided, default to 'up'
if [ ${#COMPOSE_ARGS[@]} -eq 0 ]; then
COMPOSE_ARGS=("up")
fi
echo "Running: docker compose $COMPOSE_FILES ${COMPOSE_ARGS[@]}"
echo ""
exec docker compose $COMPOSE_FILES "${COMPOSE_ARGS[@]}"