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 FROM osrf/ros:melodic-desktop-full
ENV ROS_DISTRO melodic ENV ROS_DISTRO melodic
ENV RUNNING_IN_DOCKER true
# Avoid warnings by switching to noninteractive # Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
...@@ -15,33 +13,30 @@ ENV LANGUAGE en_US:en ...@@ -15,33 +13,30 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL en_US.UTF-8
# Configure apt and install packages # 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 \ apt-transport-https \
ca-certificates \ ca-certificates \
software-properties-common \
curl \ curl \
gnupg-agent \ gnupg-agent \
software-properties-common \
apt-utils dialog 2>&1 \ 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 \
git-lfs \ git-lfs \
nano \ nano \
less \ clang-format \
iproute2 \ direnv \
procps \
lsb-release \
curl \
cmake \
openssh-client \
python-pip \
python-catkin-tools \
python-osrf-pycommon \
libclang-dev \
cppcheck \
lcov \
iwyu \
xterm \ xterm \
terminator \
zsh \ 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 # Install docker-ce
#RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - #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 ...@@ -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' \ 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" >> /etc/ros/rosdep/sources.list.d/20-default.list"
# Ros WS dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
ros-melodic-ros-control-boilerplate \ ros-${ROS_DISTRO}-abb-driver \
ros-melodic-ur-msgs \ ros-${ROS_DISTRO}-ackermann-msgs \
ros-melodic-eigen-stl-containers \ ros-${ROS_DISTRO}-amcl \
ros-melodic-industrial-robot-simulator \ ros-${ROS_DISTRO}-ar-track-alvar \
ros-melodic-srdfdom \ ros-${ROS_DISTRO}-ar-track-alvar-msgs \
ros-melodic-joint-state-publisher-gui \ ros-${ROS_DISTRO}-catkin-virtualenv \
ros-${ROS_DISTRO}-rosmon \ ros-${ROS_DISTRO}-effort-controllers \
python-pyside \ 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-lxml \
python-mock \
python-pyside \
python-qt4 \ python-qt4 \
python-qt4-dev \ python-qt4-dev \
libshiboken-dev \ python-zmq \
shiboken \ #
libpyside-dev \ libbluetooth-dev \
libcomedi-dev \
libmodbus-dev \
libcanberra-gtk-module \ libcanberra-gtk-module \
libcanberra-gtk0 \ libcanberra-gtk0 \
cmake libcanberra-gtk3-module \
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 \
libceres-dev \ libceres-dev \
libcomedi-dev \
libcwiid-dev \
libdouble-conversion-dev \
libglfw3-dev \ libglfw3-dev \
sqlite3 libmodbus-dev \
libpyside-dev \
RUN apt-get install -y \
ros-melodic-realsense2-camera \
ros-melodic-eigen-conversions \
ros-melodic-abb-driver \
libqd-dev \ libqd-dev \
ros-melodic-swri-profiler \ libshiboken-dev \
ros-melodic-force-torque-sensor-controller \ libspnav-dev \
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 \
gir1.2-gtk-3.0 \ gir1.2-gtk-3.0 \
python3-gi \
python3-gi-cairo \
python3-numpy \
python3-pip \
graphviz \ graphviz \
xdot \ shiboken \
ros-melodic-image-view \ spacenavd \
libcanberra-gtk-module \ sqlite3 \
libcanberra-gtk3-module \ systemd \
wget \ xdot
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
# 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 \ #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_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-studio_1.8.3+96f35dc6-1_amd64.deb \
...@@ -174,38 +152,28 @@ RUN apt-get update && apt-get install -y \ ...@@ -174,38 +152,28 @@ RUN apt-get update && apt-get install -y \
#RUN dpkg -i zivid*.deb #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/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 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/lz4.h /usr/include/flann/ext/lz4.h
#RUN ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h #RUN ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h
# Python 3
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
ros-melodic-moveit-resources \ python3-catkin-pkg-modules \
ros-melodic-moveit-visual-tools \ python3-gi \
ros-melodic-moveit-opw-kinematics-plugin \ python3-gi-cairo \
ros-melodic-rqt-joint-trajectory-controller \ python3-numpy \
ros-melodic-ros-controllers \ python3-pip \
python-mock \ ipython3
python-funcsigs \ RUN pip3 install sqlite-utils
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
# 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 # Update final image
RUN apt-get update && apt-get -y upgrade && apt-get -y autoremove RUN apt-get update && apt-get -y upgrade && apt-get -y autoremove
...@@ -218,6 +186,7 @@ RUN chmod a+x /ros_entrypoint.sh ...@@ -218,6 +186,7 @@ RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"] ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"] CMD ["zsh"]
ENV SHELL /usr/bin/zsh ENV SHELL /usr/bin/zsh
ENV RUNNING_IN_DOCKER true
# Switch back to dialog for any ad-hoc use of apt-get # Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND= ENV DEBIAN_FRONTEND=
...@@ -13,41 +13,32 @@ ENV LANGUAGE en_US:en ...@@ -13,41 +13,32 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL en_US.UTF-8
# Configure apt and install packages # 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 \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
gnupg-agent \ gnupg-agent \
software-properties-common \ software-properties-common \
apt-utils dialog 2>&1 \ apt-utils dialog 2>&1 \
#
# Verify if git, process tools, lsb-release (common in install instructions for CLIs) are installed # 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 # Install the https transport support package for The Artifactory debian repository
git \ git \
git-lfs \ git-lfs \
nano \ nano \
iproute2 \ clang-format \
procps \ direnv \
lsb-release \
curl \
cmake \
openssh-client \
ros-noetic-catkin \
python3-catkin-tools \
python3-osrf-pycommon \
xterm \ xterm \
terminator \ terminator \
zsh \ zsh \
# && rosdep init || true \ #
&& rm -rf /var/lib/apt/lists/* ros-${ROS_DISTRO}-catkin \
ros-${ROS_DISTRO}-rosmon \
# Install docker-ce python3-catkin-tools \
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - python3-osrf-pycommon \
RUN add-apt-repository \ python3-numpy \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" python3-click \
RUN apt-get update && apt-get -y install --no-install-recommends \ python-is-python3 \
docker-ce-cli \ ipython3
&& rm -rf /var/lib/apt/lists/*
# Configure system to look for debian packages in the Artifactory repository # Configure system to look for debian packages in the Artifactory repository
ARG USER_API_KEY_ARTIFACTS_TECNALIA ARG USER_API_KEY_ARTIFACTS_TECNALIA
...@@ -63,16 +54,74 @@ RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt ...@@ -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' \ 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" >> /etc/ros/rosdep/sources.list.d/20-default.list"
# Ros WS dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
wget \ # Remodel app
udev libceres-dev \
libcomedi-dev \
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 \ libglfw3-dev \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid_1.8.3+96f35dc6-1_amd64.deb \ libmodbus-dev \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-studio_1.8.3+96f35dc6-1_amd64.deb \ ros-${ROS_DISTRO}-ackermann-msgs \
https://www.zivid.com/hubfs/softwarefiles/releases/1.8.3+96f35dc6-1/u18/zivid-tools_1.8.3+96f35dc6-1_amd64.deb ros-${ROS_DISTRO}-amcl \
ros-${ROS_DISTRO}-effort-controllers \
RUN dpkg -i zivid*.deb 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 # Update final image
RUN apt-get update \ RUN apt-get update \
...@@ -80,67 +129,14 @@ RUN apt-get update \ ...@@ -80,67 +129,14 @@ RUN apt-get update \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && 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 # Set entrypoint
COPY ./ros_entrypoint.sh / COPY ./ros_entrypoint.sh /
RUN chmod a+x /ros_entrypoint.sh RUN chmod a+x /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"] ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["zsh"] CMD ["zsh"]
ENV SHELL /usr/bin/zsh
ENV RUNNING_IN_DOCKER true
# Switch back to dialog for any ad-hoc use of apt-get # Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND= 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 # docker common commands
alias dim="docker images" alias dim="docker images"
alias drm="docker rm"
alias drmi="docker rmi"
alias dpsa="docker ps -a" alias dpsa="docker ps -a"
alias dps="docker ps" alias dps="docker ps"
alias drm="docker rm"
alias drmi="docker rmi"
alias dsp="docker system prune --all" alias dsp="docker system prune --all"
alias dimp="docker image prune"
function dex() { # Run container with rocker
docker exec -it $1 ${2:-bash} # 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() { # Execute container, move to workspace, and source SHELL
docker stop $1;docker rm $1 # usage: dat {noetic, melodic} {remodel_ws, odin_ws}
} function dat() {
docker exec -it $1 bash -c "cd ~/ros/$1/$2 && $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 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
} }
# Remove all stoped containers
function drma() { function drma() {
docker rm $(docker ps -a -f status=exited -q) drm $(docker ps -a -f status=exited -q)
} }
function dat() { # Stop and remove
docker exec -it melodic bash -c "cd ~/ros/melodic/$1 && $ext" function dsr() {
docker stop $1;
docker rm $1
} }
function datmelodic() { # Remove all unused or dangling immages
docker exec -it melodic bash -c "cd ~/ros/melodic/$1 && zsh" function drmui(){
drmi $(dim --filter "dangling=true" -q --no-trunc)
} }
function datnoetic() { # Build docker image
docker exec -it noetic -c "cd ~/ros/noetic/$1 && $ext" # 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() { # function runpythonsyntax(){
docker exec -it remodel_docker bash # rocker --home --name python_syntax tecnalia-docker-dev.artifact.tecnalia.com/docker:git
} # }
function datkinetic() { # function runremodel() {
docker exec -it kinetic -c "cd ~/ros/kinetic/$1 && $ext" # 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(){ # function docrun() {
rocker --home --name python_syntax tecnalia-docker-dev.artifact.tecnalia.com/docker:git # 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 #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' 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 @@ ...@@ -2,8 +2,17 @@
# ROS aliases and functions # ROS aliases and functions
################################################################### ###################################################################
# Define ROS_DISTRO before source ROS # Define ROS_DISTRO before source ROS on native OS
if [ -z $ROS_DISTRO ]; then export ROS_DISTRO=noetic; fi # 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 # Determine shell extension
if [ -z $SHELL ]; then echo "SHELL not set"; else ext=$(basename ${SHELL}); fi if [ -z $SHELL ]; then echo "SHELL not set"; else ext=$(basename ${SHELL}); fi
...@@ -39,14 +48,19 @@ function sourcethis(){ ...@@ -39,14 +48,19 @@ function sourcethis(){
function cb() { function cb() {
pwd_cb=${PWD} pwd_cb=${PWD}
roshome roshome
catkin build --summarize "$@" catkin build --summarize --cmake-args -DCMAKE_BUILD_TYPE=Release -- "$@"
sourcethis sourcethis
cd ${pwd_cb} cd ${pwd_cb}
} }
# Clean workspace (delete the generated folders, then catkin build) # Clean workspace (delete the generated folders, then catkin build)
function cbclean(){ 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 # Initialize catkin workspace, configure and build it
...@@ -55,6 +69,8 @@ function cib(){ ...@@ -55,6 +69,8 @@ function cib(){
} }
# If terminal starts in a ws, auto source it (useful for vscode) # If terminal starts in a ws, auto source it (useful for vscode)
if [ -z ${ROS_DISTRO+x} ]; then ;
else
pwd_init=${PWD} pwd_init=${PWD}
cropped=${PWD#${HOME}/ros/${ROS_DISTRO}/} cropped=${PWD#${HOME}/ros/${ROS_DISTRO}/}
WS_name=${cropped%%/*} WS_name=${cropped%%/*}
...@@ -67,3 +83,4 @@ if [[ -f $FILE ]]; then ...@@ -67,3 +83,4 @@ if [[ -f $FILE ]]; then
else else
source /opt/ros/${ROS_DISTRO}/setup.${ext} source /opt/ros/${ROS_DISTRO}/setup.${ext}
fi 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 apk add --update python2
go to project source folder, and run: go to project source folder, and run:
python -m compileall -q . 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