You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updated pegasus version, updated docker compose version. Connects robot and px4, but WIP ogn api updates
* Fixed python path in isaac-sim container. Now properly publishes clock and connects to robot for basic flight
* uncommented example script code
* fixing lidar orientation direction in robot description
* updated two_example script as well
* added error message for stale docker compose version
* fixed example script for 2 robots to properly namespace the two different robots
* bump version to 0.16.0 for new Isaac Sim/Pegasus version and on Ubuntu 24
* Update rviz to show lidar
* sync with WIP spawn multirotor node to fix sim-airstack timesync issue
* fixes to visuals for rviz and robot description based on new default sensor positions
* enable proper extension in example script for OnPhysicsStep ogn
* properly does not play scripted environment on start if specified in env file
* Rename ISAAC_SIM_USE_STANDALONE_SCRIPT to ISAAC_SIM_USE_STANDALONE
* Add light to script, add clock display
* Update airstack cli to containerize docker compose itself, so that users don't have to manage different versions
* Bump to docker-compose 5.0.2, also get docker image tag for tagging airstack-cli image
* Fix display forwarding for containerized docker-compose
* Fix env variable propagation in containerized docker-compose
* Small changes
* added environment var to isaac docker compose to properly play sim on start from env file
* temporary fix, airstack with USD file has no wobble; scripted mode still wobbles
* Add ground plane
* update rviz
---------
Co-authored-by: John <John Liu>
Co-authored-by: Andrew Jong <ajong@andrew.cmu.edu>
The `airstack` command-line tool provides a unified interface for common development tasks in the AirStack project, including setup, installation, and container management.
3
+
The `airstack` command-line tool provides a unified interface for common development tasks in the AirStack project, including setup, installation, and container management. It uses a containerized docker-compose approach to ensure all developers use the same version (v5.0.0+) regardless of their host machine's Docker installation.
4
4
5
5
## Installation
6
6
@@ -19,6 +19,18 @@ The `airstack` tool is included in the AirStack repository. To set it up:
19
19
20
20
This will add the `airstack` command to your PATH by modifying your shell profile (`.bashrc` or `.zshrc`).
21
21
22
+
### Requirements
23
+
24
+
**Minimal requirements:**
25
+
- Docker installed (any recent version with socket at `/var/run/docker.sock`)
26
+
- The Docker daemon must be running
27
+
28
+
**NOT required:**
29
+
- Specific docker-compose version on host
30
+
- docker-compose CLI on host (container provides it)
31
+
32
+
**Note:** The `airstack install` command will install Docker Engine and NVIDIA Container Toolkit, but will **not** install docker-compose on the host. Docker Compose runs entirely in the containerized CLI environment.
33
+
22
34
## Basic Usage
23
35
24
36
```bash
@@ -35,67 +47,79 @@ To get help for a specific command:
35
47
airstack help<command>
36
48
```
37
49
50
+
### First Time Setup
51
+
52
+
When you run any airstack command that requires docker-compose for the first time, the CLI container will auto-build:
53
+
```bash
54
+
./airstack.sh up
55
+
```
56
+
57
+
The CLI container includes a pinned version of docker-compose and all necessary tools.
-`setup`: Configure AirStack settings and add to shell profile
42
-
-`up [service]`: Start services using Docker Compose
63
+
-`up [service]`: Start services using containerized Docker Compose
43
64
-`stop [service]`: Stop services
65
+
-`down`: Stop and remove containers
44
66
-`connect [container]`: Connect to a running container (supports partial name matching)
45
67
-`status`: Show status of all containers
46
68
-`logs [container]`: View logs for a container (supports partial name matching)
69
+
-`rebuild-cli`: Rebuild the CLI container with latest docker-compose version
47
70
48
71
### Container Name Matching
49
72
50
73
The `connect` and `logs` commands support partial name matching for container names. This means you can:
51
74
52
-
1. Use just a portion of the container name (e.g., `airstack connect web` will match `airstack_web_1`)
75
+
1. Use just a portion of the container name (e.g., `airstack connect robot` will match `airstack-robot-1`)
53
76
2. If multiple containers match, you'll be shown a list and prompted to select one
54
77
3. The matching is case-insensitive and supports fuzzy matching
55
78
56
79
Example:
57
80
```bash
58
-
$ airstack connect web
59
-
[WARN] Multiple containers match 'web'. Please be more specific or selectfrom the list below:
60
-
NUM CONTAINER NAME IMAGE STATUS
61
-
1 airstack_web_1 nginx:latest Up 2 hours
62
-
2 airstack_webapi_1 node:14 Up 2 hours
81
+
$ airstack connect robot
82
+
[WARN] Multiple containers match 'robot'. Please be more specific or selectfrom the list below:
83
+
NUM CONTAINER NAME STATUS
84
+
1 airstack-robot-1 Up 2 hours
85
+
2 airstack-robot-2 Up 2 hours
63
86
64
87
Options:
65
88
1. Enter a number to selecta container
66
89
2. Type 'q' to quit
67
90
3. Press Ctrl+C to cancel and try again with a more specific name
68
91
69
92
Your selection: 1
70
-
[INFO] Connecting to container: airstack_web_1
71
-
[INFO] Tip: Next time, you can directly use 'airstack connect airstack_web_1'for this container
93
+
[INFO] Connecting to container: airstack-robot-1
94
+
[INFO] Tip: Next time, you can directly use 'airstack connect airstack-robot-1'for this container
72
95
```
73
96
74
-
## Development Commands
97
+
### Environment Variable Overrides
75
98
76
-
- `test`: Run tests
77
-
- `docs`: Build documentation
78
-
- `lint`: Lint code
79
-
- `format`: Format code
99
+
You can override any `.env` variable on the command line:
80
100
81
-
## Extending the Tool
101
+
```bash
102
+
# Override single variable
103
+
ISAAC_SIM_USE_STANDALONE=true ./airstack.sh up isaac-sim robot
82
104
83
-
The `airstack` tool is designed to be easily extensible. You can add new commands by creating module files in the `.airstack/modules/` directory.
105
+
# Override multiple variables
106
+
NUM_ROBOTS=3 AUTOLAUNCH=false ./airstack.sh up
84
107
85
-
### Creating a New Module
108
+
# Works with any .env variable
109
+
DOCKER_IMAGE_TAG=dev-latest ./airstack.sh up
110
+
```
86
111
87
-
1. Create a new `.sh` file in the `.airstack/modules/` directory:
88
-
```bash
89
-
touch .airstack/modules/mymodule.sh
90
-
```
112
+
The wrapper automatically:
113
+
1. Reads all variable names from `.env`
114
+
2. Passes them from your current shell environment into the container
115
+
3. Command-line overrides naturally take precedence
91
116
92
-
2. Add your command functions and register them:
93
-
```bash
94
-
#!/usr/bin/env bash
117
+
## Development Commands
95
118
96
-
# Function to implement your command
97
-
functioncmd_mymodule_mycommand {
98
-
log_info "Running my command..."
119
+
- `test`: Run tests
120
+
- `docs`: Build documentation
121
+
- ```
122
+
log_info "Running my command..."
99
123
# Your command implementation here
100
124
}
101
125
@@ -126,6 +150,216 @@ When creating modules, you can use these helper functions:
126
150
127
151
The `airstack` tool stores its configuration in`~/.airstack.conf`. This file is created when you run `airstack setup`.
128
152
153
+
## lint`: Lint code
154
+
- `format`: Format code
155
+
156
+
## Extending the Tool
157
+
158
+
The `airstack` tool is designed to be easily extensible. You can add new commands by creating module files in the `.airstack/modules/` directory.
159
+
160
+
### Creating a New Module
161
+
162
+
1. Create a new `.sh` file in the `.airstack/modules/` directory:
163
+
```bash
164
+
touch .airstack/modules/mymodule.sh
165
+
```
166
+
167
+
2. Add your command functions and register them:
168
+
```bash
169
+
#!/usr/bin/env bash
170
+
171
+
# Function to implement your command
172
+
functioncmd_mymodule_mycommand {
173
+
Containerized Docker Compose Implementation
174
+
175
+
The AirStack CLI uses a containerized approach for docker-compose to ensure consistency across all development environments.
176
+
177
+
### How It Works
178
+
179
+
The solution uses **Docker socket mounting** (not Docker-in-Docker):
180
+
- The `airstack-cli` container includes a pinned version of docker-compose (v5.0.0+)
181
+
- It mounts the host's Docker socket (`/var/run/docker.sock`)
182
+
- Commands run in the container but control the host's Docker daemon
183
+
- Containers spawned by docker-compose run as siblings on the host, not nested
184
+
185
+
### Key Files
186
+
187
+
1. **Dockerfile.airstack-cli**
188
+
- Defines the containerized CLI environment
189
+
- Pins docker-compose to a specific version
190
+
- Includes bash, curl, git for full functionality
191
+
192
+
2. **airstack.sh**
193
+
- `ensure_cli_container()` - builds CLI image if needed
194
+
- `run_docker_compose()` - wrapper for containerized compose
195
+
- `cmd_rebuild_cli()` - rebuild CLI container with new version
196
+
197
+
3. **.env**
198
+
- Used for docker-compose variable interpolation
199
+
- Automatically mounted into the CLI container with project directory
200
+
201
+
### Customization
202
+
203
+
#### Changing Docker Compose Version
204
+
205
+
Edit `Dockerfile.airstack-cli`:
206
+
207
+
```dockerfile
208
+
ARG COMPOSE_VERSION=5.1.0 # Change this version
209
+
```
210
+
211
+
Then rebuild:
212
+
```bash
213
+
./airstack.sh rebuild-cli
214
+
```
215
+
216
+
#### Adding Tools to the CLI
217
+
218
+
Add packages to the Dockerfile:
219
+
220
+
```dockerfile
221
+
RUN apk add --no-cache \
222
+
bash \
223
+
curl \
224
+
git \
225
+
your-tool-here
226
+
```
227
+
228
+
### Migration from Direct Docker Compose
229
+
230
+
If you have existing containers:
231
+
232
+
1. **No action needed** - containers will continue running
233
+
2. New `up` commands use containerized compose
234
+
3. Existing `docker compose` commands on host still work
235
+
4. The `.env` file works identically
236
+
237
+
### Advanced: How the Wrapper Works
238
+
239
+
The `run_docker_compose()` function:
240
+
241
+
1. **Reads `.env` file** to extract all variable names
242
+
2. **Passes them from current environment** using `-e VARNAME` flags
243
+
3. **Mounts necessary resources** and executes docker-compose
244
+
245
+
```bash
246
+
docker run --rm -i \
247
+
-v /var/run/docker.sock:/var/run/docker.sock \ # Host Docker control
248
+
-v "$PROJECT_ROOT:$PROJECT_ROOT"\ # Mount project
249
+
-v /tmp/.X11-unix:/tmp/.X11-unix \ # X11 socket for GUI
250
+
-w "$PROJECT_ROOT"\ # Set working dir
251
+
-e USER_ID="$(id -u)"\ # Pass user ID
252
+
-e GROUP_ID="$(id -g)"\ # Pass group ID
253
+
-e DISPLAY="$DISPLAY"\ # X11 display for GUI
254
+
-e PROJECT_NAME \ # All .env variables...
255
+
Add packages to the Dockerfile:
256
+
257
+
```dockerfile
258
+
RUN apk add --no-cache \
259
+
bash \
260
+
curl \
261
+
git \
262
+
your-tool-here
263
+
```
264
+
265
+
## Developer Requirements
266
+
267
+
**Minimal requirements:**
268
+
- Docker installed (any recent version with socket at `/var/run/docker.sock`)
269
+
- The Docker daemon must be running
270
+
271
+
**NOT required:**
272
+
- Specific docker-compose version on host
273
+
- docker-compose CLI on host (container provides it)
274
+
275
+
**Note:** The `airstack install`command will install Docker Engine and NVIDIA Container Toolkit, but will **not** install docker-compose on the host. Docker Compose runs entirely in the containerized CLI environment.
276
+
277
+
## Migration from Direct Docker Compose
278
+
279
+
If you have existing containers:
280
+
281
+
1. **No action needed** - containers will continue running
282
+
2. New `up` commands use containerized compose
283
+
3. Existing `docker compose` commands on host still work
0 commit comments