Skip to content

Commit

Permalink
add image table and manifest tool
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Jan 23, 2024
1 parent e31d66e commit e51ac0b
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manifests/manifest-tool
15 changes: 15 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Intellectual Property Notice
----------------------------

HPCIC DevTools is licensed under the MIT license (LICENSE).

Copyrights and patents in this project are retained by
contributors. No copyright assignment is required to contribute to
HPCIC DevTools.

SPDX usage
------------

Individual files contain SPDX tags instead of the full license text.
This enables machine processing of license information based on the SPDX
License Identifiers that are available here: https://spdx.org/licenses/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022-2023 LLNS, LLC and other HPCIC DevTools Developers.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This work was produced under the auspices of the U.S. Department of
Energy by Lawrence Livermore National Laboratory under Contract
DE-AC52-07NA27344.

This work was prepared as an account of work sponsored by an agency of
the United States Government. Neither the United States Government nor
Lawrence Livermore National Security, LLC, nor any of their employees
makes any warranty, expressed or implied, or assumes any legal liability
or responsibility for the accuracy, completeness, or usefulness of any
information, apparatus, product, or process disclosed, or represents that
its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service
by trade name, trademark, manufacturer, or otherwise does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the
United States Government or Lawrence Livermore National Security, LLC.

The views and opinions of authors expressed herein do not necessarily
state or reflect those of the United States Government or Lawrence
Livermore National Security, LLC, and shall not be used for advertising
or product endorsement purposes.
91 changes: 91 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,94 @@ Testing builds of lammps across a few:
- MPI implementations
- OS and versions
- architectures

## Strategy

Note that we take the following approach:

1. Build the containers separately, one per arch, to fit into GitHub actions. This is done via the workflow [.github/workflows/docker-builds.yaml](.github/workflows/docker-builds.yaml)
2. Use a custom tool to emulate the image selection process that is normally done by a container runtime. The reason is because we want to inject randomness - a registry will typically deliver a manifest list, and then the runtime chooses the first match. This doesn't give very interesting experiment results, so instead we are going to select based on platform (what the registry does) and then randomly choose from that set.

Note that if you are interested in the assembled manifest images, we have prepared them, and you can see those specs in [manifests](manifests).

## Vision

Note that for this initial prototype, we are largely doing everything manually. However, these manual steps will eventually be easily automated. Here are the ideal before and after scenarios.

### Prototype

Currently we build them separately, and then will use a custom tool that takes pairings of image and [ORAS artifact](https://oras.land/docs/how_to_guides/pushing_and_pulling) URIs, and assembles the two together into a graph. For the case that emulates a vanilla registry, choosing an image based on platform and nothing else, we will filter by platform and then randomly select. For the informed case using more descriptors, we will add more metadata to that choice. In both cases we will run the application and assess performance (wall time for now). In practice this means (the steps here) for this experiment:

1. Ask the plugin to choose a best image from a set
2. The plugin will take the pairings of images and metadata, and (based on mode of operation) choose basic or descriptive
3. In basic mode, images are filtered based on platform, and one randomly chosen from that set.
4. In descriptive mode, images are filtered based on all metadata provided (e.g., matching to MPI, platform, OS, etc)
5. In both cases, a final image URI is delivered to run for the application.

In the above, the builds are done in CI, but separate (so we can consider them more manual). The metadata is also prepared and pushed manually, and this would eventually be an automated process.

### Production

When we have a production compatibility specification, it will be defined and paired alongside an image in a registry. The container runtime tool will likely accept similar plugins that discover the compatibility artifacts, and then (also with a plugin-based approach) be able to more intelligently select the right image for an environment.

1. Images are built and pushed with automated metadata extraction and artifact generationm.
2. Ask the registry for an image URI via a container runtime
4. The registry links compatibility metadata with each image
5. The container runtime uses the compatibility metadata to select the best image.

## Matrices

### Builds

Here is our matrix of original builds (separated into different images for easier building). I will likely inspect these closer to

| Image | Architecture | OS | OS Version | MPI | MPI version | GPU |
|---------------------|--------------|-------|------------|---------|-------------|-----|
| [intel-mpi-rocky](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169779744?tag=intel-mpi-rocky-8-amd64) | linux/amd64 | rocky | 8 |intel-mpi| | no |
| [intel-mpi-rocky](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169782781?tag=intel-mpi-rocky-9-amd64) | linux/amd64 | rocky | 9 |intel-mpi| | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169782423?tag=openmpi-ubuntu-20.04-amd64) | linux/amd64 | ubuntu| 20.04 | openmpi | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169792857?tag=openmpi-ubuntu-20.04-arm64) | linux/arm64 | ubuntu| 20.04 | openmpi | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169810547?tag=openmpi-ubuntu-20.04-ppc64le) | linux/ppc64le| ubuntu| 20.04 | openmpi | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169782169?tag=openmpi-ubuntu-22.04-amd64) | linux/amd64 | ubuntu| 22.04 | openmpi | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169809314?tag=openmpi-ubuntu-22.04-arm64) | linux/arm64 | ubuntu| 22.04 | openmpi | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169809649?tag=openmpi-ubuntu-22.04-ppc64le) | linux/ppc64le| ubuntu| 22.04 | openmpi | | no |
| [openmpi-ubuntu-gpu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169858346?tag=openmpi-ubuntu-gpu-20.04-amd64) | linux/amd64 | ubuntu| 20.04 | openmpi | | yes |
| [openmpi-ubuntu-gpu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169812970?tag=openmpi-ubuntu-gpu-22.04-amd64) | linux/amd64 | ubuntu| 22.04 | openmpi | | yes |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169781948?tag=mpich-ubuntu-20.04-amd64) | linux/amd64 | ubuntu| 20.04 | mpich | | no |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169810873?tag=mpich-ubuntu-20.04-arm64) | linux/arm64 | ubuntu| 20.04 | mpich | | no |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169810274?tag=mpich-ubuntu-20.04-ppc64le) | linux/ppc64le| ubuntu| 20.04 | mpich | | no |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169782384?tag=mpich-ubuntu-22.04-amd64) | linux/amd64 | ubuntu| 22.04 | mpich | | no |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169814135?tag=mpich-ubuntu-22.04-arm64) | linux/arm64 | ubuntu| 22.04 | mpich | | no |
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169814902?tag=mpich-ubuntu-22.04-ppc64le) | linux/ppc64le| ubuntu| 22.04 | mpich | | no |

You can find these container builds [here](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix).
More are coming soon, I mostly just need to do the builds / write the Dockerfile (or think of the combination).

### Combined Builds

These are (when appropriate) combined into single manifests, meaning we have three architectures.

| Image | Architecture | OS | OS Version | MPI | MPI version | GPU |
|---------------------|--------------|-------|------------|---------|-------------|-----|
| [mpich-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169858137?tag=mpich-ubuntu) | arm64,amd64,ppc64le | ubuntu | 20.04,22.04 | mpich | | no |
| [openmpi-ubuntu](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169857680?tag=openmpi-ubuntu) | arm64,amd64,ppc64le | ubuntu | 20.04,22.04 | openmpi | | no |

## Next Steps

- **Extraction of metadata**: into a JSON blob that conforms to our [prototype spec](https://github.com/supercontainers/compspec),one associated per URI (undecided if I should automate this given the potential need to extract or shell, I'm hoping I can do something statically but might just make them manually for this first shot since we know most of the metadata).
- **Generation of artifacts**: and push to an OCI registry with ORAS.
- **Command Line Tool**: to assist with image selection based on paired images and their metadata, and in a basic or descriptive mode.


## License

HPCIC DevTools is distributed under the terms of the MIT license.
All new contributions must be made under this license.

See [LICENSE](https://github.com/converged-computing/cloud-select/blob/main/LICENSE),
[COPYRIGHT](https://github.com/converged-computing/cloud-select/blob/main/COPYRIGHT), and
[NOTICE](https://github.com/converged-computing/cloud-select/blob/main/NOTICE) for details.

SPDX-License-Identifier: (MIT)

LLNL-CODE- 842614
21 changes: 6 additions & 15 deletions local-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@
# These need more room, and thus are done locally

# openmpi-ubuntu-gpu on amd64
docker buildx build --platform linux/amd64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-amd64 openmpi-ubuntu-gpu/
docker buildx build --platform linux/amd64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-amd64 openmpi-ubuntu-gpu/

docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-amd64
docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-amd64
docker buildx build --platform linux/amd64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-amd64 openmpi-ubuntu-gpu/ --push
docker buildx build --platform linux/amd64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-amd64 openmpi-ubuntu-gpu/ --push

# openmpi-ubuntu-gpu on arm64
docker buildx build --platform linux/arm64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-arm64 openmpi-ubuntu-gpu/
docker buildx build --platform linux/arm64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-arm64 openmpi-ubuntu-gpu/

docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-arm64
docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-arm64
docker buildx build --platform linux/arm64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-arm64 openmpi-ubuntu-gpu/ --push
docker buildx build --platform linux/arm64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-arm64 openmpi-ubuntu-gpu/ --push

# openmpi-ubuntu-gpu on ppc64le
docker buildx build --platform linux/arm64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-ppc64le openmpi-ubuntu-gpu/
docker buildx build --platform linux/arm64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-ppc64le openmpi-ubuntu-gpu/

docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-ppc64le
docker push ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-ppc64le
docker buildx build --platform linux/arm64 --build-arg tag=20.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-20.04-ppc64le openmpi-ubuntu-gpu/ --push
docker buildx build --platform linux/arm64 --build-arg tag=22.04 --provenance false --tag ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-gpu-22.04-ppc64le openmpi-ubuntu-gpu/ --push
12 changes: 12 additions & 0 deletions manifests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Manifest Lists

In order to emulate an actual pull -> choosing of a platform by a container runtime tool, we need to put the (currently separate tags for an image) in an image manifest list. We can do that with [manifest-tool](https://github.com/estesp/manifest-tool). After following the instructions to install it there, here is how to generate our manifests.

```bash
manifest-tool push from-spec ./openmpi-ubuntu-20.04.yaml
manifest-tool push from-spec ./openmpi-ubuntu-22.04.yaml
manifest-tool push from-spec ./mpich-ubuntu-20.04.yaml
manifest-tool push from-spec ./mpich-ubuntu-22.04.yaml
```

The first of those might make [this tag](https://github.com/rse-ops/lammps-matrix/pkgs/container/lammps-matrix/169857305?tag=openmpi-ubuntu)
18 changes: 18 additions & 0 deletions manifests/mpich-ubuntu-20.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu
tags: ["20.04"]
manifests:
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-20.04-ppc64le
platform:
architecture: ppc64le
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-20.04-arm64
platform:
architecture: arm64
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-20.04-amd64
platform:
architecture: amd64
os: linux
18 changes: 18 additions & 0 deletions manifests/mpich-ubuntu-22.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu
tags: ["22.04"]
manifests:
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-22.04-ppc64le
platform:
architecture: ppc64le
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-22.04-arm64
platform:
architecture: arm64
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:mpich-ubuntu-22.04-amd64
platform:
architecture: amd64
os: linux
18 changes: 18 additions & 0 deletions manifests/openmpi-ubuntu-20.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu
tags: ["20.04"]
manifests:
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-20.04-ppc64le
platform:
architecture: ppc64le
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-20.04-arm64
platform:
architecture: arm64
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-20.04-amd64
platform:
architecture: amd64
os: linux
18 changes: 18 additions & 0 deletions manifests/openmpi-ubuntu-22.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu
tags: ["22.04"]
manifests:
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-22.04-ppc64le
platform:
architecture: ppc64le
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-22.04-arm64
platform:
architecture: arm64
os: linux
-
image: ghcr.io/rse-ops/lammps-matrix:openmpi-ubuntu-22.04-amd64
platform:
architecture: amd64
os: linux

0 comments on commit e51ac0b

Please sign in to comment.