|
| 1 | +# Check LAMMPS |
| 2 | + |
| 3 | +This will be a small experiment to: |
| 4 | + |
| 5 | +1. Generate compatiility artifacts for a few containers |
| 6 | +2. Push them to an OCI registry |
| 7 | +3. Create (design) a manifest.yaml that lists them side by side |
| 8 | +4. Test (and develop) the check tool to choose the best one (and test different modes for doing this) |
| 9 | + |
| 10 | +## 1. Generate Compatibility Artifacts |
| 11 | + |
| 12 | +Let's first choose a subset of amd64 containers. We are doing this primarily because that is my development host and I can't run anything |
| 13 | +for a different arch. These are a subset from [lammps-matrix](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix). |
| 14 | +Note that we have added a simple release workflow that generates [binaries](https://github.com/supercontainers/compspec-go/releases/tag/1-26-2024-2) |
| 15 | +that we can easily grab. |
| 16 | + |
| 17 | +```bash |
| 18 | +docker pull ghcr.io/rse-ops/lammps-matrix:intel-mpi-rocky-9-amd64 |
| 19 | +``` |
| 20 | + |
| 21 | +Let's use the [generate-artifact.sh](generate-artifact.sh) script, and inside the container, to do exactly that. Note that we have to |
| 22 | +source the /etc/profile to emulate what would happen on an entry to the container. Let's walk through how we'd do this with one container |
| 23 | +first, generating the artifact and [pushing to oras](https://oras.land/docs/how_to_guides/pushing_and_pulling/). |
| 24 | + |
| 25 | +```bash |
| 26 | +# create directory for output specs |
| 27 | +mkdir -p ./specs |
| 28 | + |
| 29 | +# arguments are the hasGpu command and the path for the artifact (relative to PWD) |
| 30 | +cmd=". /etc/profile && /tmp/data/generate-artifact.sh no /tmp/data/specs/compspec-intel-mpi-rocky-9-amd64.json" |
| 31 | +docker run -v $PWD:/tmp/data -it ghcr.io/rse-ops/lammps-matrix:intel-mpi-rocky-9-amd64 /bin/bash -c "$cmd" |
| 32 | + |
| 33 | +# This generates ./specs/compspec-intel-mpi-rocky-9-amd64.json, let's push to a registry with oras |
| 34 | +oras push ghcr.io/rse-ops/lammps-matrix:intel-mpi-rocky-9-amd64-compspec --artifact-type application/org.supercontainers.compspec ./specs/compspec-intel-mpi-rocky-9-amd64.json |
| 35 | +``` |
| 36 | + |
| 37 | +Here is how we might see it: |
| 38 | + |
| 39 | +```bash |
| 40 | +oras blob fetch --output - ghcr.io/rse-ops/lammps-matrix:intel-mpi-rocky-9-amd64-compspec@sha256:b68136afad3e4340f0dd4e09c5fea7faf12306cb4b0c1de616703b00d6ffef78 |
| 41 | +``` |
| 42 | +```console |
| 43 | +{ |
| 44 | + "version": "0.0.0", |
| 45 | + "kind": "CompatibilitySpec", |
| 46 | + "metadata": { |
| 47 | + "name": "lammps-prototype", |
| 48 | + "jsonSchema": "https://raw.githubusercontent.com/supercontainers/compspec/main/supercontainers/compspec.json" |
| 49 | + }, |
| 50 | + "compatibilities": [ |
| 51 | + { |
| 52 | + "name": "org.supercontainers.mpi", |
| 53 | + "version": "0.0.0", |
| 54 | + "annotations": { |
| 55 | + "implementation": "intel-mpi", |
| 56 | + "version": "2021.8" |
| 57 | + } |
| 58 | + }, |
| 59 | + { |
| 60 | + "name": "org.supercontainers.os", |
| 61 | + "version": "0.0.0", |
| 62 | + "annotations": { |
| 63 | + "name": "Rocky Linux 9.3 (Blue Onyx)", |
| 64 | + "release": "9.3", |
| 65 | + "vendor": "rocky", |
| 66 | + "version": "9.3" |
| 67 | + } |
| 68 | + }, |
| 69 | + { |
| 70 | + "name": "org.supercontainers.hardware.gpu", |
| 71 | + "version": "0.0.0", |
| 72 | + "annotations": { |
| 73 | + "available": "no" |
| 74 | + } |
| 75 | + }, |
| 76 | + { |
| 77 | + "name": "io.archspec.cpu", |
| 78 | + "version": "0.0.0", |
| 79 | + "annotations": { |
| 80 | + "model": "13th Gen Intel(R) Core(TM) i5-1335U", |
| 81 | + "target": "amd64", |
| 82 | + "vendor": "GenuineIntel" |
| 83 | + } |
| 84 | + } |
| 85 | + ] |
| 86 | +} |
| 87 | +``` |
| 88 | + |
| 89 | +This is great! Next we will capture the URIs of these together in a manifest and put into our compspec tool. TBA! |
0 commit comments