Maintaining Open Source Singularity Since 2017
OCI-SIF Container Images: Unraveling Their Features and Benefits
By Adam Hughes
OCI-SIF
OCI, a project within the Linux Foundation, maintains the OCI image specification, which has emerged as the de facto standard for container images. This format aims to bring compatibility across different container runtimes and platforms. SIF, developed at Sylabs, offers a compelling alternative, particularly in scientific computing and high-performance computing (HPC) environments. OCI-SIF is a hybrid format poised to revolutionize containerization by merging the standardization of the OCI image spec with the portability and mobility of SIF. In addition, it adheres to a standardized specification and facilitates even more integration.
Examples
In SingularityCE 4.0 and above, there is a new feature called OCI-mode. It is enabled with the –oci flag (or in singularity.conf) and uses runc or crun as a low-level runtime to guarantee OCI compatibility. When pulling an image in this mode, the image is automatically converted to OCI-SIF instead of SIF. If a native SIF image is still needed, drop the flag and reissue the command.
$ singularity pull --oci docker://ubuntu:24.04
27.5MiB / 27.5MiB [=========================================] 100 % 0.0 b/s 0s
INFO: Converting OCI image to OCI-SIF format
INFO: Squashing image to single layer
INFO: Writing OCI-SIF image
INFO: Cleaning up.
ubuntu_24.04.oci.sif. One can infer that this is an OCI image spec file and technically confirm this with the following command.singularity sif list ubuntu_24.04.oci.sif
-----------------------------------------------------------------------
ID |GROUP |LINK |SIF POSITION (start-end) |TYPE
-----------------------------------------------------------------------
1 |1 |NONE |32176-29117872 |OCI.Blob
2 |1 |NONE |29117872-29118680 |OCI.Blob
3 |1 |NONE |29118680-29119089 |OCI.Blob
4 |1 |NONE |29119089-29119329 |OCI.RootIndex
$ singularity exec --oci ubuntu_24.04.oci.sif head -1 /etc/os-release
PRETTY_NAME="Ubuntu 24.04 LTS"
$ singularity exec --oci docker://ubuntu:24.04 head -1 /etc/os-release
INFO: Using cached OCI-SIF image
PRETTY_NAME="Ubuntu 24.04 LTS"
registry subcommand.
Example
$ singularity registry login -u username registry.domain.name
$ singularity push container-image.sif \
docker://registry.DOMAIN/namespace/image:tag
$ singularity push container-image.sif \
oras://registry.DOMAIN/namespace/image:tag
Conclusion
In the ever-evolving landscape of containerization, OCI-SIF container images emerge as a powerful format, offering unique features and benefits. While OCI is the preferred choice for mainstream container deployments, SIF caters to specialized use cases, such as scientific computing, focusing on reproducibility and mobility, and its simplicity in a single file reduces I/O operations, avoiding metadata overhead. This means it can be hosted in a parallel filesystem. By understanding the strengths of both OCI and SIF container images, developers and researchers can make informed decisions that align with their specific requirements, paving the way for efficient and resilient containerized workflows
Join Our Mailing List
Recent Posts
Related Posts
Laying the Groundwork for 2025: Sylabs’ Vision for Secure Multi-Cloud Solutions
With a legacy rooted in innovation through the work we’ve done with the Singularity platform, Sylabs has consistently worked to provide secure container technology to empower researchers, enterprises, and innovators worldwide. These efforts have paid dividends as we...
Creating New Levels of Security with Containers and Confidential Computing
Data breaches are becoming increasingly common. It's more important than ever to find robust solutions that protect sensitive information. Recent high-profile data breaches underscore the necessity for fresh approaches to data protection. Breaches like these are...
Building ARM Containers with Singularity Container Services
Introduction The Acorn RISC Machine, or ARM as it is now known, and later processor architecture has become a cornerstone in the landscape of Information Technology (IT) and modern computing. Initially designed for Acorn Computers in the 1980s, ARM processors have...