Documentation ¶
Index ¶
- Constants
- func DownloadImage(_ context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig) error
- func ImageHash(filePath string) (v1.Hash, error)
- func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, ...) (imagePath string, err error)
- func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom string, ...) (imagePath string, err error)
- func RefHash(_ context.Context, ref string, ociAuth *ocitypes.DockerAuthConfig) (v1.Hash, error)
- func UploadImage(_ context.Context, path, ref string, ociAuth *ocitypes.DockerAuthConfig) error
- type SifImage
- func (si *SifImage) ConfigFile() (*v1.ConfigFile, error)
- func (si *SifImage) ConfigName() (v1.Hash, error)
- func (si *SifImage) Digest() (v1.Hash, error)
- func (si *SifImage) LayerByDiffID(hash v1.Hash) (v1.Layer, error)
- func (si *SifImage) LayerByDigest(hash v1.Hash) (v1.Layer, error)
- func (si *SifImage) Layers() ([]v1.Layer, error)
- func (si *SifImage) Manifest() (*v1.Manifest, error)
- func (si *SifImage) MediaType() (types.MediaType, error)
- func (si *SifImage) RawConfigFile() ([]byte, error)
- func (si *SifImage) RawManifest() ([]byte, error)
- func (si *SifImage) Size() (int64, error)
- type SifLayer
- func (sl *SifLayer) Compressed() (io.ReadCloser, error)
- func (sl *SifLayer) DiffID() (v1.Hash, error)
- func (sl *SifLayer) Digest() (v1.Hash, error)
- func (sl *SifLayer) MediaType() (types.MediaType, error)
- func (sl *SifLayer) Size() (int64, error)
- func (sl *SifLayer) Uncompressed() (io.ReadCloser, error)
Constants ¶
const ( // SifLayerMediaTypeV1 is the mediaType for the "layer" which contains the actual SIF file SifLayerMediaTypeV1 = "application/vnd.sylabs.sif.layer.v1.sif" // SifLayerMediaTypeProto is the mediaType from prototyping and Singularity // <3.7 which unfortunately includes a typo and doesn't have a version suffix // See: https://github.com/hpcng/singularity/issues/4437 SifLayerMediaTypeProto = "appliciation/vnd.sylabs.sif.layer.tar" )
const (
// SifConfigMediaTypeV1 is the config descriptor mediaType for a SIF image.
SifConfigMediaTypeV1 = "application/vnd.sylabs.sif.config.v1+json"
)
Variables ¶
This section is empty.
Functions ¶
func DownloadImage ¶
DownloadImage downloads a SIF image specified by an oci reference to a file using the included credentials
FIXME: use context for cancellation.
func Pull ¶
func Pull(ctx context.Context, imgCache *cache.Handle, pullFrom, tmpDir string, ociAuth *ocitypes.DockerAuthConfig) (imagePath string, err error)
Pull will pull an oras image to the cache or direct to a temporary file if cache is disabled
func PullToFile ¶
func PullToFile(ctx context.Context, imgCache *cache.Handle, pullTo, pullFrom string, ociAuth *ocitypes.DockerAuthConfig) (imagePath string, err error)
PullToFile will pull an oras image to the specified location, through the cache, or directly if cache is disabled
func RefHash ¶
RefHash returns the digest of the SIF layer of the OCI manifest for supplied ref
FIXME: use context for cancellation.
func UploadImage ¶
UploadImage uploads the image specified by path and pushes it to the provided oci reference, it will use credentials if supplied
FIXME: use context for cancellation.
Types ¶
type SifImage ¶
type SifImage struct {
// contains filtered or unexported fields
}
SifImage implements a go-containerregistry v1.Image representing an ORAS / OCI artifact of a single SIF image.
func NewImageFromSIF ¶
func (*SifImage) ConfigFile ¶
func (si *SifImage) ConfigFile() (*v1.ConfigFile, error)
ConfigFile returns the hash of the image's config file, also known as the Image ID.
func (*SifImage) ConfigName ¶
ConfigName returns the hash of the image's config file, also known as the Image ID.
func (*SifImage) LayerByDiffID ¶
LayerByDiffID is an analog to LayerByDigest, looking up by "diff id" (the uncompressed hash).
func (*SifImage) LayerByDigest ¶
LayerByDigest returns a Layer for interacting with a particular layer of the image, looking it up by "digest" (the compressed hash).
func (*SifImage) Layers ¶
Layers returns the ordered collection of filesystem layers that comprise this image. The order of the list is oldest/base layer first, and most-recent/top layer last.
func (*SifImage) RawConfigFile ¶
RawConfigFile returns the serialized bytes of ConfigFile().
func (*SifImage) RawManifest ¶
RawManifest returns the serialized bytes of Manifest()
type SifLayer ¶
type SifLayer struct {
// contains filtered or unexported fields
}
SifLayer implements a go-containerregistry v1.Layer backed by a SIF file, for ORAS / OCI artifact usage.
func NewLayerFromSIF ¶
NewLayerFromSIF creates a new layer, backed by file, with mt as the MediaType. The MediaType should always be set SifLayerMediaTypeV1 in production. It is configurable so that we can implement tests which use the old prototype media value.
func (*SifLayer) Compressed ¶
func (sl *SifLayer) Compressed() (io.ReadCloser, error)
func (*SifLayer) Uncompressed ¶
func (sl *SifLayer) Uncompressed() (io.ReadCloser, error)