Skip to content

Commit

Permalink
[jenkins] Synchronize Dockerfile.build and Jenkinsfile with latest ap…
Browse files Browse the repository at this point in the history
…p4triqs/notriqs
  • Loading branch information
Wentzell committed Dec 5, 2023
1 parent d6ac6cc commit 55ed32d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARG APPNAME=nda
COPY requirements.txt /src/$APPNAME/requirements.txt
RUN pip3 install -r /src/$APPNAME/requirements.txt

RUN useradd -u 990 -m build
ARG BUILDUID=983
RUN useradd -u $BUILDUID -m build

ENV SRC=/src \
BUILD=/home/build \
Expand All @@ -19,6 +20,7 @@ RUN chown build .
USER build
ARG BUILD_ID
ARG CMAKE_ARGS
RUN cmake $SRC/$APPNAME -DCMAKE_INSTALL_PREFIX=$INSTALL -DCLANG_OPT="$CXXFLAGS" $CMAKE_ARGS && make -j4 || make -j1 VERBOSE=1
ARG NCORES=4
RUN cmake $SRC/$APPNAME -DCMAKE_INSTALL_PREFIX=$INSTALL -DCLANG_OPT="$CXXFLAGS" $CMAKE_ARGS && make -j$NCORES || make -j1 VERBOSE=1
USER root
RUN make install
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
args = '-DBuild_Documentation=1 -DMATHJAX_PATH=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2'
else if (platform == "sanitize")
args = '-DASAN=ON -DUBSAN=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo'
def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' .")
def uid = sh(returnStdout: true, script: "id -u").trim()
def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' --build-arg BUILDUID=${uid} .")
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
img.inside("--shm-size=4gb") {
sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1"
Expand Down

0 comments on commit 55ed32d

Please sign in to comment.