Sanity check your container to see that it has basic requirements for the flux operator.
$ python -m venv env
$ source env/bin/activate
$ pip install -r requirements.txt
We basically require Python with Jinja2.
And run the check.
Here is an example with one of our containers that doesn't require load of any special environment:
$ python ./scripts/check.py ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
preCommand: None
time: False
⚙️ Pulling ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
flux-sched-focal-v0.24.0: Pulling from rse-ops/lammps
Digest: sha256:fadec2d6bdacd5c10ab010ee3cf24f0a64065337eb801004fde70dd5c2dd931d
Status: Image is up to date for ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
Container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
🟢️ Found active user root
🟢️ sudo is installed
🟢️ flux is installed
A dummy example with pre-command:
$ python ./scripts/check.py ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0 --pre-command ./example/dummy.txt
container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
preCommand: ./example/dummy.txt
time: False
⚙️ Pulling ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
flux-sched-focal-v0.24.0: Pulling from rse-ops/lammps
Digest: sha256:fadec2d6bdacd5c10ab010ee3cf24f0a64065337eb801004fde70dd5c2dd931d
Status: Image is up to date for ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
The present working directory...
/home/flux/examples/reaxff/HNS
Preparing environment...
Container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
🟢️ Found active user root
🟢️ sudo is installed
🟢️ flux is installed
And an example of a container that requires a pre command block to load a spack environment (
$ python ./scripts/check.py ghcr.io/rse-ops/spack-ubuntu-libfabric-ssh:ubuntu-20.04 --pre-command ./example/preCommand.txt
A container that will allow multi-user mode needs openssl. This should ship with Flux.
$ python ./scripts/check.py ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0 --multi-user
...
ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
Container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
🟢️ Found active user root
🟢️ sudo is installed
🟢️ flux is installed
🟢️ openssl is installed
When you set logging->timed to true, we require the time command, and we can check for that too. Here is an example without time - the check will fail:
$ python ./scripts/check.py ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0 --time
...
ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
Container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
🟢️ Found active user root
🟢️ sudo is installed
🟢️ flux is installed
🔴️ time not found
Now if we add the install into a pre-command (which we could also do for the Flux Operator) it will pass.
$ python ./scripts/check.py ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0 --time --pre-command ./example/install-time.txt
container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
preCommand: ./example/install-time.txt
time: True
⚙️ Pulling ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
flux-sched-focal-v0.24.0: Pulling from rse-ops/lammps
<pull and pre-command install of time here>
Container: ghcr.io/rse-ops/lammps:flux-sched-focal-v0.24.0
🟢️ Found active user root
🟢️ sudo is installed
🟢️ flux is installed
🟢️ time is installed
❔️ Would you like to see this as a GitHub action? Let us know!