Skip to content

Commit

Permalink
splitting out some 22.04 docker builds, adding SUBDIR so additional w…
Browse files Browse the repository at this point in the history
…orkspace will be built in 20.04 and 24.04
  • Loading branch information
lucasw committed Jul 19, 2024
1 parent c8a2b97 commit 0935555
Show file tree
Hide file tree
Showing 11 changed files with 509 additions and 25 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/ubuntu_20_04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:

- name: local apt dependencies
run: |
sudo apt-get install -y python3-pip
pip install vcstool
mkdir staging
cd staging
mkdir -p underlay_ws/src
Expand All @@ -46,14 +43,4 @@ jobs:
- name: docker build from source 20.04
run: |
cd ros_from_src
docker build --build-arg IMAGE=ubuntu:20.04 --build-arg ROSCONSOLE=https://github.com/ros/rosconsole --build-arg PYTHON_MINOR_VERSION=8 . -t ros2004
- name: docker build from source 22.04
run: |
cd ros_from_src
docker build --build-arg IMAGE=ubuntu:22.04 --build-arg PYTHON_MINOR_VERSION=10 . -t ros2204
- name: docker build from source and debian 22.04
run: |
cd ros_from_src/ubuntu_2204
docker build . -t ros_debian_2204
docker build --build-arg IMAGE=ubuntu:20.04 --build-arg SUBDIR=ubuntu_2004 . -t ros2004
27 changes: 27 additions & 0 deletions .github/workflows/ubuntu_22_04_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ubuntu 22.04 Noetic ROS build from source in docker

on:
push:
workflow_dispatch:

jobs:
ubuntu2204docker:
runs-on: ubuntu-22.04
# env:
steps:
- name: git clone [email protected]:lucasw/ros_from_src
uses: actions/checkout@v2
with:
path: ros_from_src
submodules: recursive

# TODO(lucasw) move these 22.04 builds into separate action
- name: docker build from source 22.04
run: |
cd ros_from_src
docker build --build-arg IMAGE=ubuntu:22.04 --build-arg PYTHON_MINOR_VERSION=10 . -t ros2204
- name: docker build from source and debian 22.04
run: |
cd ros_from_src/ubuntu_2204
docker build . -t ros_debian_2204
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_24_04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: docker build from source 24.04
run: |
cd ros_from_src
docker build --build-arg IMAGE=ubuntu:24.04 . -t ros2404
docker build --build-arg IMAGE=ubuntu:24.04 --build-arg SUBDIR=ubuntu_2404 . -t ros2404
# TODO(lucasw) ubuntu_2404/Dockerfile doesn't work, was depending on the now-removed
# apt debian science ros packages
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ARG IMAGE=ubuntu:24.04
FROM ${IMAGE}
ARG IMAGE
RUN echo ${IMAGE}
ARG SUBDIR

ENV DEBIAN_FRONTEND="noninteractive"

Expand Down Expand Up @@ -41,15 +42,15 @@ RUN $SRC/ros_from_src/catkin.sh

# WORKDIR $SRC/ros_from_src
RUN mkdir -p base_ws/src
COPY ubuntu_2404/base_repos.yaml base_ws/src
COPY ubuntu_2404/base_git_clone.sh $SRC/ros_from_src
COPY ${SUBDIR}/base_repos.yaml base_ws/src
COPY ${SUBDIR}/base_git_clone.sh $SRC/ros_from_src
# RUN ROS_CONSOLE=$ROSCONSOLE $SRC/ros_from_src/git_clone.sh
RUN $SRC/ros_from_src/base_git_clone.sh

COPY ubuntu_2404/dependencies.sh $SRC/ros_from_src/base_dependencies.sh
COPY ${SUBDIR}/dependencies.sh $SRC/ros_from_src/base_dependencies.sh
RUN $SRC/ros_from_src/base_dependencies.sh

COPY ubuntu_2404/base_catkin.sh $SRC/ros_from_src
COPY ${SUBDIR}/base_catkin.sh $SRC/ros_from_src
RUN $SRC/ros_from_src/base_catkin.sh

WORKDIR $WS/..
Expand Down
9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-v
mkdir -p $BUILD/catkin
cd $BUILD/catkin
cmake $WS/catkin -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -DCATKIN_INSTALL_INTO_PREFIX_ROOT=true && make && make install
echo $PATH
ls -l $DEST/local/bin
PATH=$PATH:$DEST/bin
PATH=$PATH:$DEST/local/bin
ls -l $DEST/bin
which catkin
catkin --version
echo $PYTHONPATH
# ls -l $DEST/local/lib/python3.8/dist-packages/ || ls -l $DEST/lib/python3.8/site-packages/
catkin --version
python -c "import catkin; print(catkin)"

# console_bridge
Expand Down Expand Up @@ -132,6 +133,8 @@ python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-v

cd $WS/rosdep
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
echo $PATH
which rosdep
rosdep init || true
rosdep update

Expand Down
5 changes: 4 additions & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# build apt installs
apt-get update

apt-get install -y python3-pip
apt-get install -y vcstool || pip install vcstool # vcs is in apt 24.04 but only pip in 20.04

apt-get install -y build-essential
apt-get install -y bzip2 libbz2-dev
apt-get install -y cmake
Expand Down Expand Up @@ -49,4 +53,3 @@ apt-get install -y python3-gnupg

apt-get install -y catkin-tools || true # not available in 20.04
apt-get install -y libbullet-dev
apt-get install -y vcstool || true # this is in 24.04 but not 20.04
4 changes: 2 additions & 2 deletions env.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/bash
# ROS_DEST=`pwd`/ros source ros_from_src/env.sh
# export ROS_DEST=`pwd`/ros
export PATH=$PATH:$ROS_DEST/bin
export PATH=$PATH:$ROS_DEST/bin:$ROS_DEST/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROS_DEST/lib
# export PATH=$PATH:$ROS_DEST/local/bin

# python --version | awk '{print $2}' | cut -d'.' -f1
PYTHON_MAJOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f1`
PYTHON_MINOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f2`
OPT_PYTHONPATH0=$ROS_DEST/local/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/site-packages/
OPT_PYTHONPATH0=$ROS_DEST/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/site-packages/
OPT_PYTHONPATH1=$ROS_DEST/local/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/dist-packages/

export PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH0:$OPT_PYTHONPATH1
Expand Down
25 changes: 25 additions & 0 deletions ubuntu_2004/base_catkin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
set -x

ls -l
ls -l ros/bin
ROS_DEST=`pwd`/ros source underlay_ws/env.sh

WS=`pwd`/base_ws/src
echo $WS

cd $WS/..
echo "#####################"
pwd
source ../underlay_ws/install/setup.bash
catkin init
catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated -DCATKIN_ENABLE_TESTING=False
echo $PATH
echo $LD_LIBRARY_PATH
rospack list

catkin build ros_comm
source install/setup.bash
rospack list
# TODO(lucasw) run tests
17 changes: 17 additions & 0 deletions ubuntu_2004/base_git_clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# TODO(lucasw) replace the below with submodules
# export PATH=$PATH:/usr/local/bin
set -e
set -x

WS=`pwd`/base_ws/src
echo $WS
mkdir $WS -p

# TODO(lucasw) replace these git clones with vcs
# packages that need to be cmake installed, and are ros packages in a catkin workspace
cd $WS
vcs import --input base_repos.yaml --retry 10

# ROSCONSOLE1=${ROSCONSOLE:-https://github.com/ros-o/rosconsole}
# git clone $ROSCONSOLE1
Loading

0 comments on commit 0935555

Please sign in to comment.