1+ #! /usr/bin/env bash
2+
3+ ./dev_apptainer.sh
4+
5+ if [ ! -e " mongodb.sif" ]; then
6+ apptainer build mongodb.sif docker://mongo:4.4.15
7+ fi
8+
9+ if [ ! -e " api_overlay.img" ]; then
10+ apptainer overlay create api_overlay.img
11+ fi
12+
13+ # Maybe not needed?
14+ # Does the handler create data else where than tmp?
15+ if [ ! -e " handler_overlay.img" ]; then
16+ apptainer overlay create handler_overlay.img
17+ fi
18+
19+ if [ ! -e " mongo_overlay.img" ]; then
20+ apptainer overlay create mongo_overlay.img
21+ fi
22+
23+ # Start MongoDB container
24+ echo " Starting MongoDB container..."
25+ apptainer instance run --hostname mongodb --overlay mongo_overlay.img mongodb.sif mongodb ./start_mongodb.sh
26+
27+ # Wait for MongoDB to be ready
28+ echo " Waiting for MongoDB to be ready..."
29+ sleep 10 # Adjust this based on your needs (or add a health check here)
30+
31+ # Start the API container
32+ echo " Starting API container..."
33+ apptainer instance run --overlay api_overlay.img --no-mount /etc/hosts --bind mongo_host:/etc/hosts api.sif api ./start_api.sh
34+
35+ # Wait for API to be ready
36+ echo " Waiting for API to be ready..."
37+ sleep 5 # Adjust based on your setup
38+
39+ # Start the Handler container
40+ echo " Starting Handler container..."
41+ apptainer instance run --overlay handler_overlay.img --no-mount /etc/hosts --bind mongo_host:/etc/hosts handler.sif handler ./start_handler.sh
42+
43+ # Wait for Handler to be ready (optional)
44+ echo " Waiting for Handler to be ready..."
45+ sleep 5 # Adjust as needed
46+
47+ # Start the UI container
48+ echo " Starting UI container..."
49+ apptainer instance run --env " VITE_APIHOST=http://localhost:8082" ui.sif ui ./start_ui.sh
50+
51+ # Start Telemetry container (if in development profile)
52+ if [ " $PROFILE " == " development" ]; then
53+ echo " Starting Telemetry container..."
54+ apptainer instance run telemetry.sif telementry ./start_telementry.sh
55+ fi
56+
57+ # Inform user that containers are running
58+ echo " All containers are running"
0 commit comments