Skip to content

Commit

Permalink
Build PyQt5 wheel in parallel (#302)
Browse files Browse the repository at this point in the history
* Build PyQt5 wheel

* Use valid whl name

* Move openpilot_python_dependencies to earlier to avoid duplication
  • Loading branch information
robin-reckmann authored Aug 14, 2024
1 parent 4a924da commit 388c799
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Dockerfile.agnos
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ RUN /tmp/agnos/base_setup.sh
# Install openpilot dependencies
COPY ./userspace/openpilot_dependencies.sh /tmp/agnos/
RUN /tmp/agnos/openpilot_dependencies.sh
COPY ./userspace/openpilot_python_dependencies.sh /tmp/agnos/
RUN /tmp/agnos/openpilot_python_dependencies.sh

# Install old Qt 5.12.8, libwayland 1.9.0-1 and deps
COPY ./userspace/qtwayland/*.deb /tmp/agnos/
Expand All @@ -40,6 +42,10 @@ FROM agnos-base AS agnos-compiler
RUN apt-fast update && apt-fast install --no-install-recommends -yq checkinstall

# Individual compiling images
FROM agnos-compiler AS agnos-compiler-pyqt5
COPY ./userspace/compile-pyqt5.sh /tmp/agnos/
RUN /tmp/agnos/compile-pyqt5.sh

FROM agnos-compiler AS agnos-compiler-capnp
COPY ./userspace/compile-capnp.sh /tmp/agnos/
RUN /tmp/agnos/compile-capnp.sh
Expand Down Expand Up @@ -73,20 +79,20 @@ RUN /tmp/agnos/compile-modemmanager.sh
COPY --from=agnos-compiler-capnp /tmp/capnproto.deb /tmp/capnproto.deb
RUN cd /tmp && apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./capnproto.deb

COPY ./userspace/openpilot_python_dependencies.sh /tmp/agnos/
RUN /tmp/agnos/openpilot_python_dependencies.sh

# Use other pre-compiled packages
COPY --from=agnos-compiler-ffmpeg /tmp/ffmpeg.deb /tmp/ffmpeg.deb
RUN cd /tmp && apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./ffmpeg.deb

# Use pre-compiled PyQt5 wheel
COPY --from=agnos-compiler-pyqt5 /tmp/PyQt5-5.15.9/PyQt5-5.15.9-cp38-abi3-manylinux_2_17_aarch64.whl /tmp/PyQt5-5.15.9-cp38-abi3-manylinux_2_17_aarch64.whl

RUN export PATH="/usr/local/pyenv/bin:/usr/local/pyenv/shims:$PATH" && \
export PYENV_ROOT="/usr/local/pyenv" && \
eval "$(pyenv init -)" && \
eval "$(pyenv virtualenv-init -)" && \
export MAKEFLAGS="-j$(nproc)" && \
pip install pyqt5-sip==12.12.1 && \
pip install pyqt5==5.15.9 --verbose --config-settings --confirm-license= && \
pip install /tmp/PyQt5-5.15.9-cp38-abi3-manylinux_2_17_aarch64.whl --verbose --config-settings --confirm-license= && \
pyenv rehash

# Install openpilot python packages
Expand Down
16 changes: 16 additions & 0 deletions userspace/compile-pyqt5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e

# Use pyenv venv
export PATH="/usr/local/pyenv/bin:/usr/local/pyenv/shims:$PATH"
export PYENV_ROOT="/usr/local/pyenv"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# Build PyQt5 wheel
cd /tmp
wget https://files.pythonhosted.org/packages/5c/46/b4b6eae1e24d9432905ef1d4e7c28b6610e28252527cdc38f2a75997d8b5/PyQt5-5.15.9.tar.gz
tar xf PyQt5-5.15.9.tar.gz
cd PyQt5-5.15.9

export MAKEFLAGS="-j$(nproc)"
pip wheel -w . --verbose --config-settings --confirm-license= .

0 comments on commit 388c799

Please sign in to comment.