Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible upgrades #535

Merged
merged 7 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/catkin.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container:
image: umrover1/ros:latest
options: --user root
steps:
- uses: actions/checkout@v4
with:
lfs: "true"
# This makes sure that $GITHUB_WORKSPACE is the catkin workspace path
path: "src/mrover"
- name: Ensure Python Requirements
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && pip install -e "$GITHUB_WORKSPACE/src/mrover[dev]"
- name: Style Check
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && cd $GITHUB_WORKSPACE/src/mrover/ && ./style.sh
- name: Update ROS APT
if: github.event.pull_request.draft == false
run: runuser -u mrover -- rosdep update
- name: Ensure ROS APT Requirements
if: github.event.pull_request.draft == false
run: runuser -u mrover -- rosdep install --from-paths "$GITHUB_WORKSPACE/src" --ignore-src -r -y --rosdistro noetic
- name: Copy Catkin Profiles
if: github.event.pull_request.draft == false
run: rsync -r $GITHUB_WORKSPACE/src/mrover/ansible/roles/build/files/profiles $GITHUB_WORKSPACE/.catkin_tools
- name: Initialize
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && catkin init && catkin profile set ci
- name: Build
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && catkin build
- name: Test
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && . $GITHUB_WORKSPACE/devel/setup.sh && catkin test -j1
19 changes: 0 additions & 19 deletions .github/workflows/style.yml

This file was deleted.

31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@ __pycache__/
*.py[cod]
*$py.class
.mypy_cache/
*.egg-info/

# Common IDE's, ideally this should be in global gitignore per user
**/.vscode/
**/.idea/
cmake-build*/
.vscode/
.idea/
/cmake-build*/

#GUI Files
node_modules/
/src/teleop/gui/dist/
/src/teleop/gui/node_modules/
/src/teleop/gui/src/static/map
**/keys.json*
**/yarn.lock*
**/yarn-error.log*
keys.json*
yarn.lock*
yarn-error.log*

# Bag Files
bags/

# Bag Files
bags/
/bags/

# Catkin
build/
devel/
logs/
/build/
/devel/
/logs/

# Moteus
moteus-cal*

# CSV
*.csv
*.csv

# Virtual Environment
/venv/
24 changes: 2 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(mrover VERSION 2024.0 LANGUAGES CXX)
project(mrover VERSION 2024.0.0 LANGUAGES CXX)

## Compile as C++17, supported in ROS Kinetic and newer, enable some static analysis
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -199,26 +199,6 @@ else ()
rosbridge_server
teleop_twist_joy
gazebo_ros
moveit_commander
moveit_core
moveit_fake_controller_manager
moveit_kinematics
moveit_msgs
moveit_planners_chomp
moveit_planners_ompl
moveit_ros_benchmarks
moveit_ros_control_interface
moveit_ros_manipulation
moveit_ros_move_group
moveit_ros_occupancy_map_monitor
moveit_ros_perception
moveit_ros_planning
moveit_ros_planning_interface
moveit_ros_robot_interaction
moveit_ros_visualization
moveit_ros_warehouse
moveit_setup_assistant
moveit_simple_controller_manager
)

# append subdirectories
Expand All @@ -235,7 +215,7 @@ else ()
find_package(OpenCV REQUIRED COMPONENTS core aruco)
find_package(gazebo REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(ZED 2)
find_package(ZED 2 QUIET)
if (ZED_FOUND)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_STANDARD 17)
Expand Down
33 changes: 17 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
FROM ros:noetic

RUN apt-get update && apt-get upgrade -y
# Add apt repo for latest version of Git
RUN apt-get install software-properties-common -y && add-apt-repository ppa:git-core/ppa -y
RUN apt-get update && apt-get install -y \
zsh neovim sudo git git-lfs \
clang-format-12 clang-tidy-12 \
python3-catkin-tools python3-pip
RUN DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y
# DEBIAN_FRONTEND=noninteractive and keyboard-configuration are needed to prevent stdin prompting later on
# This was super annoying to figure out because otherwise the build would hang
# software-properties-common is needed for apt-add-repository
RUN apt-get update -y && apt-get upgrade -y && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common keyboard-configuration -y
RUN apt-add-repository ppa:ansible/ansible -y
RUN apt-add-repository ppa:git-core/ppa -y
RUN apt-get install -y ansible git git-lfs

RUN useradd --create-home --groups sudo --shell /bin/zsh mrover
# Give mrover user sudo access with no password
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER mrover
RUN mkdir -p ~/catkin_ws/src/mrover
RUN mkdir -p /home/mrover/catkin_ws/src/mrover
WORKDIR /home/mrover/catkin_ws/src/mrover
# ROS package manager (rosdep) reads this file to install dependencies
# Defines the APT packages that need to be installed
# rosdep is called from Ansible to install them
ADD ./package.xml .
# Python package manager (pip) reads this file to install dependencies
ADD ./requirements.txt .
# Install ROS packages
RUN rosdep update && rosdep install --from-paths . --ignore-src -y --rosdistro=noetic
# Defines the Python packages that need to be installed
# pip is called from Ansible to install them
ADD ./pyproject.toml .
# Copy over all Ansible files
ADD ./ansible ./ansible
ADD ./ansible.sh .
RUN ./ansible.sh build.yml

USER root
# Remove apt cache to free up space in the image
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Python packags, sudo so it is a global install
RUN pip3 install -r ./requirements.txt

USER mrover
ENTRYPOINT [ "/bin/zsh" ]
4 changes: 2 additions & 2 deletions ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fi

sudo -v # Ensure Ansible has sudo permission

MROVER_PATH=$(dirname "$0")
CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
readonly MROVER_PATH=$(dirname "$0")
readonly CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
ansible-playbook -i "localhost," -c local "${MROVER_PATH}"/ansible/"$1" --extra-vars "catkin_workspace=${CATKIN_WORKSPACE_PATH}"
27 changes: 27 additions & 0 deletions ansible/roles/build/files/profiles/ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_CLANG_TIDY=clang-tidy-16
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: [ ]
licenses:
- TODO
log_space: logs
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: [ ]
28 changes: 14 additions & 14 deletions ansible/roles/build/files/profiles/debug/config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
authors: []
blacklist: []
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: []
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: []
jobs_args: [ ]
licenses:
- TODO
- TODO
log_space: logs
maintainers: []
make_args: []
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []
whitelist: [ ]
28 changes: 14 additions & 14 deletions ansible/roles/build/files/profiles/release/config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
authors: []
blacklist: []
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: []
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-march=native -pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-march=native -pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: []
jobs_args: [ ]
licenses:
- TODO
- TODO
log_space: logs
maintainers: []
make_args: []
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []
whitelist: [ ]
Loading