diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index ce0f5e7..ba3c76c 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -29,12 +29,20 @@ jobs: - name: Set up docker uses: docker/setup-buildx-action@v3 + - name: Login to GitHub container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and export to Docker uses: docker/build-push-action@v5 with: context: . tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }} load: true + push: true cache-from: | type=local,src=/home/runner/.buildx-cache type=registry,ref=${{ env.IMAGE_NAME }}:latest diff --git a/.gitmodules b/.gitmodules index 08bcb1b..da8d7ac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "opticks"] path = opticks - url = https://github.com/psilib/opticks.git + url = https://github.com/bnlnpps/esi-opticks.git diff --git a/Dockerfile b/Dockerfile index 754f940..cd614e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ ARG DEBIAN_FRONTEND=noninteractive # Install Spack package manager RUN apt update \ && apt install -y build-essential ca-certificates coreutils curl environment-modules gfortran git gpg lsb-release python3 python3-distutils python3-venv unzip zip \ - libglm-dev libglfw3-dev libimgui-dev libglew-dev libglu1-mesa-dev \ libssl-dev python-is-python3 \ cuda-nvcc-11-8 libcurand-dev-11-8 \ libxinerama-dev libxcursor-dev libxi-dev \ @@ -23,14 +22,21 @@ RUN echo "source /opt/spack/share/spack/setup-env.sh" > /etc/profile.d/z09_sourc SHELL ["/bin/bash", "-l", "-c"] -RUN <> /etc/profile.d/z10_load_spack_modules.sh -RUN spack module tcl loads geant4 xerces-c clhep boost cmake nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh +RUN spack module tcl loads geant4 xerces-c clhep boost cmake mesa glew glfw glm glu nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh RUN rm -fr /opt/spack/share/spack/modules/$linux-ubuntu22.04-x86_64_v3 +RUN mkdir -p /opt/bcm && curl -sL https://github.com/boost-cmake/bcm/archive/refs/heads/master.tar.gz | tar -xz --strip-components 1 -C /opt/bcm \ + && cmake -B /tmp/build/bcm -S /opt/bcm && cmake --build /tmp/build/bcm --target install + +RUN mkdir -p /opt/plog && curl -sL https://github.com/SergiusTheBest/plog/archive/refs/tags/1.1.10.tar.gz | tar -xz --strip-components 1 -C /opt/plog \ + && cmake -B /tmp/build/plog -S /opt/plog && cmake --build /tmp/build/plog --target install + # Set up non-interactive shells by sourcing all of the scripts in /et/profile.d/ RUN cat <<"EOF" > /etc/bash.nonint if [ -d /etc/profile.d ]; then @@ -81,10 +93,11 @@ ENV OPTICKS_CUDA_PREFIX=/usr/local/cuda ENV OPTICKS_OPTIX_PREFIX=${OPTIX_DIR} ENV OPTICKS_COMPUTE_CAPABILITY=89 ENV LD_LIBRARY_PATH=${OPTICKS_PREFIX}/lib:${LD_LIBRARY_PATH} -ENV PATH=${OPTICKS_PREFIX}/lib:${PATH} +ENV PATH=${OPTICKS_PREFIX}/bin:${OPTICKS_PREFIX}/lib:${PATH} ENV NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility ENV VIRTUAL_ENV_DISABLE_PROMPT=1 ENV TMP=/tmp +ENV CMAKE_PREFIX_PATH=${OPTICKS_PREFIX} WORKDIR $ESI_DIR @@ -105,5 +118,38 @@ COPY <<-"EOF" /etc/profile.d/z20_opticks.sh EOF RUN mkdir -p $OPTIX_DIR && ./NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh --skip-license --prefix=$OPTIX_DIR -RUN opticks-full + +RUN cmake -S opticks/okconf -B $OPTICKS_PREFIX/build/okconf -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/okconf --parallel $(nproc) --target install + +RUN cmake -S opticks/sysrap -B $OPTICKS_PREFIX/build/sysrap -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/sysrap --parallel $(nproc) --target install + +RUN cmake -S opticks/ana -B $OPTICKS_PREFIX/build/ana -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/ana --parallel $(nproc) --target install + +RUN cmake -S opticks/analytic -B $OPTICKS_PREFIX/build/analytic -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/analytic --parallel $(nproc) --target install + +RUN cmake -S opticks/bin -B $OPTICKS_PREFIX/build/bin -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/bin --parallel $(nproc) --target install + +RUN cmake -S opticks/CSG -B $OPTICKS_PREFIX/build/CSG -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/CSG --parallel $(nproc) --target install + +RUN cmake -S opticks/qudarap -B $OPTICKS_PREFIX/build/qudarap -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/qudarap --parallel $(nproc) --target install + +RUN cmake -S opticks/CSGOptiX -B $OPTICKS_PREFIX/build/CSGOptiX -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX -DCMAKE_BUILD_TYPE=Debug \ + && cmake --build $OPTICKS_PREFIX/build/CSGOptiX --parallel $(nproc) --target install + +RUN cmake -S opticks/gdxml -B $OPTICKS_PREFIX/build/gdxml -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/gdxml --parallel $(nproc) --target install + +RUN cmake -S opticks/u4 -B $OPTICKS_PREFIX/build/u4 -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/u4 --parallel $(nproc) --target install + +RUN cmake -S opticks/g4cx -B $OPTICKS_PREFIX/build/g4cx -DCMAKE_MODULE_PATH=$OPTICKS_HOME/cmake/Modules -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX \ + && cmake --build $OPTICKS_PREFIX/build/g4cx --parallel $(nproc) --target install + RUN rm -fr $OPTIX_DIR/* $ESI_DIR/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh diff --git a/opticks b/opticks index 7e6d017..cccab33 160000 --- a/opticks +++ b/opticks @@ -1 +1 @@ -Subproject commit 7e6d0174b87d0848479e6ccfa305fe7d771cf062 +Subproject commit cccab331822bda5308fc4f156cfe1a7be06ab674 diff --git a/tests/test_opticks.sh b/tests/test_opticks.sh index 3e7fc5d..0a5a388 100755 --- a/tests/test_opticks.sh +++ b/tests/test_opticks.sh @@ -1,6 +1,18 @@ -#!/usr/bin/env -S bash -l +#!/usr/bin/env bash + +set -e HOME=${HOME/\/root/$ESI_DIR} opticks-full-prepare -opticks-t +ctest --test-dir $OPTICKS_PREFIX/build/okconf +ctest --test-dir $OPTICKS_PREFIX/build/sysrap -E STTFTest +ctest --test-dir $OPTICKS_PREFIX/build/ana +ctest --test-dir $OPTICKS_PREFIX/build/analytic +ctest --test-dir $OPTICKS_PREFIX/build/bin +ctest --test-dir $OPTICKS_PREFIX/build/CSG -E "CSGNodeTest|CSGPrimSpecTest|CSGPrimTest|CSGFoundryTest|CSGFoundry_getCenterExtent_Test|CSGFoundry_findSolidIdx_Test|CSGNameTest|CSGTargetTest|CSGTargetGlobalTest|CSGFoundry_MakeCenterExtentGensteps_Test|CSGFoundry_getFrame_Test|CSGFoundry_getFrameE_Test|CSGFoundry_getMeshName_Test|CSGFoundryLoadTest|CSGQueryTest|CSGSimtraceTest|CSGSimtraceRerunTest|CSGSimtraceSampleTest|CSGCopyTest" +ctest --test-dir $OPTICKS_PREFIX/build/qudarap -E "QSimTest|QOpticalTest|QSim_Lifecycle_Test|QSimWithEventTest" +ctest --test-dir $OPTICKS_PREFIX/build/CSGOptiX -E CSGOptiXRenderTest +ctest --test-dir $OPTICKS_PREFIX/build/gdxml +ctest --test-dir $OPTICKS_PREFIX/build/u4 -E "U4GDMLReadTest|U4RandomTest|U4TraverseTest" +ctest --test-dir $OPTICKS_PREFIX/build/g4cx -E G4CXRenderTest