Skip to content
Snippets Groups Projects
Commit de60f42a authored by Corné Lukken's avatar Corné Lukken
Browse files

COB-325: Working solution, non ideal bash wrapping in cobalt build

parent 624e280b
No related branches found
No related tags found
1 merge request!5Combine new spack files + CI/CD branches
Pipeline #121544 failed
Pipeline: cobalt-installation

#121545

    ......@@ -15,13 +15,14 @@ RUN wget -O NVIDIA-driver.run https://us.download.nvidia.com/tesla/570.124.06/NV
    chmod +x NVIDIA-driver.run && \
    ./NVIDIA-driver.run -s --no-kernel-modules
    COPY ./infra/activate_cobalt ./
    COPY ./infra/activate_cobalt.sh ./
    COPY ./infra/rewrite_spack.sh ./
    RUN . ${SPACK_INSTALL_DIR}/share/spack/setup-env.sh && \
    . /etc/profile.d/modules.sh && \
    RUN bash -c "./rewrite_spack.sh && \
    . ${SPACK_INSTALL_DIR}/share/spack/setup-env.sh && \
    spack env activate ${SPACK_ENV_NAME} && \
    spack module tcl refresh -y && \
    cd cobalt && \
    . ../activate_cobalt.sh && \
    cd cobalt && \
    cmake -S. -Bgnucxx11_opt && \
    make -C gnucxx11_opt/ -j 4
    \ No newline at end of file
    make -C gnucxx11_opt/ -j 4"
    ......@@ -2,7 +2,7 @@ ARG SOURCE_IMAGE="git.astron.nl:5000/rd/cobalt-installation/ci-build-runner:late
    FROM ${SOURCE_IMAGE}
    ARG SPACK_VERSION_ARG="0.23.1"
    ARG SPACK_INSTALL_DIR_ARG="/data/cobalt/spack/latest"
    ARG SPACK_INSTALL_DIR_ARG="/data/cobalt/spack/spack-${SPACK_VERSION_ARG}"
    ARG NVIDIA_DRIVER_URL_ARG="https://us.download.nvidia.com/tesla/570.124.06/NVIDIA-Linux-x86_64-570.124.06.run"
    ENV SPACK_VERSION=${SPACK_VERSION_ARG}
    ......
    # source this file to activate the LOFAR environment and load
    # the modules needed by COBALT
    ROOT_DIR=/data/cobalt
    SPACK_VERSION=0.23.1
    GCC_VERSION=12.2.0
    ROOT_DIR="${ROOT_DIR:-/data/cobalt}"
    SPACK_VERSION="${SPACK_VERSION:-0.23.1}"
    GCC_VERSION="${GCC_VERSION:-12.2.0}"
    SPACK_DIR=${ROOT_DIR}/spack/spack-${SPACK_VERSION}
    MODULES=(
    binutils boost casacore cuda curl dal2 diffutils fftw hdf5
    binutils boost cmake casacore cuda curl dal2 diffutils fftw hdf5
    log4cplus numactl openblas openmpi py-lxml
    python unittest-cpp
    )
    ......@@ -17,7 +17,7 @@ MODULES=(
    source /etc/profile.d/modules.sh # load this explicitly for non-interactive shells
    # Load Spack environment modules
    module use ${SPACK_DIR}/opt/spack/linux-*/gcc/${GCC_VERSION}
    module use ${SPACK_DIR}/opt/spack/linux-*/gcc-${GCC_VERSION}
    module load "${MODULES[@]}"
    # Keep system libraries findable
    ......
    #!/bin/bash
    ROOT_DIR="${ROOT_DIR:-/data/cobalt}"
    SPACK_VERSION="${SPACK_VERSION:-0.23.1}"
    GCC_VERSION="${GCC_VERSION:-12.2.0}"
    PREFIXES="${ROOT_DIR}/spack/spack-$SPACK_VERSION/share/spack/modules"
    for PREFIX in $PREFIXES; do
    MODULE_DIRS="${PREFIX}/linux-*"
    for MODULE_DIR in ${MODULE_DIRS}; do
    echo "${MODULE_DIR}/gcc/${GCC_VERSION}: ${MODULE_DIR}"
    mv ${MODULE_DIR}/gcc/${GCC_VERSION}/* ${MODULE_DIR}
    done
    done
    \ No newline at end of file
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment