|
| 1 | +spack: |
| 2 | + concretizer: |
| 3 | + unify: true |
| 4 | + |
| 5 | + config: |
| 6 | + checksum: false |
| 7 | + build_jobs: 2 |
| 8 | + connect_timeout: 60 |
| 9 | + |
| 10 | + compilers: |
| 11 | + - compiler: |
| 12 | + spec: gcc@11.4.0 |
| 13 | + paths: |
| 14 | + cc: /usr/bin/gcc |
| 15 | + cxx: /usr/bin/g++ |
| 16 | + f77: /usr/bin/gfortran |
| 17 | + fc: /usr/bin/gfortran |
| 18 | + flags: {} |
| 19 | + operating_system: ubuntu24.04 |
| 20 | + modules: [] |
| 21 | + environment: {} |
| 22 | + extra_rpaths: [] |
| 23 | + |
| 24 | + # Basic package config from configs/common/packages.yaml |
| 25 | + # Additional package config for container |
| 26 | + packages: |
| 27 | + all: |
| 28 | + require: '%gcc' |
| 29 | + target: [x86_64] |
| 30 | + providers: |
| 31 | + mpi: [openmpi@5.0.5] |
| 32 | + compiler: [gcc@11.4.0] |
| 33 | + gcc: |
| 34 | + buildable: false |
| 35 | + externals: |
| 36 | + - spec: gcc@11.4.0 |
| 37 | + prefix: /usr |
| 38 | + gcc-runtime: |
| 39 | + buildable: false |
| 40 | + externals: |
| 41 | + - spec: gcc-runtime@11.4.0 |
| 42 | + prefix: /usr |
| 43 | + diffutils: |
| 44 | + buildable: false |
| 45 | + externals: |
| 46 | + - spec: diffutils@3.8 |
| 47 | + prefix: /usr |
| 48 | + git: |
| 49 | + buildable: false |
| 50 | + externals: |
| 51 | + - spec: git@2.34.1~tcltk |
| 52 | + prefix: /usr |
| 53 | + git-lfs: |
| 54 | + buildable: false |
| 55 | + externals: |
| 56 | + - spec: git-lfs@3.0.2 |
| 57 | + prefix: /usr |
| 58 | + llvm: |
| 59 | + buildable: false |
| 60 | + externals: |
| 61 | + - spec: llvm@14.0.6 |
| 62 | + prefix: /usr |
| 63 | + mysql: |
| 64 | + buildable: false |
| 65 | + externals: |
| 66 | + - spec: mysql@8.0.40 |
| 67 | + prefix: /usr |
| 68 | + qt: |
| 69 | + buildable: false |
| 70 | + externals: |
| 71 | + - spec: qt@5.15.3 |
| 72 | + prefix: /usr |
| 73 | + version: [5.15.3] |
| 74 | + wget: |
| 75 | + buildable: false |
| 76 | + externals: |
| 77 | + - spec: wget@1.21.2 |
| 78 | + prefix: /usr |
| 79 | + |
| 80 | + specs: [] |
| 81 | + |
| 82 | + container: |
| 83 | + |
| 84 | + # Select the format of the recipe e.g. docker, |
| 85 | + # singularity or anything else that is currently supported |
| 86 | + format: docker |
| 87 | + # How to use: |
| 88 | + #$ spack containerize > Dockerfile |
| 89 | + #$ sudo docker build -t myimage . |
| 90 | + #$ sudo docker run -it myimage |
| 91 | + |
| 92 | + #format: singularity |
| 93 | + # How to use: |
| 94 | + #$ spack containerize > singularity.def |
| 95 | + #$ sudo singularity build singularity.sif singularity.def |
| 96 | + |
| 97 | + # Sets the base images for the stages where Spack builds the |
| 98 | + # software or where the software gets installed after being built.. |
| 99 | + images: |
| 100 | + os: ubuntu:24.04 |
| 101 | + spack: |
| 102 | + url: https://github.com/jcsda/spack |
| 103 | + ref: spack-stack-dev |
| 104 | + resolve_sha: true |
| 105 | + |
| 106 | + # Whether or not to strip binaries |
| 107 | + strip: false |
| 108 | + |
| 109 | + ## Additional system packages that are needed at runtime |
| 110 | + os_packages: |
| 111 | + build: |
| 112 | + - bc |
| 113 | + - cpp-11 |
| 114 | + - g++-11 |
| 115 | + - gcc-11 |
| 116 | + - gfortran-11 |
| 117 | + - git |
| 118 | + - git-lfs |
| 119 | + - llvm-14 |
| 120 | + - make |
| 121 | + - mysql-server |
| 122 | + - qtbase5-dev |
| 123 | + - qt5-qmake |
| 124 | + - libqt5svg5-dev |
| 125 | + - qt5dxcb-plugin |
| 126 | + - wget |
| 127 | + |
| 128 | + final: |
| 129 | + - bc |
| 130 | + - cpp-11 |
| 131 | + - g++-11 |
| 132 | + - gcc-11 |
| 133 | + - gfortran-11 |
| 134 | + - git |
| 135 | + - git-lfs |
| 136 | + - llvm-14 |
| 137 | + - make |
| 138 | + - mysql-server |
| 139 | + - qtbase5-dev |
| 140 | + - qt5-qmake |
| 141 | + - libqt5svg5-dev |
| 142 | + - qt5dxcb-plugin |
| 143 | + - wget |
| 144 | + - ca-certificates |
| 145 | + - curl |
| 146 | + - file |
| 147 | + - gnupg2 |
| 148 | + - iproute2 |
| 149 | + - locales |
| 150 | + - unzip |
| 151 | + - vim |
| 152 | + - nano |
| 153 | + - less |
| 154 | + |
| 155 | + # Extra instructions |
| 156 | + extra_instructions: |
| 157 | + pre_build: | |
| 158 | + # Copy the spack-stack extension repo into the spack code |
| 159 | + COPY spack-ext-SPACK_STACK_HASH/repos/spack-stack $SPACK_ROOT/var/spack/repos/spack-stack |
| 160 | + # Register spack-stack extension repo |
| 161 | + RUN spack repo add $SPACK_ROOT/var/spack/repos/spack-stack --scope defaults && \ |
| 162 | + update-alternatives --remove-all cpp && \ |
| 163 | + update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 100 && \ |
| 164 | + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && \ |
| 165 | + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \ |
| 166 | + update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-11 100 && \ |
| 167 | + # Needed by py-llvmlite |
| 168 | + update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-14 100 |
| 169 | + pre_final: | |
| 170 | + # Set environment variables for installing tzdata |
| 171 | + ENV DEBIAN_FRONTEND=noninteractive |
| 172 | + ENV TZ=Etc/UTC |
| 173 | + ENV CC=gcc |
| 174 | + ENV CXX=g++ |
| 175 | + ENV FC=gfortran |
| 176 | + build: | |
| 177 | + # Put output of spack find into a file |
| 178 | + RUN cd /opt/spack-environment && \ |
| 179 | + spack env activate -d . && \ |
| 180 | + spack find 2>&1 | tee /root/spack_find.out |
| 181 | + final: | |
| 182 | + # Copy spack find output from builder |
| 183 | + COPY --from=builder /root/spack_find.out /root/spack_find.out |
| 184 | + # Make a non-root user:nonroot / group:nonroot for running MPI |
| 185 | + RUN useradd -U -k /etc/skel -s /bin/bash -d /home/nonroot -m nonroot --uid 43891 && \ |
| 186 | + echo "ulimit -s unlimited" >> /home/nonroot/.bashrc && \ |
| 187 | + echo "ulimit -v unlimited" >> /home/nonroot/.bashrc && \ |
| 188 | + echo "export CC=gcc" >> /home/nonroot/.bashrc && \ |
| 189 | + echo "export CXX=g++" >> /home/nonroot/.bashrc && \ |
| 190 | + echo "export FC=gfortran" >> /home/nonroot/.bashrc && \ |
| 191 | + update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 100 && \ |
| 192 | + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && \ |
| 193 | + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && \ |
| 194 | + update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-11 100 && \ |
| 195 | + # Needed by py-llvmlite |
| 196 | + update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-14 100 && \ |
| 197 | + printf "[credential]\n helper = cache --timeout=7200\n" >> /home/nonroot/.gitconfig && \ |
| 198 | + mkdir /home/nonroot/.pmix && \ |
| 199 | + echo "rmaps_default_mapping_policy=:oversubscribe" >> /home/nonroot/.pmix/mca-params.conf && \ |
| 200 | + chown -R nonroot:nonroot /home/nonroot/.gitconfig /home/nonroot/.pmix |
| 201 | + # Replicate settings for root user |
| 202 | + RUN echo "ulimit -s unlimited" >> /root/.bashrc && \ |
| 203 | + echo "ulimit -v unlimited" >> /root/.bashrc && \ |
| 204 | + echo "export CC=gcc" >> /root/.bashrc && \ |
| 205 | + echo "export CXX=g++" >> /root/.bashrc && \ |
| 206 | + echo "export FC=gfortran" >> /root/.bashrc && \ |
| 207 | + printf "[credential]\n helper = cache --timeout=7200\n" >> /root/.gitconfig && \ |
| 208 | + mkdir /root/.pmix && \ |
| 209 | + echo "rmaps_default_mapping_policy=:oversubscribe" >> /root/.pmix/mca-params.conf |
| 210 | + # Also set necessary environment variables for openmpi and jedi-cmake. |
| 211 | + RUN echo "export OMPI_ALLOW_RUN_AS_ROOT=1" >> /root/.bashrc && \ |
| 212 | + echo "export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" >> /root/.bashrc && \ |
| 213 | + echo "export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe" >> /root/.bashrc && \ |
| 214 | + echo "export jedi_cmake_ROOT=$(ls -d /opt/software/linux-ubuntu*/gcc-*/jedi-cmake-*)" >> /root/.bashrc |
| 215 | +
|
| 216 | + # Labels for the image |
| 217 | + labels: |
| 218 | + app: "" |
| 219 | + mpi: "openmpi" |
0 commit comments