Skip to content
Snippets Groups Projects
Commit d6a32fcc authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

Update dockerfiles and dotfiles

parent ea18193c
No related branches found
No related tags found
No related merge requests found
Showing
with 388 additions and 213 deletions
File moved
FROM osrf/ros:melodic-desktop-full
ENV ROS_DISTRO melodic
ENV RUNNING_IN_DOCKER true
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
......@@ -15,33 +13,30 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Configure apt and install packages
RUN apt-get -y install --no-install-recommends \
RUN apt-get update && apt-get -y install --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common \
curl \
gnupg-agent \
software-properties-common \
apt-utils dialog 2>&1 \
# Verify if git, process tools, lsb-release (common in install instructions for CLIs) are installed
# Install the https transport support package for The Artifactory debian repository
git \
git-lfs \
nano \
less \
iproute2 \
procps \
lsb-release \
curl \
cmake \
openssh-client \
python-pip \
python-catkin-tools \
python-osrf-pycommon \
libclang-dev \
cppcheck \
lcov \
iwyu \
clang-format \
direnv \
xterm \
terminator \
zsh \
&& rm -rf /var/lib/apt/lists/*
#
ros-${ROS_DISTRO}-catkin \
ros-${ROS_DISTRO}-rosmon \
python-catkin-tools \
python-numpy \
python-osrf-pycommon \
ipython
# Install docker-ce
#RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
......@@ -64,109 +59,92 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7E72C5B411
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
# Ros WS dependencies
RUN apt-get update && apt-get install -y \
ros-melodic-ros-control-boilerplate \
ros-melodic-ur-msgs \
ros-melodic-eigen-stl-containers \
ros-melodic-industrial-robot-simulator \
ros-melodic-srdfdom \
ros-melodic-joint-state-publisher-gui \
ros-${ROS_DISTRO}-rosmon \
python-pyside \
ros-${ROS_DISTRO}-abb-driver \
ros-${ROS_DISTRO}-ackermann-msgs \
ros-${ROS_DISTRO}-amcl \
ros-${ROS_DISTRO}-ar-track-alvar \
ros-${ROS_DISTRO}-ar-track-alvar-msgs \
ros-${ROS_DISTRO}-catkin-virtualenv \
ros-${ROS_DISTRO}-effort-controllers \
ros-${ROS_DISTRO}-eigen-conversions \
ros-${ROS_DISTRO}-eigen-stl-containers \
ros-${ROS_DISTRO}-executive-smach-visualization \
ros-${ROS_DISTRO}-force-torque-sensor-controller \
ros-${ROS_DISTRO}-gmapping \
ros-${ROS_DISTRO}-hector-gazebo-plugins \
ros-${ROS_DISTRO}-hector-mapping \
ros-${ROS_DISTRO}-image-view \
ros-${ROS_DISTRO}-imu-complementary-filter \
ros-${ROS_DISTRO}-imu-tools \
ros-${ROS_DISTRO}-industrial-core \
ros-${ROS_DISTRO}-industrial-robot-simulator \
ros-${ROS_DISTRO}-interactive-marker-twist-server \
ros-${ROS_DISTRO}-joint-state-publisher-gui \
ros-${ROS_DISTRO}-joint-trajectory-controller \
ros-${ROS_DISTRO}-joy \
ros-${ROS_DISTRO}-lms1xx \
ros-${ROS_DISTRO}-map-server \
ros-${ROS_DISTRO}-mavros-msgs \
ros-${ROS_DISTRO}-move-base \
ros-${ROS_DISTRO}-moveit \
ros-${ROS_DISTRO}-moveit-opw-kinematics-plugin \
ros-${ROS_DISTRO}-moveit-resources \
ros-${ROS_DISTRO}-moveit-visual-tools \
ros-${ROS_DISTRO}-navigation \
ros-${ROS_DISTRO}-realsense2-camera \
ros-${ROS_DISTRO}-robot-localization \
ros-${ROS_DISTRO}-ros-control \
ros-${ROS_DISTRO}-ros-control-boilerplate \
ros-${ROS_DISTRO}-ros-controllers \
ros-${ROS_DISTRO}-rosbridge-server \
ros-${ROS_DISTRO}-rqt-controller-manager \
ros-${ROS_DISTRO}-rqt-joint-trajectory-controller \
ros-${ROS_DISTRO}-rviz-visual-tools \
ros-${ROS_DISTRO}-serial \
ros-${ROS_DISTRO}-spacenav-node \
ros-${ROS_DISTRO}-srdfdom \
ros-${ROS_DISTRO}-swri-profiler \
ros-${ROS_DISTRO}-teb-local-planner \
ros-${ROS_DISTRO}-trac-ik-kinematics-plugin \
ros-${ROS_DISTRO}-twist-mux \
ros-${ROS_DISTRO}-ur-msgs \
ros-${ROS_DISTRO}-usb-cam \
ros-${ROS_DISTRO}-velocity-controllers \
#
python-funcsigs \
python-lxml \
python-mock \
python-pyside \
python-qt4 \
python-qt4-dev \
libshiboken-dev \
shiboken \
libpyside-dev \
libcomedi-dev \
libmodbus-dev \
python-zmq \
#
libbluetooth-dev \
libcanberra-gtk-module \
libcanberra-gtk0 \
cmake
RUN apt-get install -y \
ros-melodic-rosbridge-server \
ros-melodic-moveit \
ros-melodic-hector-mapping \
ros-melodic-hector-gazebo-plugins \
ros-melodic-amcl \
ros-melodic-gmapping \
ros-melodic-twist-mux \
ros-melodic-map-server \
ros-melodic-joy \
ros-melodic-teb-local-planner \
ros-melodic-move-base \
ros-melodic-velocity-controllers \
ros-melodic-ackermann-msgs \
ros-melodic-robot-localization \
ros-melodic-imu-complementary-filter \
ros-melodic-mavros-msgs \
ros-melodic-joint-trajectory-controller \
ros-melodic-executive-smach-visualization \
ros-melodic-catkin-virtualenv \
ros-melodic-rviz-visual-tools \
python-sqlalchemy \
python-zmq \
ros-melodic-trac-ik-kinematics-plugin \
python3-catkin-pkg-modules
RUN apt-get install -y \
ros-melodic-ar-track-alvar-msgs \
ros-melodic-navigation
RUN apt-get install -y \
ros-melodic-ar-track-alvar \
ros-melodic-usb-cam \
libcanberra-gtk3-module \
libceres-dev \
libcomedi-dev \
libcwiid-dev \
libdouble-conversion-dev \
libglfw3-dev \
sqlite3
RUN apt-get install -y \
ros-melodic-realsense2-camera \
ros-melodic-eigen-conversions \
ros-melodic-abb-driver \
libmodbus-dev \
libpyside-dev \
libqd-dev \
ros-melodic-swri-profiler \
ros-melodic-force-torque-sensor-controller \
ros-melodic-effort-controllers
RUN apt-get install -y \
libdouble-conversion-dev
RUN apt-get update \
&& apt-get upgrade ca-certificates -y
RUN curl -fsSLk https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y -qq nodejs \
&& npm install -g yarn
RUN apt-get install -y \
libshiboken-dev \
libspnav-dev \
#
gir1.2-gtk-3.0 \
python3-gi \
python3-gi-cairo \
python3-numpy \
python3-pip \
graphviz \
xdot \
ros-melodic-image-view \
libcanberra-gtk-module \
libcanberra-gtk3-module \
wget \
terminator \
direnv \
libspnav-dev \
libbluetooth-dev \
libcwiid-dev \
ros-melodic-joy
RUN apt-get update && apt-get install -y \
#spacenavd \
#ros-melodic-spacenav-node \
ros-melodic-ros-control \
ros-melodic-rqt-controller-manager \
systemd
shiboken \
spacenavd \
sqlite3 \
systemd \
xdot
# Install Zivid packages
#RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-telicam-driver_3.0.1.1-1_amd64.deb \
# https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid_1.8.3+96f35dc6-1_amd64.deb \
# https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-studio_1.8.3+96f35dc6-1_amd64.deb \
......@@ -174,38 +152,28 @@ RUN apt-get update && apt-get install -y \
#RUN dpkg -i zivid*.deb
# Fix errors
#RUN mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak
#RUN mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.bak
#RUN ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h
#RUN ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h
# Python 3
RUN apt-get update && apt-get install -y \
ros-melodic-moveit-resources \
ros-melodic-moveit-visual-tools \
ros-melodic-moveit-opw-kinematics-plugin \
ros-melodic-rqt-joint-trajectory-controller \
ros-melodic-ros-controllers \
python-mock \
python-funcsigs \
clang-format
RUN apt-get update && apt-get install -y \
ros-melodic-imu-tools \
ros-melodic-interactive-marker-twist-server \
ros-melodic-industrial-core \
ros-melodic-lms1xx \
ros-melodic-serial \
ros-melodic-spacenav-node \
spacenavd
RUN pip3 install --upgrade pip
RUN apt-get update && apt-get install -y \
ipython3 \
ipython
python3-catkin-pkg-modules \
python3-gi \
python3-gi-cairo \
python3-numpy \
python3-pip \
ipython3
RUN pip3 install sqlite-utils
# RUN pip3 install sqlite-utils
# Install node for UIs
# RUN curl -fsSLk https://deb.nodesource.com/setup_14.x | bash - \
# && apt-get install -y -qq nodejs \
# && npm install -g yarn
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash \
&& apt-get install -y nodejs && npm -g install yarn
# Update final image
RUN apt-get update && apt-get -y upgrade && apt-get -y autoremove
......@@ -218,6 +186,7 @@ RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"]
ENV SHELL /usr/bin/zsh
ENV RUNNING_IN_DOCKER true
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
......@@ -13,41 +13,32 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Configure apt and install packages
RUN apt-get -y install --no-install-recommends \
RUN apt-get update && apt-get -y install --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
apt-utils dialog 2>&1 \
#
# Verify if git, process tools, lsb-release (common in install instructions for CLIs) are installed
# Install the https transport support package for The Artifactory debian repository
git \
git-lfs \
nano \
iproute2 \
procps \
lsb-release \
curl \
cmake \
openssh-client \
ros-noetic-catkin \
python3-catkin-tools \
python3-osrf-pycommon \
clang-format \
direnv \
xterm \
terminator \
zsh \
# && rosdep init || true \
&& rm -rf /var/lib/apt/lists/*
# Install docker-ce
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
RUN apt-get update && apt-get -y install --no-install-recommends \
docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*
#
ros-${ROS_DISTRO}-catkin \
ros-${ROS_DISTRO}-rosmon \
python3-catkin-tools \
python3-osrf-pycommon \
python3-numpy \
python3-click \
python-is-python3 \
ipython3
# Configure system to look for debian packages in the Artifactory repository
ARG USER_API_KEY_ARTIFACTS_TECNALIA
......@@ -63,16 +54,74 @@ RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt
RUN sh -c "echo 'yaml https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/rosdistro/rosdep_tecnalia.yaml' \
>> /etc/ros/rosdep/sources.list.d/20-default.list"
# Ros WS dependencies
RUN apt-get update && apt-get install -y \
wget \
udev
RUN wget https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-telicam-driver_3.0.1.1-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid_1.8.3+96f35dc6-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-studio_1.8.3+96f35dc6-1_amd64.deb \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-tools_1.8.3+96f35dc6-1_amd64.deb
RUN dpkg -i zivid*.deb
# Remodel app
libceres-dev \
libcomedi-dev \
libglfw3-dev \
libmodbus-dev \
ros-${ROS_DISTRO}-ackermann-msgs \
ros-${ROS_DISTRO}-amcl \
ros-${ROS_DISTRO}-effort-controllers \
ros-${ROS_DISTRO}-force-torque-sensor-controller \
ros-${ROS_DISTRO}-gmapping \
ros-${ROS_DISTRO}-hector-gazebo-plugins \
ros-${ROS_DISTRO}-hector-mapping \
ros-${ROS_DISTRO}-imu-complementary-filter \
ros-${ROS_DISTRO}-industrial-robot-simulator \
ros-${ROS_DISTRO}-joint-trajectory-controller \
ros-${ROS_DISTRO}-joy \
ros-${ROS_DISTRO}-map-server \
ros-${ROS_DISTRO}-mavros-msgs \
ros-${ROS_DISTRO}-move-base \
ros-${ROS_DISTRO}-moveit-commander \
ros-${ROS_DISTRO}-moveit-fake-controller-manager \
ros-${ROS_DISTRO}-moveit-planners-ompl \
ros-${ROS_DISTRO}-moveit-resources \
ros-${ROS_DISTRO}-moveit-ros-move-group \
ros-${ROS_DISTRO}-moveit-ros-planning-interface \
ros-${ROS_DISTRO}-moveit-ros-visualization \
ros-${ROS_DISTRO}-moveit-ros-warehouse \
ros-${ROS_DISTRO}-moveit-setup-assistant\
ros-${ROS_DISTRO}-moveit-simple-controller-manager \
ros-${ROS_DISTRO}-moveit-visual-tools \
ros-${ROS_DISTRO}-realsense2-camera \
ros-${ROS_DISTRO}-robot-localization \
ros-${ROS_DISTRO}-ros-control-boilerplate \
ros-${ROS_DISTRO}-rosbridge-server \
ros-${ROS_DISTRO}-spacenav-node \
ros-${ROS_DISTRO}-teb-local-planner \
ros-${ROS_DISTRO}-twist-mux \
ros-${ROS_DISTRO}-ur-msgs \
ros-${ROS_DISTRO}-velocity-controllers \
# Smart3D
socat \
ros-${ROS_DISTRO}-cartesian-trajectory-controller \
ros-${ROS_DISTRO}-industrial-robot-status-controller \
ros-${ROS_DISTRO}-industrial-robot-status-interface \
ros-${ROS_DISTRO}-moveit-ros-benchmarks \
ros-${ROS_DISTRO}-pass-through-controllers \
ros-${ROS_DISTRO}-scaled-joint-trajectory-controller \
ros-${ROS_DISTRO}-speed-scaling-interface \
ros-${ROS_DISTRO}-speed-scaling-state-controller \
ros-${ROS_DISTRO}-trac-ik-kinematics-plugin \
ros-${ROS_DISTRO}-twist-controller \
ros-${ROS_DISTRO}-ur-client-library \
ros-${ROS_DISTRO}-warehouse-ros-mongo \
# Odin_robot
ros-${ROS_DISTRO}-navigation \
ros-${ROS_DISTRO}-ros-control \
ros-${ROS_DISTRO}-ros-controllers
# Install pip3 and packages
RUN apt-get install -y \
python3-pip \
&& pip install sqlite_utils
# Install node for UIs
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash \
&& apt-get install -y nodejs && npm -g install yarn
# Update final image
RUN apt-get update \
......@@ -80,67 +129,14 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
direnv
# Scan and Plan dependencies
RUN apt-get update && apt-get install -y \
ros-noetic-industrial-robot-simulator \
ros-noetic-moveit-fake-controller-manager \
ros-noetic-moveit-planners-ompl \
ros-noetic-moveit-ros-move-group \
ros-noetic-moveit-ros-visualization \
ros-noetic-moveit-ros-warehouse \
ros-noetic-moveit-simple-controller-manager \
ros-noetic-warehouse-ros \
ros-noetic-industrial-robot-client \
python-numpy \
ros-noetic-simple-message \
liblapack-dev \
ros-noetic-moveit-core \
ros-noetic-trac-ik-kinematics-plugin \
ros-noetic-urdfdom-py \
ros-noetic-srdfdom \
ros-noetic-pcl-ros \
ros-noetic-moveit-kinematics \
ros-noetic-pcl-msgs \
ros-noetic-moveit-ros-planning-interface \
ros-noetic-swri-profiler \
libqd-dev \
libpcl-dev \
libpcl-apps1.10 \
libpcl-common1.10 \
libpcl-features1.10 \
libpcl-filters1.10 \
libpcl-io1.10 \
libpcl-kdtree1.10 \
libpcl-keypoints1.10 \
libpcl-ml1.10 \
libpcl-octree1.10 \
libpcl-outofcore1.10 \
libpcl-people1.10 \
libpcl-recognition1.10 \
libpcl-registration1.10 \
libpcl-sample-consensus1.10 \
libpcl-search1.10 \
libpcl-segmentation1.10 \
libpcl-stereo1.10 \
libpcl-surface1.10 \
libpcl-tracking1.10 \
libpcl-visualization1.10 \
ros-noetic-catkin-virtualenv \
python3-zmq \
ros-noetic-moveit-ros-planning \
ros-noetic-moveit-setup-assistant \
ros-noetic-ompl \
ros-noetic-moveit-ros-manipulation
# Set entrypoint
COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"]
ENV SHELL /usr/bin/zsh
ENV RUNNING_IN_DOCKER true
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
\ No newline at end of file
File moved
File moved
# Poining to pip venv
# alias rocker="~/.venv/rocker/bin/rocker"
# alias ddeploy="~/.venv/ddeploy/bin/ddeploy"
# docker common commands
alias dim="docker images"
alias drm="docker rm"
alias drmi="docker rmi"
alias dpsa="docker ps -a"
alias dps="docker ps"
alias drm="docker rm"
alias drmi="docker rmi"
alias dsp="docker system prune --all"
alias dimp="docker image prune"
function dex() {
docker exec -it $1 ${2:-bash}
# Run container with rocker
# usage: rundock {noetic, melodic} [{remodel_ws, odin_ws}] [cmd]
function rundock() {
cd ~/ros/$1/$2;
rocker --home --user --nvidia --x11 --ssh --git --network host --privileged --name $1 devenv:$1 $3
}
function dsr() {
docker stop $1;docker rm $1
}
function runremodel() {
rocker --x11 --nvidia --privileged --network=host --name remodel_docker --oyr-run-arg " -v iiwa_state_recorder:/home/remodel/iiwa_state_recorder -v /home/andres/test/remodel_shared:/home/remodel/remodel_shared" -- remodel_app:melodic bash -c "'roslaunch remodel_app remodel_app.launch use_sim:=true docker:=true skill_manager:=true collision_detector:=true ui:=true cad:=true joystick:=false'"
}
function rundoc() {
rocker --home --user --nvidia --pulse --x11 --ssh --git --volume /dev/video0:/dev/video0 --privileged --name melodic --network host devenv:melodic $1
}
function docrun() {
rocker --nvidia --pulse --x11 --volume /dev/video0:/dev/video0 --privileged --oyr-run-arg " -v odin_robot_volume:/root/" --name odin_robot --network host odin_robot:melodic $1
}
function runodin() {
rocker --nvidia --pulse --x11 --privileged --volume /dev/video0:/dev/video0 --name odin_melodic --network host devenv:melodic $1
}
function runmelodic() {
rocker --home --user --nvidia --x11 --ssh --git --name melodic devenv:melodic $1
}
function runnoetic() {
rocker --home --user --x11 --nvidia --ssh --git --name noetic devenv:noetic $1
}
function runkinetic() {
rocker --home --user --nvidia --x11 --ssh --git --name kinetic devenv:kinetic $1
# Execute container, move to workspace, and source SHELL
# usage: dat {noetic, melodic} {remodel_ws, odin_ws}
function dat() {
docker exec -it $1 bash -c "cd ~/ros/$1/$2 && $ext"
}
# Remove all stoped containers
function drma() {
docker rm $(docker ps -a -f status=exited -q)
drm $(docker ps -a -f status=exited -q)
}
function dat() {
docker exec -it melodic bash -c "cd ~/ros/melodic/$1 && $ext"
# Stop and remove
function dsr() {
docker stop $1;
docker rm $1
}
function datmelodic() {
docker exec -it melodic bash -c "cd ~/ros/melodic/$1 && zsh"
# Remove all unused or dangling immages
function drmui(){
drmi $(dim --filter "dangling=true" -q --no-trunc)
}
function datnoetic() {
docker exec -it noetic -c "cd ~/ros/noetic/$1 && $ext"
# Build docker image
# usage: dockbuild {noetic, melodic}
function dockbuild(){
cd ~/srcs/development_environment/dockerfiles;
docker build -t devenv:$1 --build-arg USER_API_KEY_ARTIFACTS_TECNALIA="$(cat ~/.ssh/user_api_key_artifacts_tecnalia)" -f $1.Dockerfile .
}
function datremodel() {
docker exec -it remodel_docker bash
}
# function runpythonsyntax(){
# rocker --home --name python_syntax tecnalia-docker-dev.artifact.tecnalia.com/docker:git
# }
function datkinetic() {
docker exec -it kinetic -c "cd ~/ros/kinetic/$1 && $ext"
}
# function runremodel() {
# rocker --x11 --nvidia --privileged --network=host --name remodel_docker --oyr-run-arg " -v iiwa_state_recorder:/home/remodel/iiwa_state_recorder -v /home/andres/test/remodel_shared:/home/remodel/remodel_shared" -- remodel_app:melodic bash -c "'roslaunch remodel_app remodel_app.launch use_sim:=true docker:=true skill_manager:=true collision_detector:=true ui:=true cad:=true joystick:=false'"
# }
function runpythonsyntax(){
rocker --home --name python_syntax tecnalia-docker-dev.artifact.tecnalia.com/docker:git
}
# function docrun() {
# rocker --nvidia --pulse --x11 --volume /dev/video0:/dev/video0 --privileged --oyr-run-arg " -v odin_robot_volume:/root/" --name odin_robot --network host odin_robot:melodic $1
# }
# function runodin() {
# rocker --nvidia --pulse --x11 --privileged --volume /dev/video0:/dev/video0 --name odin_melodic --network host devenv:melodic $1
# }
#DOCKER
alias dexec='f(){ docker exec -w /root/ --detach-keys="ctrl-@" -e DISPLAY=$DISPLAY -it $1 /bin/bash -c "terminator --no-dbus"; unset -f f; }; f'
......
......@@ -2,8 +2,17 @@
# ROS aliases and functions
###################################################################
# Define ROS_DISTRO before source ROS
if [ -z $ROS_DISTRO ]; then export ROS_DISTRO=noetic; fi
# Define ROS_DISTRO before source ROS on native OS
# if [ -z $ROS_DISTRO ]; then export ROS_DISTRO=noetic; fi
if [[ -z "${ROS_DISTRO}" ]]; then
ROS_DIR=/opt/ros
if [ -d "$ROS_DIR" ];
then
export ROS_DISTRO=$(basename $(find /opt/ros/* -maxdepth 0 -type d | head -1))
else
unset ROS_DISTRO
fi
fi
# Determine shell extension
if [ -z $SHELL ]; then echo "SHELL not set"; else ext=$(basename ${SHELL}); fi
......@@ -39,14 +48,19 @@ function sourcethis(){
function cb() {
pwd_cb=${PWD}
roshome
catkin build --summarize "$@"
catkin build --summarize --cmake-args -DCMAKE_BUILD_TYPE=Release -- "$@"
sourcethis
cd ${pwd_cb}
}
# Clean workspace (delete the generated folders, then catkin build)
function cbclean(){
roshome && rm -rf build devel install && catkin build --summarize
roshome && rm -rf build devel install && catkin build --summarize --cmake-args -DCMAKE_BUILD_TYPE=Release
}
# Run ci locally
function runci(){
rosrun industrial_ci run_ci ROS_DISTRO="$@" DOCKER_IMAGE=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:"$@"
}
# Initialize catkin workspace, configure and build it
......@@ -55,6 +69,8 @@ function cib(){
}
# If terminal starts in a ws, auto source it (useful for vscode)
if [ -z ${ROS_DISTRO+x} ]; then ;
else
pwd_init=${PWD}
cropped=${PWD#${HOME}/ros/${ROS_DISTRO}/}
WS_name=${cropped%%/*}
......@@ -67,3 +83,4 @@ if [[ -f $FILE ]]; then
else
source /opt/ros/${ROS_DISTRO}/setup.${ext}
fi
fi
\ No newline at end of file
# Checkin python_syntax
# RUN ci local
in terminal run (from dotfiles docker.bash):
Source: https://git.code.tecnalia.com/tecnalia_robotics/documentation/-/blob/master/tutorials/docker_ci.adoc
runpythonsyntax
## Case 1: verify that a repository passes the CI without .rosinstall file
in docker container run:
1. docker login tecnalia-robotics-docker.artifact.tecnalia.com (Optional -- only to use tecnalia docker images)
2. docker pull tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:ROSDISTRO (Optional -- point 4 actually done this)
3. Download the ci repository into the workspace:
git clone https://github.com/ros-industrial/industrial_ci.git (Optional -- pass the branch legacy (-b legacy), but the master is also working)
4. rosrun industrial_ci run_ci ROS_DISTRO=ROSDISTRO DOCKER_IMAGE=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:ROSDISTRO (Replace ROSDISTRO by melodic, noetic, etc.)
## Case 2: Case 2: verify that a repository passes the CI with .rosinstall file
4. rosrun industrial_ci run_ci ROS_DISTRO=ROSDISTRO DOCKER_IMAGE=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:ROSDISTRO UPSTREAM_WORKSPACE=file ROSINSTALL_FILENAME=.rosinstall
## Other options:
DOCKER_COMMIT=test_ci -- Save the docker image in order to iteract later with it.
## Simplify using a alias
function runci(){
rosrun industrial_ci run_ci ROS_DISTRO="$@" DOCKER_IMAGE=tecnalia-robotics-docker.artifact.tecnalia.com/flexbotics-base-devel:"$@"
}
Usage: runci noetic
runci melodic
## Check python_syntax
a. Locally -- just run:
python -m compileall -q .
b. In docker (using the same docker than tecnalia ci)
function runpythonsyntax(){
rocker --home --name python_syntax tecnalia-docker-dev.artifact.tecnalia.com/docker:git
}
inside docker container run:
apk add --update python2
go to project source folder, and run:
python -m compileall -q .
## Check adoc_syntax
a. Locally -- just run:
curl -Ls https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/scripts/asciidoctor_syntax_check.bash | bash -s -- .
b. In docker:
1. apk add --update curl asciidoctor bash
2. Then a.
## Check bash_syntax
a. Locally -- just run:
1. find . -type f -name '*.sh' -exec shellcheck -s sh {} + || RET=1
2. find . -type f -name '*.bash' -exec shellcheck -s bash {} + || RET=1
b. In docker:
1. apk add --update shellcheck
## Check clang format (Not tested)
a. Locally -- just run:
1. wget https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/raw/master/clang-format -O .clang-format
2. .ci_config/gitlab.sh
## Check file structure
docker run -v ${PWD}:/ac tecnalia-docker-dev.artifact.tecnalia.com/cytopia/awesome-ci file-trailing-space --path=/ac --extension=py,txt,cpp,h,md,sh,bash,xml,launch --ignore=.ci_config || RET=1
docker run -v ${PWD}:/ac tecnalia-docker-dev.artifact.tecnalia.com/cytopia/awesome-ci file-utf8 --path=/ac --extension=py,txt,cpp,h,md,sh,bash,xml,launch --ignore=.ci_config || RET=1
## More tips
docker login tecnalia-docker-dev.artifact.tecnalia.com -u ${ARTIFACT_CI_USER} -p ${ARTIFACT_CI_TOKEN}
### Black magic
curl -L "https://git.code.tecnalia.com/tecnalia_robotics-public/gitlab_templates/-/jobs/artifacts/master/raw/dot_devcontainer.tar.gz?job=deploy_devcontainer" | tar xz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment