Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build PyQt5 wheel in parallel #302

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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= .