-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
724 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.vscode | ||
*.pyc | ||
*__pycache__* | ||
*__pycache__* | ||
*.egg-info | ||
.devcontainer/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM osrf/ros:kinetic-desktop-full | ||
|
||
LABEL author="Olivier Lamarre" | ||
LABEL description="Run ENAV dataset utilities" | ||
|
||
# Dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
cython \ | ||
git \ | ||
libeigen3-dev \ | ||
libgdal-dev \ | ||
python-pip \ | ||
python-tk \ | ||
ros-kinetic-grid-map \ | ||
ros-kinetic-interactive-marker-twist-server \ | ||
ros-kinetic-moveit-ros-visualization \ | ||
ros-kinetic-robot-localization \ | ||
tmux \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Catkin workspace & custom package | ||
RUN mkdir -p /root/catkin_ws/src | ||
COPY ./enav_ros /root/catkin_ws/src/enav_ros | ||
|
||
RUN git clone https://github.com/MHarbi/bagedit.git /root/catkin_ws/src/bagedit | ||
RUN cd /root/catkin_ws/src/bagedit && git checkout f97b21050826f65757040750cecc165abd67c0d2 | ||
|
||
RUN . /opt/ros/kinetic/setup.sh && cd /root/catkin_ws && catkin_make | ||
|
||
RUN echo "source /opt/ros/kinetic/setup.bash" >> /root/.bashrc | ||
RUN echo "source /root/catkin_ws/devel/setup.bash" >> /root/.bashrc | ||
|
||
# Python data fetching script | ||
COPY ./enav_utilities /root/enav_utilities | ||
RUN cd /root/enav_utilities && pip install -e . | ||
|
||
# Disable default entrypoint from parent ROS image | ||
ENTRYPOINT [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Docker file dor development purposes with the ENAV project. | ||
# Mounts the repository in a running container, as opposed to copying its | ||
# contents (which is what the deployed version does) | ||
|
||
FROM osrf/ros:kinetic-desktop-full | ||
|
||
LABEL author="Olivier Lamarre" | ||
LABEL description="Development for ENAV dataset utilities" | ||
|
||
# Dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
cython \ | ||
git \ | ||
libeigen3-dev \ | ||
libgdal-dev \ | ||
python-pip \ | ||
python-tk \ | ||
ros-kinetic-grid-map \ | ||
ros-kinetic-interactive-marker-twist-server \ | ||
ros-kinetic-moveit-ros-visualization \ | ||
ros-kinetic-robot-localization \ | ||
tmux \ | ||
vim \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Catkin workspace & custom ROS package | ||
RUN mkdir -p /root/catkin_ws/src | ||
# COPY ./enav_ros /root/catkin_ws/src/enav_ros | ||
|
||
RUN git clone https://github.com/MHarbi/bagedit.git /root/catkin_ws/src/bagedit | ||
RUN cd /root/catkin_ws/src/bagedit && git checkout f97b21050826f65757040750cecc165abd67c0d2 | ||
|
||
RUN . /opt/ros/kinetic/setup.sh && cd /root/catkin_ws && catkin_make | ||
|
||
RUN echo "source /opt/ros/kinetic/setup.bash" >> /root/.bashrc | ||
RUN echo "source /root/catkin_ws/devel/setup.bash" >> /root/.bashrc | ||
|
||
WORKDIR /workspace | ||
|
||
# Disable default entrypoint from parent ROS image | ||
ENTRYPOINT [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
services: | ||
enav: | ||
build: | ||
context: .. # Project root is the build context | ||
dockerfile: dev/Dockerfile.dev | ||
|
||
# X server setup, inspired by https://wiki.ros.org/docker/Tutorials/GUI | ||
environment: | ||
- DISPLAY | ||
- QT_X11_NO_MITSHM=1 | ||
- DEBUG=true | ||
|
||
stdin_open: true # --interactive (-i) flag | ||
tty: true # --tty (-t) flag | ||
|
||
volumes: | ||
- ..:/workspace | ||
- /tmp/.X11-unix:/tmp/.X11-unix:rw # X server | ||
- ${ENAV_DATASET_DIR}:/enav_dataset | ||
|
||
# Build & install mounted project volume (bash keeps the container running) | ||
command: > | ||
bash -c " | ||
ln -s /workspace/enav_ros /root/catkin_ws/src && | ||
cd /root/catkin_ws && source /opt/ros/kinetic/setup.sh && catkin_make && | ||
cd /workspace/enav_utilities && | ||
pip install -e . && | ||
echo 'ENAV utilities mounted & installed, container up & running' && | ||
bash" | ||
# ports: | ||
# - "8000:8000" | ||
# entrypoint: ["bash"] | ||
|
||
# image: olamarre/enav:latest | ||
# container_name: enav | ||
|
||
|
||
# # X server setup, inspired by https://wiki.ros.org/docker/Tutorials/GUI | ||
# environment: | ||
# - DISPLAY | ||
# - QT_X11_NO_MITSHM=1 | ||
|
||
# volumes: | ||
# - /tmp/.X11-unix:/tmp/.X11-unix:rw # X server | ||
# - ${ENAV_DATASET_DIR}:/enav_dataset | ||
# - ./:/dev/enav-planetary-dataset | ||
|
||
# # ports: | ||
# # - 8080:8080 | ||
# command: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# dev workflow | ||
|
||
From repo's root directory: | ||
|
||
1. Create .env file with path to dataset: | ||
|
||
```sh | ||
echo "ENAV_DATASET_DIR='/path/to/dataset/dir'" > .env | ||
``` | ||
|
||
2. Create dev image & start container (-d runs it in the background): | ||
|
||
```sh | ||
docker compose -f dev/docker-compose.dev.yml --env-file .env up -d | ||
``` | ||
|
||
3. Open container in vscode: Bottom left: `Open a Remove Window` > `Attach to a running container` | ||
|
||
Useful container commands: | ||
|
||
```sh | ||
# Check running container name | ||
docker container ls | ||
|
||
# Open the running container in a separate shell | ||
docker container exec -it [name] bash | ||
|
||
# Stop a running container | ||
docker container stop [name] | ||
|
||
# Remove a container | ||
docker container rm [name] | ||
``` | ||
|
||
Useful image commands: | ||
|
||
```sh | ||
# Check image name | ||
docker images | ||
|
||
# Remove image | ||
docker image rm [name] | ||
``` | ||
|
||
## Re-build & push new main image | ||
|
||
1. Remove older images, if any: | ||
|
||
```sh | ||
docker image rm enav | ||
``` | ||
|
||
2. Regenerate a new image: | ||
|
||
```sh | ||
docker build -t enav --no-cache . | ||
``` | ||
|
||
3. Update image name & tag to point to olamarre's dockerhub repo: | ||
|
||
```sh | ||
docker tag enav:latest olamarre/enav:latest | ||
``` | ||
|
||
4. Push changes to dockerhub | ||
|
||
```sh | ||
docker push olamarre/enav | ||
``` | ||
|
||
5. Erase local images & test installation with docker-compose file: | ||
|
||
```sh | ||
docker image rm enav olamarre/enav | ||
|
||
docker compose run --rm enav | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
enav: | ||
image: olamarre/enav:latest | ||
container_name: enav | ||
|
||
stdin_open: true # --interactive (-i) flag | ||
tty: true # --tty (-t) flag | ||
|
||
# X server setup, inspired by https://wiki.ros.org/docker/Tutorials/GUI | ||
environment: | ||
- DISPLAY | ||
- QT_X11_NO_MITSHM=1 | ||
|
||
volumes: | ||
- /tmp/.X11-unix:/tmp/.X11-unix:rw # X server | ||
- ${ENAV_DATASET_DIR}:/enav_dataset | ||
|
||
command: bash # keep the container session open |
Oops, something went wrong.