Docker (Podman) and Apptainer containers are available for the most recent psana environments.


Docker (OCI)

The Docker container images can be found on GitHub (temporarily in my personal account - Valerio):

https://hub.docker.com/u/valmar

Four images are available

  • ana: the latest LCLS-I psana environment, the full environment as available on S3DF
  • ana-mini: a minimal LCLS-I psana environment, enough to make the psana python modules and commands work, but with no additional packages
  • ps: the latest LCLS-II psana environment, the full environment as available on S3DF
  • ps-mini: a minimal LCLS-II psana environment, enough to make the psana python modules and commands work, but with no additional packages

For each image, the latest tag points to the most recent version of the image. Older versions of the image are tagged with the corresponding psana environment version.

Apttainer (Singularity)

The Apptainer images corresponding to the OCI containers are available on S3DF in the following directory:

/sdf/group/lcls/ds/tools/singularity_images 

Each Apptainer image is created starting from the corresponding OCI container.


Running the Apptainer containers

The Apptainer containers can be used to execute scripts and commands using the apptainer run command. All containers require the directory containing all the LCLS data (for example, the directory /sdf/data/lcls/ds  on S3DF) to be mounted inside the running container at /data , using the bind option.

For example, to run a psana1 script in an Apptainer container on S3DF one could use the following command:

apptainer run   --bind /sdf/data/lcls/ds:/data /sdf/group/lcls/ds/tools/singularity_images/ana-4.0.58-py3.sif  python <psana python script>


Creating the containers

Containers should be created using the `podman` executable on the S3DF psana interactive nodes, and the support files stored in the following repository:

https://github.com/slac-lcls/psana-container-maker

For each environment, a file generated by the `conda list --explicit` command is needed to create the container. 

The OCI (Docker) container can be created using the following command (from the root of this repository):

podman build -t <tag> --build-arg=conda_env=<env name (env file without extension) -f Dockerfile

For example:

podman build -t valmar/ana-mini:4.0.58-py3-mini --build-arg=conda_env=ana-4.0.58-py3-mini -f Dockerfile

This example command creates a container based on the `ana-4.0.48-py3-mini.txt` file and tags it as `valmar/ana-mini:4.0.58-py3-mini`

Note: This repository contains conda environment files for current and past psana environments. Please keep it updated with files for the new environments as they are created.


Tips and Tricks

  • The following command can be used to lunch an interactive shell within an Apptainer container:

    apptainer run   --bind /sdf/data/lcls/ds:/data <path to container's sif file> /bin/bash


  • No labels