types

package
v3.0.2-rc1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildHistory

type BuildHistory struct {
	DefinitionHash string `json:"definitionHash"`
	Definition     `json:"definition"`
	Parent         *BuildHistory `json:"parent"`
}

BuildHistory ...

type Bundle

type Bundle struct {
	// FSObjects is a map of the filesystem objects contained in the Bundle. An object
	// will be built as one section of a SIF file.
	//
	// Known FSObjects labels:
	//   * rootfs -> root file system
	//   * .singularity.d -> .singularity.d directory (includes image exec scripts)
	//   * data -> directory containing data files
	FSObjects   map[string]string `json:"fsObjects"`
	JSONObjects map[string][]byte `json:"jsonObjects"`
	Recipe      Definition        `json:"rawDeffile"`
	BindPath    []string          `json:"bindPath"`
	Path        string            `json:"bundlePath"`
	Opts        Options           `json:"opts"`
}

Bundle is the temporary build environment used during the image building process. A Bundle is the programmatic representation of the directory structure which will constitute this environmenb. /tmp/...:

fs/ - A chroot filesystem
.singularity.d/ - Container metadata (from 2.x image format)
config.json (optional) - Contain information for OCI image bundle
etc... - The Bundle dir can theoretically contain arbitrary directories,
         files, etc... which can be interpreted by the Chef

func NewBundle

func NewBundle(bundleDir, bundlePrefix string) (b *Bundle, err error)

NewBundle creates a Bundle environment

func (*Bundle) Rootfs

func (b *Bundle) Rootfs() string

Rootfs give the path to the root filesystem in the Bundle

func (Bundle) RunSection

func (b Bundle) RunSection(s string) bool

RunSection iterates through the sections specified in a bundle and returns true if the given string, s, is a section of the definition that should be executed during the build process

type Data

type Data struct {
	Files   []FileTransport `json:"files"`
	Scripts `json:"buildScripts"`
}

Data contains any scripts, metadata, etc... that the Builder may need to know only at build time to build the image

type Definition

type Definition struct {
	Header    map[string]string `json:"header"`
	ImageData `json:"imageData"`
	BuildData Data `json:"buildData"`
}

Definition describes how to build an image.

func NewDefinitionFromJSON

func NewDefinitionFromJSON(r io.Reader) (d Definition, err error)

NewDefinitionFromJSON creates a new Definition using the supplied JSON.

func NewDefinitionFromURI

func NewDefinitionFromURI(uri string) (d Definition, err error)

NewDefinitionFromURI crafts a new Definition given a URI

type FileTransport

type FileTransport struct {
	Src string `json:"source"`
	Dst string `json:"destination"`
}

FileTransport holds source and destination information of files to copy into the container

type ImageData

type ImageData struct {
	Metadata     []byte            `json:"metadata"`
	Labels       map[string]string `json:"labels"`
	ImageScripts `json:"imageScripts"`
}

ImageData contains any scripts, metadata, etc... that needs to be present in some from in the final built image

type ImageScripts

type ImageScripts struct {
	Help        string `json:"help"`
	Environment string `json:"environment"`
	Runscript   string `json:"runScript"`
	Test        string `json:"test"`
	Startscript string `json:"startScript"`
}

ImageScripts contains scripts that are used after build time.

type MetaData

type MetaData struct {
	// DefaultCommand is the process which should be executed by default when calling
	// "singularity run ... "
	DefaultCommand string `json:"defaultCommand"`

	// Overridable sets whether or not the user supplied arguments to "singularity run ..."
	// can override the default Command.
	Overridable bool `json:"overridable"`

	// DefaultArgs are the default arguments passed to the Command to run in the Container. These
	// can *always* be overridden by arguments given to "singularity run ..."
	DefaultArgs string `json:"defaultArgs"`

	// BaseEnv provides the base environment variables of the container.
	BaseEnv []string `json:"baseEnv"`

	BuildHistory *BuildHistory `json:"buildHistory"`
}

MetaData ...

type Options

type Options struct {
	// TmpDir specifies a non-standard temporary location to perform a build
	TmpDir string
	// sections are the parts of the definition to run during the build
	Sections []string `json:"sections"`
	// noTest indicates if build should skip running the test script
	NoTest bool `json:"noTest"`
	// force automatically deletes an existing container at build destination while performing build
	Force bool `json:"force"`
	// update detects and builds using an existing sandbox container at build destination
	Update bool `json:"update"`
	// noHTTPS
	NoHTTPS bool `json:"noHTTPS"`
	// contains docker credentials if specified
	DockerAuthConfig *ocitypes.DockerAuthConfig
}

Options ...

type RequestData

type RequestData struct {
	Definition  `json:"definition"`
	LibraryRef  string `json:"libraryRef"`
	LibraryURL  string `json:"libraryURL"`
	CallbackURL string `json:"callbackURL"`
}

RequestData contains the info necessary for submitting a build to a remote service

type ResponseData

type ResponseData struct {
	ID            bson.ObjectId `json:"id"`
	CreatedBy     string        `json:"createdBy"`
	SubmitTime    time.Time     `json:"submitTime"`
	StartTime     *time.Time    `json:"startTime,omitempty" bson:",omitempty"`
	IsComplete    bool          `json:"isComplete"`
	CompleteTime  *time.Time    `json:"completeTime,omitempty"`
	ImageSize     int64         `json:"imageSize,omitempty"`
	ImageChecksum string        `json:"imageChecksum,omitempty"`
	Definition    Definition    `json:"definition"`
	WSURL         string        `json:"wsURL,omitempty" bson:"-"`
	LibraryRef    string        `json:"libraryRef"`
	LibraryURL    string        `json:"libraryURL"`
	CallbackURL   string        `json:"callbackURL"`
}

ResponseData contains the details of an individual build

type Scripts

type Scripts struct {
	Pre   string `json:"pre"`
	Setup string `json:"setup"`
	Post  string `json:"post"`
	Test  string `json:"test"`
}

Scripts defines scripts that are used at build time.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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