Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(ALICEVISION_ROOT "$ENV{ALICEVISION_ROOT}" CACHE STRING "AliceVision root dir
set(QT_DIR "$ENV{QT_DIR}" CACHE STRING "Qt root directory")

option(MR_BUILD_QTALICEVISION "Enable building of QtAliceVision plugin" ON)
set(QTALICEVISION_VERSION "develop" CACHE STRING "Version of the QtAliceVision plugin (default to develop)")

if(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Force CMAKE_INSTALL_DO_STRIP in Release")
Expand Down Expand Up @@ -39,7 +40,7 @@ if(MR_BUILD_QTALICEVISION)
set(QTALICEVISION_TARGET QtAliceVision)
ExternalProject_Add(${QTALICEVISION_TARGET}
GIT_REPOSITORY https://github.com/alicevision/QtAliceVision
GIT_TAG develop
GIT_TAG ${QTALICEVISION_VERSION}
PREFIX ${BUILD_DIR}
BUILD_IN_SOURCE 0
BUILD_ALWAYS 0
Expand Down
30 changes: 15 additions & 15 deletions docker/Dockerfile_rocky
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG AV_VERSION
ARG CUDA_VERSION
ARG ROCKY_VERSION
FROM alicevision/meshroom-deps:${MESHROOM_VERSION}-av${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}
ARG QTAV_VERSION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Providing a default value for QTAV_VERSION (e.g., develop) ensures that direct builds of the Dockerfile (without using the helper script) do not fail or result in an empty version string during the CMake configuration.

ARG QTAV_VERSION=develop

LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"

# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
Expand All @@ -11,12 +12,12 @@ LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"

RUN dnf install -y patchelf

ENV MESHROOM_DEV=/opt/Meshroom \
MESHROOM_BUILD=/tmp/Meshroom_build \
MESHROOM_BUNDLE=/opt/Meshroom_bundle \
AV_INSTALL=/opt/AliceVision_install \
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
PATH="${PATH}:${MESHROOM_BUNDLE}"
ENV MESHROOM_DEV=/opt/Meshroom
ENV MESHROOM_BUILD=/tmp/Meshroom_build
ENV MESHROOM_BUNDLE=/opt/Meshroom_bundle
ENV AV_INSTALL=/opt/AliceVision_install
ENV QT_DIR=/opt/Qt/6.8.3/gcc_64
ENV PATH="${PATH}:${MESHROOM_BUNDLE}"
Comment on lines +15 to +19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Splitting the environment variables into multiple ENV instructions increases the number of layers in the Docker image. It is recommended to combine them into a single ENV instruction using backslashes to keep the image metadata clean and minimize layers.

ENV MESHROOM_DEV=/opt/Meshroom \
    MESHROOM_BUILD=/tmp/Meshroom_build \
    MESHROOM_BUNDLE=/opt/Meshroom_bundle \
    AV_INSTALL=/opt/AliceVision_install \
    QT_DIR=/opt/Qt/6.8.3/gcc_64 \
    PATH="${PATH}:${MESHROOM_BUNDLE}"


COPY *.txt *.md *.py ${MESHROOM_DEV}/
COPY ./docs ${MESHROOM_DEV}/docs
Expand Down Expand Up @@ -46,7 +47,7 @@ RUN mkdir ${MESHROOM_BUNDLE}/aliceVision && \
mv /opt/AliceVision_bundle/* ${MESHROOM_BUNDLE}/aliceVision

# Build Meshroom plugins
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DQTALICEVISION_VERSION=${QTAV_VERSION} -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer to wrap ${QTAV_VERSION} in double quotes to prevent potential shell expansion or word-splitting issues if the version string contains spaces or special characters.

RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DQTALICEVISION_VERSION="${QTAV_VERSION}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"

RUN make "-j$(nproc)" QtAliceVision
RUN make "-j$(nproc)" && \
rm -rf "${MESHROOM_BUILD}" "${MESHROOM_DEV}" \
Expand All @@ -59,14 +60,13 @@ RUN make "-j$(nproc)" && \
aliceVision/share/pkgconfig

# PySide6: copy missing libQt63DQuickScene3D.so along with its dependencies to avoid runtime issues
RUN cp ${QT_DIR}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
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 && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt6Concurrent.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Animation/libQt63DAnimation.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Core/libQt63DCore.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Input/libQt63DInput.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Logic/libQt63DLogic.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Render/libQt63DRender.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs
RUN cp ${QT_DIR}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6

# cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt6Concurrent.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs &&
# cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Core/libQt63DCore.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
# cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Input/libQt63DInput.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
# cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Logic/libQt63DLogic.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
# cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Render/libQt63DRender.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Commented-out code should be removed to keep the Dockerfile clean and maintainable. If these library copies are no longer needed, please delete these lines entirely.


# Copy libOpenGL in the bundle: needed by QtAliceVision as a side effect of a Qt6 bug
RUN cp /usr/lib64/libOpenGL.so.0.0.0 ${MESHROOM_BUNDLE}/lib
Expand Down
14 changes: 7 additions & 7 deletions docker/Dockerfile_rocky_deps
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"
# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
# docker run -it --runtime=nvidia meshroom

ENV MESHROOM_DEV=/opt/Meshroom \
MESHROOM_BUILD=/tmp/Meshroom_build \
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
QT_CI_LOGIN=alicevisionjunk@gmail.com \
QT_CI_P=azerty1.
ENV MESHROOM_DEV=/opt/Meshroom
ENV MESHROOM_BUILD=/tmp/Meshroom_build
ENV QT_DIR=/opt/Qt/6.8.3/gcc_64
ENV QT_CI_LOGIN=alicevisionjunk@gmail.com
ENV QT_CI_P=azerty1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Combining these environment variables into a single ENV instruction reduces the number of layers in the Docker image.

ENV MESHROOM_DEV=/opt/Meshroom \
    MESHROOM_BUILD=/tmp/Meshroom_build \
    QT_DIR=/opt/Qt/6.8.3/gcc_64 \
    QT_CI_LOGIN=alicevisionjunk@gmail.com \
    QT_CI_P=azerty1.


# Install libs needed by Qt
RUN dnf update -y
RUN dnf update -y --nobest
RUN dnf install -y flex fontconfig freetype glib2-devel libICE
RUN dnf install -y libX11 libXext libXi libXrender libSM
RUN dnf install -y libXt-devel mesa-libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libEGL-devel
RUN dnf install -y libXt-devel mesa-libGLU-devel mesa-libGL-devel mesa-libEGL-devel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Combining the package update and installation commands into a single RUN instruction reduces the layer count. Additionally, it is highly recommended to append && dnf clean all at the end of the package installation block to remove cached metadata and package files, which significantly reduces the final image size.

RUN dnf update -y --nobest && \
    dnf install -y \
        flex \
        fontconfig \
        freetype \
        glib2-devel \
        libICE \
        libX11 \
        libXext \
        libXi \
        libXrender \
        libSM \
        libXt-devel \
        mesa-libGLU-devel \
        mesa-libGL-devel \
        mesa-libEGL-devel

RUN dnf install -y zlib-devel systemd openssh-server
RUN dnf install -y libxcb-devel \
libxkbcommon-devel \
Expand Down
4 changes: 3 additions & 1 deletion docker/build-rocky.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e
set -ex

test -z "$MESHROOM_VERSION" && MESHROOM_VERSION="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" && exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Error messages should be redirected to standard error (stderr) instead of standard output (stdout) to follow standard CLI practices.

Suggested change
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" && exit 1
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" >&2 && exit 1

test -z "$AV_VERSION" && echo "AliceVision version not specified, set AV_VERSION in the environment" && exit 1
test -z "$CUDA_VERSION" && CUDA_VERSION=12.1.1
test -z "$ROCKY_VERSION" && ROCKY_VERSION=9
Expand Down Expand Up @@ -33,6 +34,7 @@ docker build \
--build-arg "MESHROOM_VERSION=${MESHROOM_VERSION}" \
--build-arg "CUDA_VERSION=${CUDA_VERSION}" \
--build-arg "ROCKY_VERSION=${ROCKY_VERSION}" \
--build-arg "QTAV_VERSION=${QTAV_VERSION}" \
--build-arg "AV_VERSION=${AV_VERSION}" \
--tag "alicevision/meshroom:${MESHROOM_VERSION}-av${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}" \
-f docker/Dockerfile_rocky .
Expand Down
Loading