Skip to content

Commit f08329f

Browse files
committed
Add AUTOLAUNCH option to airstack up
1 parent c8b3c7e commit f08329f

6 files changed

Lines changed: 32 additions & 47 deletions

File tree

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ DOCKER_IMAGE_TAG="8b5529e"
1414
PROJECT_DOCKER_REGISTRY="airlab-storage.andrew.cmu.edu:5001/shared"
1515
# ============================================
1616

17+
# ================= Common ===================
18+
AUTOLAUNCH="true" # If false, the docker-compose will automatically just spawn containers with no launch command.
19+
1720
# ================ SIMULATION =================
1821
ISAAC_SIM_SCENE="omniverse://airlab-storage.andrew.cmu.edu:8443/Projects/AirStack/AFCA/fire_academy_faro_with_sky.scene.usd"
1922
PLAY_SIM_ON_START="true"

docs/development/airstack-cli/docker_usage.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,20 @@ To change the Isaac Sim scene:
195195
ISAAC_SIM_SCENE=path/to/your_scene.usd airstack up
196196
```
197197

198+
To disable autolaunching the stack and simply spawn idle docker containers (useful for debugging):
199+
```bash
200+
AUTOLAUNCH=false airstack up
201+
```
202+
198203
A list of all available environment variables is in the default `.env` file in the project root directory, which allows specifying all the variables in one place.
199204
When no `--env-file` argument is passed to `docker compose`, it automatically uses this default `.env` file.
200205

201-
The top-level env file is reproduced below:
206+
The default `.env` file is reproduced below:
202207
```bash
203208
--8<-- ".env"
204209
```
205210

206211
To override the default `.env` file, you can pass the `--env-file` argument with the syntax `airstack --env-file [env_file] up` (or `docker compose --env-file [env_file] up -d`).
207212

208-
Multiple `--env-file` arguments can be passed to compose overriding sets of variables.env` file.
209-
When overriding, the default `.env` file must be loaded first. The overrides are applied on top of it.
210-
211-
212-
213+
Multiple `--env-file` arguments can be passed to compose overriding sets of `variables.env` files.
214+
All subsequent `--env-file` arguments override the previous ones, allowing you to layer configurations.

ground_control_station/docker/docker-compose.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ services:
1111
ports:
1212
- 2222:22 # for ssh
1313

14-
# -------------------------------------------------------------------------------------------------------------------
15-
# dev container for developer debugging
16-
gcs-dev:
17-
profiles: !override
18-
- dev
19-
extends: gcs
20-
command: "sleep infinity"
21-
2214
# ===================================================================================================================
2315
# for running on a real world laptop on the local network, set network mode to host
2416
gcs-real:

ground_control_station/docker/ground-control-station-base-docker-compose.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ services:
1010
entrypoint: ""
1111
command: >
1212
bash -c "ssh service restart;
13-
tmux new -d -s gcs_bringup
14-
&& tmux send-keys -t gcs_bringup
15-
'bws && sws; ros2 launch ${GCS_LAUNCH_PACKAGE} ${GCS_LAUNCH_FILE}' ENTER
16-
&& sleep infinity"
13+
tmux new -d -s gcs_bringup;
14+
autolaunch=${AUTOLAUNCH};
15+
if [ $$autolaunch = 'true' ]; then
16+
tmux send-keys -t gcs_bringup 'bws && sws; ros2 launch ${GCS_LAUNCH_PACKAGE} ${GCS_LAUNCH_FILE}' ENTER
17+
fi;
18+
sleep infinity"
1719
# Interactive shell
1820
stdin_open: true # docker run -i
1921
tty: true # docker run -t

robot/docker/docker-compose.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ services:
1919
- *desktop_image
2020
# we use tmux send-keys so that the session stays alive
2121
command: >
22-
bash -c "service ssh restart;
23-
tmux new -d -s robot_bringup
24-
&& tmux send-keys -t robot_bringup
25-
'bws && sws &&
26-
ros2 launch ${ROBOT_LAUNCH_PACKAGE} ${ROBOT_LAUNCH_FILE}' ENTER
27-
&& sleep infinity"
22+
bash -c "
23+
service ssh restart;
24+
tmux new -d -s robot_bringup;
25+
autolaunch=${AUTOLAUNCH};
26+
if [ $$autolaunch = 'true' ]; then
27+
tmux send-keys -t robot_bringup 'bws && sws && ros2 launch ${ROBOT_LAUNCH_PACKAGE} ${ROBOT_LAUNCH_FILE}' ENTER;
28+
fi;
29+
sleep infinity"
2830
# assumes you're connected to work internet, so creates a network to isolate from other developers on your work internet
2931
networks:
3032
- airstack_network
@@ -36,14 +38,6 @@ services:
3638
deploy:
3739
replicas: ${NUM_ROBOTS:-1}
3840

39-
# -------------------------------------------------------------------------------------------------------------------
40-
# dev container for developer debugging
41-
robot-dev:
42-
profiles: !override
43-
- "dev"
44-
extends: robot
45-
command: sleep infinity
46-
4741
# ===================================================================================================================
4842
# for running on an NVIIDA jetson (linux for tegra) device
4943
robot-l4t:

simulation/isaac-sim/docker/docker-compose.yaml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ services:
1313
entrypoint: "" # override the default entrypoint with nothing
1414
# for some reason the tmux session manager only works when isaac is running in tmux
1515
command: >
16-
bash -c "tmux new -d -s isaac
17-
&& tmux send-keys -t isaac \"ros2 launch isaacsim run_isaacsim.launch.py gui:=${ISAAC_SIM_SCENE} play_sim_on_start:=${PLAY_SIM_ON_START}\" ENTER
18-
&& sleep infinity"
16+
bash -c "
17+
tmux new -d -s isaac
18+
autolaunch=${AUTOLAUNCH};
19+
if [ $$autolaunch = 'true' ]; then
20+
tmux send-keys -t isaac \"ros2 launch isaacsim run_isaacsim.launch.py gui:=${ISAAC_SIM_SCENE} play_sim_on_start:=${PLAY_SIM_ON_START}\" ENTER
21+
fi;
22+
sleep infinity"
1923
# Interactive shell
2024
stdin_open: true # docker run -i
2125
tty: true # docker run -t
@@ -68,18 +72,6 @@ services:
6872
- ../sitl_integration/inputrc:/etc/inputrc
6973
- ../sitl_integration/config:/root/.nvidia-omniverse/config:rw
7074

71-
# -------------------------------------------------------------------------------------------------------------------
72-
# dev container for developer debugging
73-
isaac-sim-dev:
74-
profiles: !override
75-
- dev
76-
extends: isaac-sim
77-
container_name: isaac-sim-dev
78-
command: >
79-
bash -c "tmux new -d -s isaac
80-
&& tmux send-keys -t isaac \"ros2 launch isaacsim run_isaacsim.launch.py\" ENTER
81-
&& sleep infinity"
82-
8375
# ===================================================================================================================
8476
# for running over ethernet for hitl to stream to the NVIDIA jetson device
8577
isaac-sim-hitl:

0 commit comments

Comments
 (0)