Skip to content

Commit

Permalink
Improve docker image build in armhf RaspberryPI OS architecture (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrceyhun authored Sep 23, 2024
1 parent a6c906c commit d28c41f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docker/local_history_service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ RUN apk add --no-cache \
bash \
build-base \
make \
cmake \
musl-dev \
dpkg \
elogind-dev \
python3-dev \
py3-gobject3 \
Expand Down
2 changes: 2 additions & 0 deletions docker/rtc_service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RUN apk add --no-cache \
bash \
build-base \
make \
cmake \
musl-dev \
dpkg \
elogind-dev \
python3-dev \
py3-gobject3 \
Expand Down
2 changes: 1 addition & 1 deletion docker/sink_service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG GATEWAY_BUILD_SHA1=unset

RUN adduser --disabled-password wirepas

RUN apk add --no-cache gcc make musl-dev elogind-dev linux-headers
RUN apk add --no-cache gcc make cmake musl-dev dpkg elogind-dev linux-headers

USER wirepas

Expand Down
2 changes: 2 additions & 0 deletions docker/transport_service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RUN apk add --no-cache \
bash \
build-base \
make \
cmake \
musl-dev \
dpkg \
elogind-dev \
python3-dev \
py3-gobject3 \
Expand Down
21 changes: 20 additions & 1 deletion python_transport/utils/generate_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ set -e
rm -r build || true
rm -r dist || true

py3clean . || true
pip install pyclean
python3 -m pyclean . || true
python3 setup.py clean --all
python3 setup.py sdist bdist_wheel

if ! command -v dpkg &>/dev/null; then
echo "dpkg could not be found!"
exit 1
fi

# In RaspberryPI, pip does not support the wheel file name suffix of linux_aarch64.whl which comes from OS architecture query to the OS itself of Python setuptools.
# Supported pip wheel file suffixes (pip compatible tags) listed using "pip debug --verbose" which doesn't include linux_aarch64 in RaspberryPI,
# and pip complains as the wheel file is not supported in this platform.
# Therefore, "linux_aarch64" file name suffix is changed with widely supported "py3-none-any" if dpkg architecture is "musl-linux-armhf"(possibly RaspberryPI).
muslv=$(dpkg --print-architecture)
if [ "$muslv" = "musl-linux-armhf" ]; then
package_name=$(ls dist/*.tar.gz)
new_whl_file=$(basename "$package_name" .tar.gz)-py3-none-any.whl
old_whl_file=$(ls dist/*.whl)
mv "$old_whl_file" "dist/${new_whl_file}"
echo "WARNING: wirepas_gateway wheel file name changed for <pip> due to ARMHF OS architecture(possibly RaspberryPI) : dist/$new_whl_file"
fi

0 comments on commit d28c41f

Please sign in to comment.