diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index e96bf61..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,95 +0,0 @@ -# syntax=docker/dockerfile:1.2 -ARG ROS_DISTRO="rolling" -FROM ros:${ROS_DISTRO}-ros-base AS upstream -# Restate for later use -ARG ROS_DISTRO -RUN rm /ros_entrypoint.sh - -# prevent interactive messages in apt install -ARG DEBIAN_FRONTEND=noninteractive - -# install build dependencies -RUN --mount=type=cache,target=/var/cache/apt,id=apt \ - apt-get update && apt-get upgrade -y --with-new-pkgs \ - && apt-get install -q -y --no-install-recommends \ - build-essential \ - ccache \ - clang-14 \ - clang-format-14 \ - clang-tidy-14 \ - cmake \ - curl \ - git \ - lcov \ - lld \ - ninja-build \ - openssh-client \ - python3-colcon-common-extensions \ - python3-colcon-coveragepy-result \ - python3-colcon-lcov-result \ - python3-colcon-mixin \ - python3-pip \ - python3-pytest \ - python3-pytest-cov \ - python3-pytest-repeat \ - python3-pytest-rerunfailures \ - python3-rosdep \ - python3-setuptools \ - python3-vcstool \ - wget \ - && rosdep update \ - && colcon mixin update default \ - && rm -rf /var/lib/apt/lists/* - -# setup ssh -RUN mkdir /root/.ssh \ - && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts - -# install dependencies of this project -WORKDIR /root/ws -COPY ../ ./src/rsl -RUN --mount=type=cache,target=/var/cache/apt,id=apt \ - . /opt/ros/${ROS_DISTRO}/setup.sh \ - && rosdep update && apt-get update \ - && rosdep install -q -y \ - --from-paths src \ - --ignore-src \ - --rosdistro ${ROS_DISTRO} \ - && rm -rf /var/lib/apt/lists/* -RUN rm -rf /root/ws - -FROM upstream AS devcontainer - -ARG USER=dev -ARG UID=1000 -ARG GID=$UID - -# Setup user home directory -RUN groupadd --gid $GID $USER \ - && useradd --uid $UID --gid $GID -m $USER --groups sudo \ - && echo $USER ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USER \ - && chmod 0440 /etc/sudoers.d/$USER \ - && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/${USER}/.profile \ - && touch /home/${USER}/.bashrc \ - && chown -R ${UID}:${GID} /home/${USER} - -# install pre-commit -RUN python3 -m pip install -U \ - pre-commit - -# install development tooling -RUN --mount=type=cache,target=/var/cache/apt,id=apt \ - apt-get update && apt-get upgrade -y \ - && apt-get install -q -y --no-install-recommends \ - gdb \ - lldb-14 \ - && rm -rf /var/lib/apt/lists/* - -USER $USER -ENV SHELL /bin/bash -ENTRYPOINT [] - -# Setup mixin -WORKDIR /home/${USER}/ws -RUN colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml \ - && colcon mixin update default diff --git a/.devcontainer/README.md b/.devcontainer/README.md deleted file mode 100644 index 19cfd25..0000000 --- a/.devcontainer/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Local Development In Devcontainer - -0. Install docker and add yourself to the docker group. - -```shell -curl -fsSL https://get.docker.com -o get-docker.sh -sudo sh get-docker.sh - -sudo groupadd docker -sudo usermod -aG docker $USER -newgrp docker -``` - -1. Run these commands to create a directory to mount for ccache and another to mount for the ros directory containing log files. - -```bash -mkdir -p ~/.local/.rsl/ccache -mkdir -p ~/.local/.rsl/ros -``` - -2. Open project in VSCode and follow prompts to open project in devcontainer. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 9d214ba..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "Docker Compose", - "dockerComposeFile": [ - "docker-compose.yml" - ], - "remoteEnv": { - "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" - }, - "service": "devcontainer", - "workspaceFolder": "/home/dev/rsl", - "remoteUser": "dev", - "customizations": { - "vscode": { - "extensions": [ - "ms-azuretools.vscode-docker", - "ms-vscode.cmake-tools", - "vadimcn.vscode-lldb", - "ms-vscode.cpptools-extension-pack", - "elagil.pre-commit-helper", - "matepek.vscode-catch2-test-adapter" - ] - } - }, - "features": { - "ghcr.io/devcontainers/features/github-cli:1": { - "version": "latest" - } - } -} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index 5ff4883..0000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3.8' -services: - devcontainer: - build: - context: ../ - dockerfile: .devcontainer/Dockerfile - command: sleep infinity - container_name: dev-rsl - environment: - - DISPLAY=${DISPLAY} - - QT_X11_NO_MITSHM=1 - - ROS_DOMAIN_ID=99 - extra_hosts: - - rsl:127.0.0.1 - hostname: rsl - image: rsl:latest - network_mode: host - privileged: true - user: dev - volumes: - - ../:/home/dev/rsl - - ~/.ssh:/home/dev/.ssh:ro - - ~/.gitconfig:/home/dev/.gitconfig:ro - - ~/.local/.rsl/ccache:/home/dev/.ccache - - ~/.local/.rsl/ros:/home/dev/.ros - - /tmp/.X11-unix:/tmp/.X11-unix:ro - - ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK} - working_dir: /home/rsl diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 881cef4..0000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: docker - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * 0' - push: - paths: - - '.devcontainer/Dockerfile' - - '.github/workflows/docker.yaml' - - 'package.xml' - -jobs: - upstream: - strategy: - matrix: - ros_distro: [humble, rolling] - runs-on: ubuntu-22.04 - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - name: Login to Github Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - file: .devcontainer/Dockerfile - push: true - target: upstream - build-args: ROS_DISTRO=${{ matrix.ros_distro }} - tags: ghcr.io/picknikrobotics/rsl:upstream-${{ matrix.ros_distro }} - cache-from: type=gha - cache-to: type=gha,mode=max