Skip to content

Commit 517a64d

Browse files
authored
Merge pull request #2626 from alicevision/build/rockyDocker
[docker] Add Dockerfiles for Rocky 9 and handle Qt 6 installation
2 parents d137c08 + 650d4d1 commit 517a64d

13 files changed

+221
-261
lines changed

docker/Dockerfile_centos

Lines changed: 0 additions & 79 deletions
This file was deleted.

docker/Dockerfile_centos_deps

Lines changed: 0 additions & 67 deletions
This file was deleted.

docker/Dockerfile_rocky

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
RUN python setup.py install_exe -d "${MESHROOM_BUNDLE}" && \
30+
find ${MESHROOM_BUNDLE} -name "*Qt6Web*" -delete && \
31+
find ${MESHROOM_BUNDLE} -name "*Qt6Designer*" -delete && \
32+
rm -rf ${MESHROOM_BUNDLE}/lib/PySide6/typesystems/ \
33+
${MESHROOM_BUNDLE}/lib/PySide6/examples/ \
34+
${MESHROOM_BUNDLE}/lib/PySide6/include/ \
35+
${MESHROOM_BUNDLE}/lib/PySide6/Qt/translations/ \
36+
${MESHROOM_BUNDLE}/lib/PySide6/Qt/resources/ \
37+
${MESHROOM_BUNDLE}/lib/PySide6/QtWeb* \
38+
${MESHROOM_BUNDLE}/lib/PySide6/rcc \
39+
${MESHROOM_BUNDLE}/lib/PySide6/designer
40+
41+
WORKDIR ${MESHROOM_BUILD}
42+
43+
# Build Meshroom plugins
44+
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"
45+
RUN make "-j$(nproc)" QtAliceVision
46+
RUN make "-j$(nproc)" && \
47+
rm -rf "${MESHROOM_BUILD}" "${MESHROOM_DEV}" \
48+
${MESHROOM_BUNDLE}/aliceVision/share/doc \
49+
${MESHROOM_BUNDLE}/aliceVision/share/eigen3 \
50+
${MESHROOM_BUNDLE}/aliceVision/share/fonts \
51+
${MESHROOM_BUNDLE}/aliceVision/share/lemon \
52+
${MESHROOM_BUNDLE}/aliceVision/share/libraw \
53+
${MESHROOM_BUNDLE}/aliceVision/share/man/ \
54+
aliceVision/share/pkgconfig
55+
56+
# Enable SSH X11 forwarding, needed when the Docker image
57+
# is run on a remote machine
58+
RUN dnf install -y openssh openssh-clients openssh-server xorg-x11-xauth
59+
RUN systemctl enable sshd && \
60+
mkdir -p /run/sshd && \
61+
ssh-keygen -A
62+
63+
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
64+
RUN echo "root:meshroom" | chpasswd
65+
66+
WORKDIR /root
67+
68+
EXPOSE 22
69+
CMD ["/usr/sbin/sshd", "-D"]
70+

docker/Dockerfile_rocky_deps

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ARG AV_VERSION
2+
ARG CUDA_VERSION
3+
ARG ROCKY_VERSION
4+
FROM alicevision/alicevision:${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}
5+
LABEL maintainer="AliceVision Team [email protected]"
6+
7+
# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
8+
# docker run -it --runtime=nvidia meshroom
9+
10+
ENV MESHROOM_DEV=/opt/Meshroom \
11+
MESHROOM_BUILD=/tmp/Meshroom_build \
12+
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
13+
14+
QT_CI_P=azerty1.
15+
16+
# Install libs needed by Qt
17+
RUN dnf update -y
18+
RUN dnf install -y flex fontconfig freetype glib2-devel libICE
19+
RUN dnf install -y libX11 libXext libXi libXrender libSM
20+
RUN dnf install -y libXt-devel mesa-libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libEGL-devel
21+
RUN dnf install -y zlib-devel systemd openssh-server
22+
RUN dnf install -y libxcb-devel \
23+
libxkbcommon-devel \
24+
libxkbcommon-x11-devel \
25+
xcb-util-wm xcb-util-image \
26+
xcb-util-keysyms \
27+
xcb-util-renderutil
28+
29+
# Install Qt (to build plugins)
30+
WORKDIR /tmp/qt
31+
COPY dl/qt.run /tmp/qt
32+
RUN chmod +x qt.run
33+
RUN ./qt.run --verbose --email ${QT_CI_LOGIN} --password ${QT_CI_P} --accept-obligations --accept-licenses \
34+
--default-answer --platform minimal --auto-answer installationErrorWithCancel=Ignore --no-force-installations --no-default-installations --confirm-command \
35+
install qt.qt6.683.linux_gcc_64 qt.qt6.683.addons.qtcharts qt.qt6.683.addons.qt3d
36+
RUN rm qt.run
37+
38+
# Strip sections containing ".note.ABI.tag" from .so: https://github.com/Microsoft/WSL/issues/3023
39+
RUN find ${QT_DIR}/lib/ -name '*.so' | xargs strip --remove-section=.note.ABI-tag
40+
41+
COPY ./*requirements.txt ./setup.py ${MESHROOM_DEV}/
42+
43+
# Install Meshroom requirements and freeze bundle
44+
WORKDIR "${MESHROOM_DEV}"
45+
RUN python -m pip install -r dev_requirements.txt -r requirements.txt

docker/Dockerfile_ubuntu

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ ENV MESHROOM_DEV=/opt/Meshroom \
1313
MESHROOM_BUILD=/tmp/Meshroom_build \
1414
MESHROOM_BUNDLE=/opt/Meshroom_bundle \
1515
AV_INSTALL=/opt/AliceVision_install \
16-
QT_DIR=/opt/Qt/5.15.2/gcc_64 \
17-
PATH="${PATH}:${MESHROOM_BUNDLE}" \
18-
OPENIMAGEIO_LIBRARY=/opt/AliceVision_install/lib
16+
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
17+
PATH="${PATH}:${MESHROOM_BUNDLE}"
1918

2019
COPY *.txt *.md *.py ${MESHROOM_DEV}/
2120
COPY ./docs ${MESHROOM_DEV}/docs
@@ -25,18 +24,17 @@ COPY ./bin ${MESHROOM_DEV}/bin
2524

2625
WORKDIR ${MESHROOM_DEV}
2726

28-
RUN python3 setup.py install_exe -d "${MESHROOM_BUNDLE}" && \
29-
find ${MESHROOM_BUNDLE} -name "*Qt5Web*" -delete && \
30-
find ${MESHROOM_BUNDLE} -name "*Qt5Designer*" -delete && \
31-
rm -rf ${MESHROOM_BUNDLE}/lib/PySide2/typesystems/ \
32-
${MESHROOM_BUNDLE}/lib/PySide2/examples/ \
33-
${MESHROOM_BUNDLE}/lib/PySide2/include/ \
34-
${MESHROOM_BUNDLE}/lib/PySide2/Qt/translations/ \
35-
${MESHROOM_BUNDLE}/lib/PySide2/Qt/resources/ \
36-
${MESHROOM_BUNDLE}/lib/PySide2/QtWeb* \
37-
${MESHROOM_BUNDLE}/lib/PySide2/pyside2-lupdate \
38-
${MESHROOM_BUNDLE}/lib/PySide2/rcc \
39-
${MESHROOM_BUNDLE}/lib/PySide2/designer
27+
RUN python setup.py install_exe -d "${MESHROOM_BUNDLE}" && \
28+
find ${MESHROOM_BUNDLE} -name "*Qt6Web*" -delete && \
29+
find ${MESHROOM_BUNDLE} -name "*Qt6Designer*" -delete && \
30+
rm -rf ${MESHROOM_BUNDLE}/lib/PySide6/typesystems/ \
31+
${MESHROOM_BUNDLE}/lib/PySide6/examples/ \
32+
${MESHROOM_BUNDLE}/lib/PySide6/include/ \
33+
${MESHROOM_BUNDLE}/lib/PySide6/Qt/translations/ \
34+
${MESHROOM_BUNDLE}/lib/PySide6/Qt/resources/ \
35+
${MESHROOM_BUNDLE}/lib/PySide6/QtWeb* \
36+
${MESHROOM_BUNDLE}/lib/PySide6/rcc \
37+
${MESHROOM_BUNDLE}/lib/PySide6/designer
4038

4139
WORKDIR ${MESHROOM_BUILD}
4240

@@ -53,9 +51,6 @@ RUN make "-j$(nproc)" && \
5351
${MESHROOM_BUNDLE}/aliceVision/share/man/ \
5452
aliceVision/share/pkgconfig
5553

56-
# Copy missing libassimpsceneimport.so
57-
COPY dl/libassimpsceneimport.so ${MESHROOM_BUNDLE}/lib/PySide2/Qt/plugins/sceneparsers
58-
5954
# Enable SSH X11 forwarding, needed when the Docker image
6055
# is run on a remote machine
6156
RUN apt install ssh xauth && \
@@ -69,4 +64,3 @@ WORKDIR /root
6964

7065
EXPOSE 22
7166
CMD ["/usr/sbin/sshd", "-D"]
72-

docker/Dockerfile_ubuntu_deps

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ LABEL maintainer="AliceVision Team [email protected]"
99

1010
ENV MESHROOM_DEV=/opt/Meshroom \
1111
MESHROOM_BUILD=/tmp/Meshroom_build \
12-
QT_DIR=/opt/Qt/5.15.2/gcc_64 \
12+
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
1313
1414
QT_CI_P=azerty1.
1515

16-
# Workaround for QtAliceVision builds: fuse lib/lib64 folders
17-
#RUN ln -s ${AV_INSTALL}/lib ${AV_INSTALL}/lib64
18-
1916
# Install libs needed by Qt
2017
RUN apt-get update && \
2118
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
@@ -29,38 +26,50 @@ RUN apt-get update && \
2926
libxext6 \
3027
libxi6 \
3128
libxrender1 \
32-
libsm6 \
29+
libsm6
30+
31+
RUN apt-get update && \
32+
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
3333
libxt-dev \
34-
libglu-dev \
3534
libosmesa-dev \
3635
libgl-dev \
36+
libegl-dev \
3737
libglu-dev \
38-
libqt5charts5-dev \
38+
libxkbcommon-x11-0 \
39+
libz-dev \
40+
systemd \
41+
ssh
42+
43+
RUN apt-get update && \
44+
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
45+
libxcb1-dev \
46+
libxcb-icccm4 \
47+
libxcb-render-util0 \
48+
libxcb-shape0 \
3949
libxcb-keysyms1 \
4050
libxcb-image0 \
41-
libxkbcommon-x11-0 \
42-
libz-dev \
43-
systemd \
44-
ssh
51+
libxkbcommon-dev
4552

4653
RUN apt-get install -y --no-install-recommends \
4754
software-properties-common
4855

4956
# Install Python3
50-
RUN apt install python3-pip -y && pip3 install --upgrade pip
57+
# RUN apt install python3-pip -y && pip3 install --upgrade pip
5158

5259
# Install Qt (to build plugins)
5360
WORKDIR /tmp/qt
5461
COPY dl/qt.run /tmp/qt
5562
RUN chmod +x qt.run
5663
RUN ./qt.run --verbose --email ${QT_CI_LOGIN} --password ${QT_CI_P} --accept-obligations --accept-licenses \
57-
--default-answer --platform minimal --no-force-installations --no-default-installations --confirm-command \
58-
install qt.qt5.5152.gcc_64 qt.qt5.5152.qtcharts qt.qt5.5152.qtcharts.gcc_64
64+
--default-answer --platform minimal --auto-answer installationErrorWithCancel=Ignore --no-force-installations --no-default-installations --confirm-command \
65+
install qt.qt6.683.linux_gcc_64 qt.qt6.683.addons.qtcharts qt.qt6.683.addons.qt3d
5966
RUN rm qt.run
6067

68+
# Strip sections containing ".note.ABI.tag" from .so: https://github.com/Microsoft/WSL/issues/3023
69+
RUN find ${QT_DIR}/lib/ -name '*.so' | xargs strip --remove-section=.note.ABI-tag
70+
6171
COPY ./*requirements.txt ./setup.py ${MESHROOM_DEV}/
6272

6373
# Install Meshroom requirements and freeze bundle
6474
WORKDIR "${MESHROOM_DEV}"
65-
RUN pip install -r dev_requirements.txt -r requirements.txt
66-
75+
RUN python -m pip install -r dev_requirements.txt -r requirements.txt

0 commit comments

Comments
 (0)