From af3cb230800b24cfa5fa802e9c4ce29bf922baae Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Wed, 11 Dec 2024 16:33:08 +0100 Subject: [PATCH] More documentation, add container modifications (#9) Allows to append instructions to the container, used here to install compilers. --- .github/workflows/spacktainer.yaml | 4 ++++ README.md | 3 +++ .../amd64/neurodamus-hippocampus/Dockerfile.epilogue | 3 +++ .../amd64/neurodamus-neocortex/Dockerfile.epilogue | 3 +++ .../amd64/neurodamus-thalamus/Dockerfile.epilogue | 3 +++ .../amd64/neurodamus-thalamus/spack.yaml | 8 ++++++++ 6 files changed, 24 insertions(+) create mode 100644 container_definitions/amd64/neurodamus-hippocampus/Dockerfile.epilogue create mode 100644 container_definitions/amd64/neurodamus-neocortex/Dockerfile.epilogue create mode 100644 container_definitions/amd64/neurodamus-thalamus/Dockerfile.epilogue create mode 100644 container_definitions/amd64/neurodamus-thalamus/spack.yaml diff --git a/.github/workflows/spacktainer.yaml b/.github/workflows/spacktainer.yaml index e438357..0aa0e99 100644 --- a/.github/workflows/spacktainer.yaml +++ b/.github/workflows/spacktainer.yaml @@ -74,6 +74,7 @@ jobs: # - multiscale-run - neurodamus-hippocampus - neurodamus-neocortex + - neurodamus-thalamus - system-benchmarks runs-on: - codebuild-spacktainers-tf-${{ github.run_id }}-${{ github.run_attempt }} @@ -94,6 +95,9 @@ jobs: # Triggers building the 'builder' image, otherwise it is optimized away COPY --from=builder /etc/debian_version /etc/debian_version EOF + if [[ -f Dockerfile.epilogue ]]; then + cat Dockerfile.epilogue >> Dockerfile + fi - name: build ${{ matrix.spacktainer }} uses: ./.github/actions/build_container with: diff --git a/README.md b/README.md index c73fc56..93164a1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ This repository aims to be the one-stop shop for all of our container needs. The only files you should have to edit as an end-user are located in the `container_definitions` folder. There's a subfolder per architecture (currently supported: `amd64` and `arm64`) under which both `spack.yaml` (in subdirectories) and `def` files can live. * A `spack.yaml` file file defines a Spack container - in it you can define the Spack specs as you would in a Spack environment. If you have specific requirements for dependencies, you can add `spack: packages: ...` keys to define those, again, as in a Spack environment. +* If a `Dockerfile.epilogue` is present in the container directory, it will be appended to +the auto-generated `Dockerfile`. This can be used to, e.g., include compilers in the final +container and perform other fine-tuning. * A def file defines a singularity container that will be built from an existing container on docker-hub. nexus-storage is already defined for amd64 as an example. In both cases, the filename will be used as the name of your container. In case of a YAML file, the container version will be derived from the first package in your spec. In case of a def file, the version will be the same as the tag on docker hub. diff --git a/container_definitions/amd64/neurodamus-hippocampus/Dockerfile.epilogue b/container_definitions/amd64/neurodamus-hippocampus/Dockerfile.epilogue new file mode 100644 index 0000000..8a5ff9a --- /dev/null +++ b/container_definitions/amd64/neurodamus-hippocampus/Dockerfile.epilogue @@ -0,0 +1,3 @@ +RUN apt-get update \ + && apt-get install -y gcc g++ make \ + && rm -rf /var/lib/apt/lists/* diff --git a/container_definitions/amd64/neurodamus-neocortex/Dockerfile.epilogue b/container_definitions/amd64/neurodamus-neocortex/Dockerfile.epilogue new file mode 100644 index 0000000..8a5ff9a --- /dev/null +++ b/container_definitions/amd64/neurodamus-neocortex/Dockerfile.epilogue @@ -0,0 +1,3 @@ +RUN apt-get update \ + && apt-get install -y gcc g++ make \ + && rm -rf /var/lib/apt/lists/* diff --git a/container_definitions/amd64/neurodamus-thalamus/Dockerfile.epilogue b/container_definitions/amd64/neurodamus-thalamus/Dockerfile.epilogue new file mode 100644 index 0000000..8a5ff9a --- /dev/null +++ b/container_definitions/amd64/neurodamus-thalamus/Dockerfile.epilogue @@ -0,0 +1,3 @@ +RUN apt-get update \ + && apt-get install -y gcc g++ make \ + && rm -rf /var/lib/apt/lists/* diff --git a/container_definitions/amd64/neurodamus-thalamus/spack.yaml b/container_definitions/amd64/neurodamus-thalamus/spack.yaml new file mode 100644 index 0000000..f4ab3ff --- /dev/null +++ b/container_definitions/amd64/neurodamus-thalamus/spack.yaml @@ -0,0 +1,8 @@ +spack: + specs: + - neurodamus-models model=thalamus +coreneuron+caliper + - py-neurodamus + packages: + all: + providers: + mpi: [mpich]