Skip to content

Instantly share code, notes, and snippets.

@sajayantony
Last active August 22, 2019 21:48
Show Gist options
  • Save sajayantony/67eecb70655dbc7a48c04791be2cb7b8 to your computer and use it in GitHub Desktop.
Save sajayantony/67eecb70655dbc7a48c04791be2cb7b8 to your computer and use it in GitHub Desktop.

Singularity Images in an OCI Registry

The proposal is to enable singularity to be able to push and pull images from an OCI compatible registry. Azure Container Registry an AWS's ECR already support the OCI specification. This is based off - https://github.com/stevelasker/registryArtifactTypes/

If we have native support for SIF as OCI then the experience could be something like this

# Creates a manifest and moves the file to a cache or location that singularity is comfortable with. 
singularity build oci://hpccontainers.azurecr.io/singularity:centos -f ./layer_centos.sif 

## Reference the local manifest which has the layer referenced from the layer cache. 
singularity push oci://hpccontainers.azurecr.io/singularity:centos -u username -p password. 

#Pulling and image extracts the manifes and file to the layer cache. 
singularity pull oci://hpccontainers.azurecr.io/singularity:centos

# Running a locally cached oci image. 
singularity run oci://hpccontainers.azurecr.io/singularity:centos

Currently Using ORAS

Today to demostrate this we can use oras to push and pull images. We don't have a manifest/repository cache and we might have to introduce some capabilities like providing oras a download root directory and also ask it to save manifest as well.

Pushing a SIF file

singularity pull library://verma/default/layer:centos
oras push sajayeus.azurecr.io/singularity:centos ./layer_centos.sif -u sajayeus -p $PASSWORD

Pulling the SIF image

oras pull sajayeus.azurecr.io/singularity:centos -u sajayeus -p $PASSWORD
singularity run ./layer_centos.sif

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment