Skip to content

Commit 06fafd4

Browse files
Utilizing docker scripts in github workflows
1 parent c3e66e7 commit 06fafd4

9 files changed

+28
-137
lines changed

.github/workflows/build_and_test.yml

+6-35
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,14 @@ jobs:
2020
- name: Install apt dependencies
2121
run: |
2222
sudo apt-get update
23-
sudo apt-get -y install build-essential cmake git libpoco-dev catch2 python3-dev
23+
sudo apt-get -y install build-essential cmake git libpoco-dev python3-dev
2424
25-
- name: Install Eigen3
25+
- name: Install other dependencies
2626
run: |
27-
git clone https://gitlab.com/libeigen/eigen.git
28-
cd eigen
29-
git checkout 3.4.0
30-
mkdir build && cd build
31-
cmake ..
32-
sudo make install
33-
34-
- name: Install libfranka
35-
run: |
36-
git clone --recursive https://github.com/frankaemika/libfranka.git
37-
cd libfranka
38-
git checkout ${{ inputs.libfranka-version }}
39-
40-
# Cherry-pick missing imports commit
41-
git config user.email "john.doe@example.com"
42-
git config user.name "John Doe"
43-
if ! git merge-base --is-ancestor f1f46fb HEAD; then git cherry-pick -m 1 f1f46fb; fi
44-
45-
git submodule update
46-
mkdir build && cd build
47-
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF ..
48-
make -j2
49-
sudo make install
50-
51-
- name: Install pybind11
52-
run: |
53-
git clone https://github.com/pybind/pybind11.git
54-
cd pybind11
55-
git checkout v2.9.1
56-
mkdir build && cd build
57-
cmake -DPYBIND11_TEST=OFF ..
58-
make -j2
59-
sudo make install
27+
set -a
28+
. ./dependency_versions
29+
set +a
30+
./docker/common/install-dependencies
6031
6132
- name: Configure & make
6233
run: |

.github/workflows/build_wheels.yml

+8-97
Original file line numberDiff line numberDiff line change
@@ -23,110 +23,21 @@ jobs:
2323
with:
2424
submodules: recursive
2525

26-
- name: Log Python versions
26+
- name: Setting up pip
2727
run: |
28-
echo "Found the following Python versions:"
29-
for PYBIN in /opt/python/*/bin; do
30-
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then
31-
echo "${PYBIN}" | cut -d / -f 4
32-
fi
33-
done
28+
./docker/common/manylinux-setup-pip
3429
35-
- name: Install build essentials
30+
- name: Install dependencies
3631
run: |
37-
yum -y install poco-devel*
38-
39-
for PYBIN in /opt/python/*/bin; do
40-
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then
41-
"${PYBIN}/pip" install cmake setuptools wheel --user
42-
fi
43-
done
44-
45-
ln -f -s $HOME/.local/bin/cmake /usr/bin/cmake
46-
47-
- name: Install Eigen3
48-
run: |
49-
git clone https://gitlab.com/libeigen/eigen.git
50-
cd eigen
51-
git checkout 3.4.0
52-
mkdir build && cd build
53-
cmake ..
54-
make install -j2
55-
56-
- name: Install pybind11
57-
run: |
58-
git clone https://github.com/pybind/pybind11.git
59-
cd pybind11
60-
git checkout v2.11.1
61-
mkdir build && cd build
62-
cmake -DPYBIND11_TEST=OFF ..
63-
make -j2
64-
make install
65-
66-
- name: Install Catch2
67-
run: |
68-
git clone https://github.com/catchorg/Catch2.git
69-
cd Catch2
70-
git checkout v2.13.8
71-
mkdir build && cd build
72-
cmake -DCATCH_BUILD_TESTING=OFF -DCATCH_ENABLE_WERROR=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF ..
73-
make install
74-
75-
- name: Install libfranka
76-
run: |
77-
git clone --recursive https://github.com/frankaemika/libfranka.git
78-
cd libfranka
79-
git checkout ${{ inputs.libfranka-version }}
80-
81-
# Cherry-pick missing imports commit
82-
git config user.email "john.doe@example.com"
83-
git config user.name "John Doe"
84-
if ! git merge-base --is-ancestor f1f46fb HEAD; then git cherry-pick -m 1 f1f46fb; fi
85-
86-
git submodule update
87-
mkdir build && cd build
88-
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF ..
89-
make -j2
90-
make install
32+
set -a
33+
. ./dependency_versions
34+
set +a
35+
./docker/common/install-dependencies
9136
9237
- name: Python package
9338
run: |
9439
yum -y install zip
95-
mkdir -p wheels
96-
mkdir -p dist
97-
mkdir -p dist_full
98-
99-
# Compile wheels
100-
for PYBIN in /opt/python/*/bin; do
101-
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then
102-
"${PYBIN}/pip" wheel . -w wheels/
103-
fi
104-
done
105-
106-
# Bundle external shared libraries into the wheels
107-
for whl in wheels/*.whl; do
108-
if [[ "$whl" =~ wheels/franky_panda-.*\.whl ]]; then
109-
auditwheel repair "$whl" -w dist_full/
110-
else
111-
cp "$whl" dist_full/
112-
fi
113-
done
114-
115-
# Install packages and test
116-
for PYBIN in /opt/python/*/bin/; do
117-
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then
118-
"${PYBIN}/pip" install franky-panda --no-index -f dist_full
119-
# (cd "$HOME"; "${PYBIN}/nosetests" -w /io/tests)
120-
fi
121-
done
122-
123-
cp dist_full/franky_panda-*.whl dist/
124-
125-
ls dist
126-
127-
mkdir -p output
128-
libfranka_version=${{ inputs.libfranka-version }}
129-
zip -r "output/libfranka_${libfranka_version//./-}_wheels.zip" dist/
40+
./docker/common/manylinux-build-wheels
13041
13142
- name: Upload wheels
13243
uses: actions/upload-artifact@v3

docker/build/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ RUN set -a && . /tmp/dependency_versions && set +a \
1111
&& /tmp/common/install-dependencies
1212

1313
ARG PYBIN_SUPPORTED_VERSIONS="cp3(7m|8|9|10|11|12)"
14+
# Preserve argument for runtime
15+
ENV PYBIN_SUPPORTED_VERSIONS=${PYBIN_SUPPORTED_VERSIONS}
1416
RUN /tmp/common/manylinux-setup-pip
1517

1618
# Set working directory
@@ -19,7 +21,7 @@ RUN mkdir -p /build
1921
VOLUME /code
2022
VOLUME /build
2123
WORKDIR /build
22-
ADD docker/build/build-wheels /usr/bin/
24+
ADD docker/common/manylinux-build-wheels /usr/bin/build-wheels
2325
ADD docker/build/run-tests /usr/bin/
2426

2527
# Cleaning up

docker/common/install-catch2

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git checkout "v${CATCH2_VERSION}"
99
mkdir build
1010
cd build
1111
cmake -DCATCH_BUILD_TESTING=OFF -DCATCH_ENABLE_WERROR=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF ..
12-
make install
12+
sudo make install || make install
1313
cd /
1414
rm -rf "${TMP_DIR}"
1515
echo "Catch2 installed successfully"

docker/common/install-eigen

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git checkout "${EIGEN_VERSION}"
99
mkdir build
1010
cd build
1111
cmake ..
12-
make install
12+
sudo make install || make install
1313
cd /
1414
rm -rf "${TMP_DIR}"
1515
echo "Eigen installed successfully"

docker/common/install-libfranka

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mkdir build
1919
cd build
2020
cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF ..
2121
make -j "$(nproc)"
22-
make install
22+
sudo make install || make install
2323

2424
cd /
2525
rm -rf "${TMP_DIR}"

docker/common/install-pybind11

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mkdir build
1010
cd build
1111
cmake -DPYBIND11_TEST=OFF ..
1212
make -j "$(nproc)"
13-
make install
13+
sudo make install || make install
1414
cd /
1515
rm -rf "${TMP_DIR}"
1616
echo "pybind11 installed successfully"
File renamed without changes.

docker/common/manylinux-setup-pip

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/bin/bash
22
set -e
33

4+
echo "Found the following Python versions:"
5+
for PYBIN in /opt/python/*/bin; do
6+
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then
7+
echo "${PYBIN}" | cut -d / -f 4
8+
fi
9+
done
10+
411
echo "Setting up pip..."
512
for PYBIN in /opt/python/*/bin; do
613
if [[ "${PYBIN}" =~ ${PYBIN_SUPPORTED_VERSIONS} ]]; then

0 commit comments

Comments
 (0)