Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run OCI image sources via temporary bundle #1125

Merged
merged 3 commits into from
Nov 17, 2022
Merged

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Nov 14, 2022

Description of the Pull Request (PR):

When running containers in --oci mode, the argument to run is now an image reference corresponding to a native OCI format handled by containers/image, i.e.

  • docker://
  • docker-archive:
  • docker-daemon:
  • oci-archive:
  • oci:

The source image is extracted into a temporary OCI bundle, with a minimally valid configuration that:

  • Runs the process specified by CMD & ENTRYPOINT only.
  • Sets the environment specified by the image ENV only.

The approach is very naive - we pull through Singularity's OCI blob cache into a temporary oci layout dir, before creating the bundle from it. Auth handling for registries is not yet wired up. There is duplication of various pieces of code from the build / SIF OCI flows as these are not easily exposed to the area we are working in.

The intent of the PR, at this stage, is simply to allow e.g.

singularity run --oci docker://sylabsio/lolcow

Note - the next PR will refactor the code to use functional options.

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg changed the title WIP WIP - issue 1036 Nov 14, 2022
@dtrudg dtrudg force-pushed the issue-1036 branch 4 times, most recently from 09374b1 to 538bc66 Compare November 15, 2022 14:45
@dtrudg dtrudg changed the title WIP - issue 1036 feat: run OCI image sources via temporary bundle Nov 15, 2022
@dtrudg dtrudg self-assigned this Nov 15, 2022
@dtrudg dtrudg added this to the SingularityCE 3.11 milestone Nov 15, 2022
@dtrudg dtrudg added the ci:e2e label Nov 15, 2022
@dtrudg dtrudg marked this pull request as ready for review November 15, 2022 15:36
When running containers in `--oci` mode, the argument to run is now an
image reference corresponding to a native OCI format handled by
containers/image, i.e.

* docker://
* docker-archive:
* docker-daemon:
* oci-archive:
* oci:

The source image is extracted into a temporary OCI bundle, with a
minimally valid configuration that:

* Runs the process specified by CMD & ENTRYPOINT only.
* Sets the environment specified by the image ENV only.

The approach is very naive - we pull through Singularity's OCI blob
cache into a temporary oci layout dir, before creating the bundle from
it. Auth handling for registries is not yet wired up. There is
duplication of various pieces of code from the build / SIF OCI flows
as these are not easily exposed to the area we are working in.

The intent of the PR, at this stage, is simply to allow e.g.

    singularity run --oci docker://sylabsio/lolcow

Closes sylabs#1036
Simple test to create a native oci bundle from the supported sources,
and verify it is valid with runtime-tools/validate.
@dtrudg dtrudg merged commit 28b0d1c into sylabs:main Nov 17, 2022
@dtrudg dtrudg deleted the issue-1036 branch November 17, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support other OCI image sources in OCI launcher, via temp dir bundle.
2 participants