Skip to content

Commit

Permalink
Cleaned up Docker pipelines (#121)
Browse files Browse the repository at this point in the history
* Cleaned up Dockerfile and added new user entrypoints

* Fixed robot pipeline to support building for arm64

* Updated devcontainer configurations to use latest changes

* Testing pipelines

* Removed testing branch from pipelines

* Precommit

* Resolved pr comments
  • Loading branch information
evan-palmer authored Oct 12, 2023
1 parent b858303 commit 11807c8
Show file tree
Hide file tree
Showing 13 changed files with 353 additions and 234 deletions.
26 changes: 26 additions & 0 deletions .devcontainer/nouveau/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ghcr.io/robotic-decision-making-lab/blue:rolling-desktop

# Install ROS dependencies
# This is done in a previous stage, but we include it again here in case anyone wants to
# add new dependencies during development
ENV USERNAME=blue
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/blue
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys="gz-transport12 gz-sim7 gz-math7 gz-msgs9 gz-plugin2" \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install debugging/linting Python packages
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
RUN python3 -m pip install -r requirements-dev.txt \
&& rm -rf requirements-dev.txt

# Disable the setuputils installation warning
# This prevents us from needing to pin the setuputils version (which doesn't always work)
ENV PYTHONWARNINGS="ignore"
21 changes: 6 additions & 15 deletions .devcontainer/nouveau/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"dockerFile": "../../.docker/Dockerfile",
"name": "Blue Nouveau Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"build": {
"args": {
"WORKSPACE": "${containerWorkspaceFolder}",
"ROS_DISTRO": "rolling"
},
"target": "develop"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/blue/ws_blue/src/blue",
"remoteUser": "blue",
"runArgs": [
"--network=host",
Expand Down Expand Up @@ -43,12 +39,6 @@
"editor.tabSize": 2,
"xml.format.maxLineWidth": 100,
"json.format.enable": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pydocstyleEnabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"autoDocstring.startOnNewLine": false,
"autoDocstring.docstringFormat": "google-notypes",
"isort.args": ["--profile", "black"],
Expand Down Expand Up @@ -78,7 +68,8 @@
"editor.rulers": [90],
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[dockerfile]": {
"editor.quickSuggestions": {
Expand Down
26 changes: 26 additions & 0 deletions .devcontainer/nvidia/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ghcr.io/robotic-decision-making-lab/blue:rolling-desktop-nvidia

# Install ROS dependencies
# This is done in a previous stage, but we include it again here in case anyone wants to
# add new dependencies during development
ENV USERNAME=blue
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
WORKDIR $USER_WORKSPACE

COPY --chown=$USER_UID:$USER_GID . src/blue
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys="gz-transport12 gz-sim7 gz-math7 gz-msgs9 gz-plugin2" \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install debugging/linting Python packages
COPY --chown=$USER_UID:$USER_GID requirements-dev.txt .
RUN python3 -m pip install -r requirements-dev.txt \
&& rm -rf requirements-dev.txt

# Disable the setuputils installation warning
# This prevents us from needing to pin the setuputils version (which doesn't always work)
ENV PYTHONWARNINGS="ignore"
21 changes: 6 additions & 15 deletions .devcontainer/nvidia/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"dockerFile": "../../.docker/Dockerfile",
"name": "Blue NVIDIA Dev Container",
"dockerFile": "Dockerfile",
"context": "../..",
"build": {
"args": {
"WORKSPACE": "${containerWorkspaceFolder}",
"ROS_DISTRO": "rolling"
},
"target": "develop-nvidia"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
"workspaceFolder": "/home/blue/ws_blue/src/blue",
"remoteUser": "blue",
"runArgs": [
"--network=host",
Expand Down Expand Up @@ -47,12 +43,6 @@
"editor.tabSize": 2,
"xml.format.maxLineWidth": 100,
"json.format.enable": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pydocstyleEnabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"autoDocstring.startOnNewLine": false,
"autoDocstring.docstringFormat": "google-notypes",
"isort.args": ["--profile", "black"],
Expand Down Expand Up @@ -82,7 +72,8 @@
"editor.rulers": [90],
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[dockerfile]": {
"editor.quickSuggestions": {
Expand Down
Loading

0 comments on commit 11807c8

Please sign in to comment.