| 1 |
ARG MESHROOM_VERSION |
| 2 |
ARG AV_VERSION |
| 3 |
ARG CUDA_VERSION |
| 4 |
ARG ROCKY_VERSION |
| 5 |
FROM alicevision/meshroom-deps:${MESHROOM_VERSION}-av${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION} |
| 6 |
LABEL maintainer="AliceVision Team [email protected]" |
| 7 |
|
| 8 |
# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)) |
| 9 |
# docker run -it --runtime nvidia -p 2222:22 --name meshroom -v</path/to/your/data>:/data alicevision/meshroom:develop-av2.2.8.develop-ubuntu20.04-cuda11.0 |
| 10 |
# ssh -p 2222 -X root@<docker host> /opt/Meshroom_bundle/Meshroom # Password is 'meshroom' |
| 11 |
|
| 12 |
RUN dnf install -y patchelf |
| 13 |
|
| 14 |
ENV MESHROOM_DEV=/opt/Meshroom \ |
| 15 |
MESHROOM_BUILD=/tmp/Meshroom_build \ |
| 16 |
MESHROOM_BUNDLE=/opt/Meshroom_bundle \ |
| 17 |
AV_INSTALL=/opt/AliceVision_install \ |
| 18 |
QT_DIR=/opt/Qt/6.8.3/gcc_64 \ |
| 19 |
PATH="${PATH}:${MESHROOM_BUNDLE}" |
| 20 |
|
| 21 |
COPY *.txt *.md *.py ${MESHROOM_DEV}/ |
| 22 |
COPY ./docs ${MESHROOM_DEV}/docs |
| 23 |
COPY ./meshroom ${MESHROOM_DEV}/meshroom |
| 24 |
COPY ./tests ${MESHROOM_DEV}/tests |
| 25 |
COPY ./bin ${MESHROOM_DEV}/bin |
| 26 |
|
| 27 |
WORKDIR ${MESHROOM_DEV} |
| 28 |
|
| 29 |
# Generate the exe for Meshroom and clean-up the bundle folder |
| 30 |
RUN python setup.py install_exe -d "${MESHROOM_BUNDLE}" && \ |
| 31 |
find ${MESHROOM_BUNDLE} -name "*Qt6Web*" -delete && \ |
| 32 |
find ${MESHROOM_BUNDLE} -name "*Qt6Designer*" -delete && \ |
| 33 |
rm -rf ${MESHROOM_BUNDLE}/lib/PySide6/typesystems/ \ |
| 34 |
${MESHROOM_BUNDLE}/lib/PySide6/examples/ \ |
| 35 |
${MESHROOM_BUNDLE}/lib/PySide6/include/ \ |
| 36 |
${MESHROOM_BUNDLE}/lib/PySide6/Qt/translations/ \ |
| 37 |
${MESHROOM_BUNDLE}/lib/PySide6/Qt/resources/ \ |
| 38 |
${MESHROOM_BUNDLE}/lib/PySide6/QtWeb* \ |
| 39 |
${MESHROOM_BUNDLE}/lib/PySide6/rcc \ |
| 40 |
${MESHROOM_BUNDLE}/lib/PySide6/designer |
| 41 |
|
| 42 |
WORKDIR ${MESHROOM_BUILD} |
| 43 |
|
| 44 |
# Move the bundled installation of AliceVision into Meshroom's bundle |
| 45 |
RUN mkdir ${MESHROOM_BUNDLE}/aliceVision && \ |
| 46 |
mv /opt/AliceVision_bundle/* ${MESHROOM_BUNDLE}/aliceVision |
| 47 |
|
| 48 |
# Build Meshroom plugins |
| 49 |
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins" |
| 50 |
RUN make "-j$(nproc)" QtAliceVision |
| 51 |
RUN make "-j$(nproc)" && \ |
| 52 |
rm -rf "${MESHROOM_BUILD}" "${MESHROOM_DEV}" \ |
| 53 |
${MESHROOM_BUNDLE}/aliceVision/share/doc \ |
| 54 |
${MESHROOM_BUNDLE}/aliceVision/share/eigen3 \ |
| 55 |
${MESHROOM_BUNDLE}/aliceVision/share/fonts \ |
| 56 |
${MESHROOM_BUNDLE}/aliceVision/share/lemon \ |
| 57 |
${MESHROOM_BUNDLE}/aliceVision/share/libraw \ |
| 58 |
${MESHROOM_BUNDLE}/aliceVision/share/man/ \ |
| 59 |
aliceVision/share/pkgconfig |
| 60 |
|
| 61 |
# PySide6: copy missing libQt63DQuickScene3D.so along with its dependencies to avoid runtime issues |
| 62 |
RUN cp ${QT_DIR}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 63 |
mv ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6 && \ |
| 64 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt6Concurrent.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 65 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Animation/libQt63DAnimation.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 66 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Core/libQt63DCore.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 67 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Input/libQt63DInput.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 68 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Logic/libQt63DLogic.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \ |
| 69 |
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Render/libQt63DRender.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs |
| 70 |
|
| 71 |
# Copy libOpenGL in the bundle: needed by QtAliceVision as a side effect of a Qt6 bug |
| 72 |
RUN cp /usr/lib64/libOpenGL.so.0.0.0 ${MESHROOM_BUNDLE}/lib |
| 73 |
RUN mv ${MESHROOM_BUNDLE}/lib/libOpenGL.so.0.0.0 ${MESHROOM_BUNDLE}/lib/libOpenGL.so.0 |
| 74 |
|
| 75 |
# Enable SSH X11 forwarding, needed when the Docker image |
| 76 |
# is run on a remote machine |
| 77 |
RUN dnf install -y openssh openssh-clients openssh-server xorg-x11-xauth |
| 78 |
RUN systemctl enable sshd && \ |
| 79 |
mkdir -p /run/sshd && \ |
| 80 |
ssh-keygen -A |
| 81 |
|
| 82 |
RUN sed -i "s/^.*X11Forwarding.*$/X11Forwarding yes/; s/^.*X11UseLocalhost.*$/X11UseLocalhost no/; s/^.*PermitRootLogin prohibit-password/PermitRootLogin yes/; s/^.*X11UseLocalhost.*/X11UseLocalhost no/;" /etc/ssh/sshd_config |
| 83 |
RUN echo "root:meshroom" | chpasswd |
| 84 |
|
| 85 |
WORKDIR /root |
| 86 |
|
| 87 |
EXPOSE 22 |
| 88 |
CMD ["/usr/sbin/sshd", "-D"] |
| 89 |
|