types

package
v3.0.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidDefinition

func IsValidDefinition(source string) (valid bool, err error)

IsValidDefinition returns whether or not the given file is a valid definition

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"`
}

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(directoryPrefix 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

type Data

type Data struct {
	Files   map[string]string `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

func ParseDefinitionFile

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

ParseDefinitionFile recieves a reader from a definition file and parse it into a Definition struct or return error if the definition file has a bad section.

func (*Definition) WriteDefinitionFile

func (d *Definition) WriteDefinitionFile(w io.Writer)

WriteDefinitionFile is a helper func to output a Definition struct into a definition file.

type ImageData

type ImageData struct {
	Metadata     []byte   `json:"metadata"`
	Labels       []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"`
}

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 Scripts

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

Scripts defines scripts that are used at build time.

Jump to

Keyboard shortcuts

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