lib

package
v0.0.0-...-155ec6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2018 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConversionNotFound = iota
	ConversionMatch    = iota
	ConversionNotMatch = iota
)

Variables

This section is empty.

Functions

func AddManifestToRemoveScheduler

func AddManifestToRemoveScheduler(CVMFSRepo string, manifest da.Manifest) error

func ConvertWish

func ConvertWish(wish WishFriendly, convertAgain, forceDownload, convertSingularity bool) (err error)

func CreateCatalogIntoDir

func CreateCatalogIntoDir(CVMFSRepo, dir string) (err error)

func CreateSymlinkIntoCVMFS

func CreateSymlinkIntoCVMFS(CVMFSRepo, newLinkName, toLinkPath string) (err error)

create a symbolic link inside the repository called `newLinkName`, the symlink will point to `toLinkPath` newLinkName: comes without the /cvmfs/$REPO/ prefix toLinkPath: comes without the /cvmfs/$REPO/ prefix

func ExecCommand

func ExecCommand(input ...string) *execCmd

func FindImageToGarbageCollect

func FindImageToGarbageCollect(CVMFSRepo string) ([]da.Manifest, error)

func GarbageCollectSingleLayer

func GarbageCollectSingleLayer(CVMFSRepo, image, layer string) error

with image and layer we pass the digest of the layer and the digest of the image, both without the sha256: prefix

func GetSingularityPathFromManifest

func GetSingularityPathFromManifest(manifest da.Manifest) string

func IngestIntoCVMFS

func IngestIntoCVMFS(CVMFSRepo string, path string, target string) (err error)

ingest into the repository, inside the subpath, the target (directory or file) object CVMFSRepo: just the name of the repository (ex: unpacked.cern.ch) path: the path inside the repository, without the prefix (ex: .foo/bar/baz), where to put the ingested target target: the path of the target in the normal FS, the thing to ingest if no error is returned, we remove the target from the FS

func LayerMetadataPath

func LayerMetadataPath(CVMFSRepo, layerDigest string) string

func LayerPath

func LayerPath(CVMFSRepo, layerDigest string) string

func LayerRootfsPath

func LayerRootfsPath(CVMFSRepo, layerDigest string) string

func Log

func Log() *log.Entry

func LogE

func LogE(err error) *log.Entry

func RemoveDirectory

func RemoveDirectory(directory string) error

func RemoveLayer

func RemoveLayer(CVMFSRepo, layerDigest string) error

func RemoveScheduleLocation

func RemoveScheduleLocation(CVMFSRepo string) string

func RemoveSingularityImageFromManifest

func RemoveSingularityImageFromManifest(CVMFSRepo string, manifest da.Manifest) error
func SaveLayersBacklink(CVMFSRepo string, img Image, layerDigest []string) error

func TrimCVMFSRepoPrefix

func TrimCVMFSRepoPrefix(path string) string

from /cvmfs/$REPO/foo/bar -> foo/bar

Types

type Backlink struct {
	Origin []string `json:"origin"`
}

type ConversionResult

type ConversionResult int

func AlreadyConverted

func AlreadyConverted(CVMFSRepo string, img Image, reference string) ConversionResult

type Image

type Image struct {
	Id         int
	User       string
	Scheme     string
	Registry   string
	Repository string
	Tag        string
	Digest     string
	IsThin     bool
	Manifest   *da.Manifest
}

func ParseImage

func ParseImage(image string) (img Image, err error)

func (Image) DownloadSingularityDirectory

func (img Image) DownloadSingularityDirectory(rootPath string) (sing Singularity, err error)

func (Image) GetChanges

func (img Image) GetChanges() (changes []string, err error)

func (Image) GetLayers

func (img Image) GetLayers(layersChan chan<- downloadedLayer, manifestChan chan<- string, stopGettingLayers <-chan bool, rootPath string) error

func (Image) GetManifest

func (img Image) GetManifest() (da.Manifest, error)

func (Image) GetManifestUrl

func (i Image) GetManifestUrl() string

func (Image) GetReference

func (i Image) GetReference() string

func (Image) GetSimpleName

func (i Image) GetSimpleName() string

func (Image) GetSimpleReference

func (i Image) GetSimpleReference() string

func (Image) GetSingularityLocation

func (img Image) GetSingularityLocation() string

func (Image) GetSingularityPath

func (img Image) GetSingularityPath() (string, error)

here is where in the FS we are going to store the singularity image

func (Image) PrintImage

func (img Image) PrintImage(machineFriendly, csv_header bool)

func (Image) WholeName

func (i Image) WholeName() string

type ManifestRequest

type ManifestRequest struct {
	Image    Image
	Password string
}

type Recipe

type Recipe struct {
	Wishes []WishFriendly
}

func ParseYamlRecipeV1

func ParseYamlRecipeV1(data []byte) (Recipe, error)

type Singularity

type Singularity struct {
	Image         *Image
	TempDirectory string
}

func (Singularity) IngestIntoCVMFS

func (s Singularity) IngestIntoCVMFS(CVMFSRepo string) error

type Wish

type Wish struct {
	Id          int
	InputImage  int
	OutputImage int
	CvmfsRepo   string
}

type WishFriendly

type WishFriendly struct {
	Id         int
	InputId    int
	InputName  string
	OutputId   int
	OutputName string
	CvmfsRepo  string
	Converted  bool
	UserInput  string
	UserOutput string
}

func CreateWish

func CreateWish(inputImage, outputImage, cvmfsRepo, userInput, userOutput string) (wish WishFriendly, err error)

type YamlRecipeV1

type YamlRecipeV1 struct {
	Version      int      `yaml:"version"`
	User         string   `yaml:"user"`
	CVMFSRepo    string   `yaml:"cvmfs_repo"`
	OutputFormat string   `yaml:"output_format"`
	Input        []string `yaml:"input"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL