Skip to content

Commit 882371d

Browse files
authored
Jkeller/sudo (#305)
* switched robot and gcs containers back to using root user to avoid permision issues with sensors and ros shared memory * added documentation for droan_gl * switched robot and gcs containers back to using root user to avoid permision issues with sensors and ros shared memory * added documentation for droan_gl
1 parent dc09bb5 commit 882371d

File tree

14 files changed

+89
-120
lines changed

14 files changed

+89
-120
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PROJECT_NAME="airstack"
1111
# If you've run ./airstack.sh setup, then this will auto-generate from the git commit hash every time a change is made
1212
# to a Dockerfile or docker-compose.yaml file. Otherwise this can also be set explicitly to make a release version.
1313
# auto-generated from git commit hash
14-
DOCKER_IMAGE_TAG="0.15.0"
14+
DOCKER_IMAGE_TAG="0.15.1"
1515
# Can replace with your docker hub username
1616
PROJECT_DOCKER_REGISTRY="airlab-docker.andrew.cmu.edu/airstack"
1717
# ============================================

common/ros_packages/rqt_behavior_tree/src/rqt_behavior_tree/py_console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def robot_selection_callback(self, msg):
201201
if msg.data not in self.behavior_tree_graphviz_subs.keys():
202202
def callback(m):
203203
self.robot_graphviz_callback(msg.data, m)
204-
self.behavior_tree_graphviz_subs[msg.data] = self.node.create_subscription(String,
204+
self.behavior_tree_graphviz_subs[msg.data] = self.node.create_subscription(GraphVizXdot,
205205
'/' + msg.data + \
206206
'/behavior/behavior_tree_graphviz',
207207
callback,

gcs/docker/Dockerfile.gcs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,7 @@ RUN mkdir /var/run/sshd && echo 'root:airstack' | chpasswd && \
3434
EXPOSE 22
3535

3636
# TMux config
37-
RUN git clone https://github.com/tmux-plugins/tpm /home/gcs/.tmux/plugins/tpm
38-
39-
40-
WORKDIR /home/gcs/AirStack/gcs/ros_ws
41-
# Make it so that files created within the container reflect the user's UID/GID so they don't have to change file permissions from root. See https://github.com/boxboat/fixuid
42-
# need to give access to docker to access container name
43-
# creates user "gcs" with UID 1000, home directory /home/gcs, and shell /bin/sh
44-
# creates group "gcs" with GID 1000
45-
RUN addgroup --gid 1000 gcs && \
46-
adduser --uid 1000 --ingroup gcs --home /home/gcs --shell /bin/bash --disabled-password --gecos "" gcs && \
47-
chown -R gcs:gcs /home/gcs && \
48-
usermod -aG sudo gcs && \
49-
echo "gcs ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/gcs && \
50-
echo "gcs:gcs" | chpasswd
51-
52-
RUN USER=gcs && \
53-
GROUP=gcs && \
54-
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
55-
chown root:root /usr/local/bin/fixuid && \
56-
chmod 4755 /usr/local/bin/fixuid && \
57-
mkdir -p /etc/fixuid && \
58-
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
37+
RUN git clone https://github.com/tmux-plugins/tpm /root/.tmux/plugins/tpm
5938

6039
RUN wget https://get.foxglove.dev/desktop/latest/foxglove-studio-latest-linux-amd64.deb
6140
RUN apt -o Acquire::AllowInsecureRepositories=true -o Acquire::AllowDowngradeToInsecureRepositories=true update && apt -o APT::Get::AllowUnauthenticated=true install -y ./foxglove-studio-latest-linux-amd64.deb
@@ -64,5 +43,4 @@ RUN apt -o APT::Get::AllowUnauthenticated=true install -y ros-humble-foxglove-br
6443
# Cleanup. Prevent people accidentally doing git commits from within Docker
6544
RUN apt purge git -y && apt autoremove -y && apt clean -y && rm -rf /var/lib/apt/lists/*
6645

67-
USER gcs:gcs
68-
ENTRYPOINT ["fixuid"]
46+
WORKDIR /root/AirStack/gcs/ros_ws

gcs/docker/gcs-base-docker-compose.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ services:
3838
tty: true
3939
volumes:
4040
# display stuff
41-
- $HOME/.Xauthority:/home/gcs/.Xauthority
41+
- $HOME/.Xauthority:/root/.Xauthority
4242
- /tmp/.X11-unix:/tmp/.X11-unix
4343
# developer stuff
44-
- ../../common/.bash_profile:/home/gcs/.bash_profile:rw
45-
- .bashrc:/home/gcs/.bashrc:rw
46-
- ../../common/.tmux.conf:/home/gcs/.tmux.conf:rw
44+
- ../../common/.bash_profile:/root/.bash_profile:rw
45+
- .bashrc:/root/.bashrc:rw
46+
- ../../common/.tmux.conf:/root/.tmux.conf:rw
4747
- ../../common/inputrc:/etc/inputrc:rw
48-
- ../../.devcontainer/gcs/launch.json:/home/gcs/AirStack/.vscode/launch.json:rw
49-
- ../../.devcontainer/gcs/tasks.json:/home/gcs/AirStack/.vscode/tasks.json:rw
50-
- ./Foxglove:/home/gcs/.config/Foxglove:rw
48+
- ../../.devcontainer/gcs/launch.json:/root/AirStack/.vscode/launch.json:rw
49+
- ../../.devcontainer/gcs/tasks.json:/root/AirStack/.vscode/tasks.json:rw
50+
- ./Foxglove:/root/.config/Foxglove:rw
5151
# autonomy stack stuff
52-
- ../..:/home/gcs/AirStack
53-
- ../../common/ros_packages:/home/gcs/AirStack/gcs/ros_ws/src/common:rw # common ROS packages
54-
- ../../common/ros_packages/fastdds.xml:/home/gcs/AirStack/gcs/ros_ws/fastdds.xml:rw # fastdds.xml
52+
- ../..:/root/AirStack
53+
- ../../common/ros_packages:/root/AirStack/gcs/ros_ws/src/common:rw # common ROS packages
54+
- ../../common/ros_packages/fastdds.xml:/root/AirStack/gcs/ros_ws/fastdds.xml:rw # fastdds.xml

gcs/ros_ws/src/gcs_bringup/config/gcs.perspective

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@
110110
"plugin": {
111111
"keys": {
112112
"command_config_filename": {
113-
"repr": "'/home/gcs/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/gui_config.yaml'",
113+
"repr": "'/root/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/gui_config.yaml'",
114114
"type": "repr"
115115
},
116116
"trajectory_config_filename": {
117-
"repr": "'/home/gcs/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/fixed_trajectories.yaml'",
117+
"repr": "'/root/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/fixed_trajectories.yaml'",
118118
"type": "repr"
119119
}
120120
},

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ nav:
9090
- robot/ros_ws/src/autonomy/3_local/b_planners/takeoff_landing_planner/test/README.md
9191
- DROAN (Obstacle Avoidance Planner):
9292
- robot/ros_ws/src/autonomy/3_local/b_planners/droan_local_planner/README.md
93+
- DROAN GL:
94+
- robot/ros_ws/src/autonomy/3_local/b_planners/droan_gl/README.md
9395
- Controls:
9496
- docs/robot/autonomy/3_local/controls/index.md
9597
- robot/ros_ws/src/autonomy/3_local/c_controls/trajectory_controller/README.md

robot/docker/Dockerfile.robot

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -203,55 +203,12 @@ RUN if [ "$SKIP_MACVO" != "true" ]; then pip uninstall matplotlib -y; fi
203203

204204

205205
# TMux config
206-
RUN git clone https://github.com/tmux-plugins/tpm /home/robot/.tmux/plugins/tpm
207-
208-
WORKDIR /home/robot/AirStack/robot/ros_ws
209-
210-
# Make it so that files created within the container reflect the user's UID/GID so they don't have to change file permissions from root. See https://github.com/boxboat/fixuid
211-
# need to give access to docker to access container name
212-
# creates user "robot" with UID 1000, home directory /home/robot, and shell /bin/bash
213-
# creates group "robot" with GID 1000
214-
RUN addgroup --gid 1000 robot && \
215-
adduser --uid 1000 --ingroup robot --home /home/robot --shell /bin/bash --disabled-password --gecos "" robot && \
216-
chown -R robot:robot /home/robot && \
217-
usermod -aG sudo robot && \
218-
echo "robot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/robot && \
219-
echo "robot:robot" | chpasswd
220-
221-
222-
ARG REAL_ROBOT=false
223-
RUN if [ "$REAL_ROBOT" = "true" ]; then \
224-
# Put commands here that should run for the real robot but not the sim
225-
echo "REAL_ROBOT is true"; \
226-
apt-get ${UPDATE_FLAGS} update && apt-get ${INSTALL_FLAGS} install -y libimath-dev; \
227-
groupadd -g 20 dialout; \
228-
usermod -aG dialout robot; \
229-
USER=robot && \
230-
GROUP=robot && \
231-
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-arm64.tar.gz | tar -C /usr/local/bin -xzf - && \
232-
chown root:root /usr/local/bin/fixuid && \
233-
chmod 4755 /usr/local/bin/fixuid && \
234-
mkdir -p /etc/fixuid && \
235-
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml; \
236-
else \
237-
# Put commands here that should be run for the sim but not the real robot
238-
echo "REAL_ROBOT is false"; \
239-
USER=robot && \
240-
GROUP=robot && \
241-
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
242-
chown root:root /usr/local/bin/fixuid && \
243-
chmod 4755 /usr/local/bin/fixuid && \
244-
mkdir -p /etc/fixuid && \
245-
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml; \
246-
fi
247-
206+
RUN git clone https://github.com/tmux-plugins/tpm /root/.tmux/plugins/tpm
248207

208+
WORKDIR /root/AirStack/robot/ros_ws
249209

250210
# Cleanup
251211
RUN apt autoremove -y \
252212
&& apt clean -y \
253213
&& rm -rf /var/lib/apt/lists/*
254214

255-
USER robot:robot
256-
ENTRYPOINT ["fixuid"]
257-

robot/docker/docker-compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services:
1111
file: ./robot-base-docker-compose.yaml
1212
service: robot_base
1313
image: &desktop_image ${PROJECT_DOCKER_REGISTRY}/${PROJECT_NAME}:v${DOCKER_IMAGE_TAG}_robot-x86-64
14-
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
1514
build:
1615
dockerfile: ./Dockerfile.robot
1716
args:

robot/docker/robot-base-docker-compose.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ services:
4848
- $HOME/.Xauthority:/.Xauthority
4949
- /tmp/.X11-unix:/tmp/.X11-unix
5050
# developer stuff
51-
- .dev:/home/robot/.dev:rw # developer config
52-
- ../../common/.bash_profile:/home/robot/.bash_profile:rw
53-
- .bashrc:/home/robot/.bashrc:rw # bash config
51+
- .dev:/root/.dev:rw # developer config
52+
- ../../common/.bash_profile:/root/.bash_profile:rw
53+
- .bashrc:/root/.bashrc:rw # bash config
5454
- ../../common/inputrc:/etc/inputrc:rw # for using page up/down to search through command history
55-
- ../../common/.tmux.conf:/home/robot/.tmux.conf:rw # tmux config
56-
- ../../.devcontainer/robot/launch.json:/home/robot/AirStack/.vscode/launch.json:rw
57-
- ../../.devcontainer/robot/tasks.json:/home/robot/AirStack/.vscode/tasks.json:rw
55+
- ../../common/.tmux.conf:/root/.tmux.conf:rw # tmux config
56+
- ../../.devcontainer/robot/launch.json:/root/AirStack/.vscode/launch.json:rw
57+
- ../../.devcontainer/robot/tasks.json:/root/AirStack/.vscode/tasks.json:rw
5858
# autonomy stack stuff
59-
- ../..:/home/robot/AirStack
60-
- ../../common/ros_packages:/home/robot/AirStack/robot/ros_ws/src/common:rw # common ROS packages
61-
- ../../common/ros_packages/fastdds.xml:/home/robot/AirStack/robot/ros_ws/fastdds.xml:rw # fastdds.xml
59+
- ../..:/root/AirStack
60+
- ../../common/ros_packages:/root/AirStack/robot/ros_ws/src/common:rw # common ROS packages
61+
- ../../common/ros_packages/fastdds.xml:/root/AirStack/robot/ros_ws/fastdds.xml:rw # fastdds.xml
6262

robot/ros_ws/base_link:

Whitespace-only changes.

0 commit comments

Comments
 (0)