build

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingularityDefBasename = "singularity.def"
	ExesBasename           = "executables"
	SoftpackYaml           = "softpack.yml"
	SpackLockFile          = "spack.lock"
	BuilderOut             = "builder.out"

	UsageBasename = "README.md"
)
View Source
const (
	ErrInvalidJSON         = Error("invalid spack lock JSON")
	ErrEnvironmentBuilding = Error("build already running for environment")

	ErrInvalidEnvPath = Error("invalid environment path")
	ErrInvalidVersion = Error("environment version required")
	ErrNoPackages     = Error("packages required")
	ErrNoPackageName  = Error("package names required")
)
View Source
const (
	ScriptsDirSuffix = "-scripts"

	ImageBasename = "singularity.sif"
)

Variables

This section is empty.

Functions

func ModuleDirFromName added in v1.3.0

func ModuleDirFromName(moduleInstallBase, path, name string) string

ModuleDirFromName returns the canonical module path for an environment.

func ScriptsDirFromNameAndVersion added in v1.3.0

func ScriptsDirFromNameAndVersion(scriptInstallBase, path, name, version string) string

ScriptsDirFromNameAndVersion returns the canonical scripts path for an environment.

func SpackLockToSoftPackYML

func SpackLockToSoftPackYML(spackLockData []byte, desc string, exes []string) (string, error)

SpackLockToSoftPackYML uses the given spackLockData to generate a disambiguated softpack.yml file.

The format of the file is as follows: description: |

$desc
The following executables are added to your PATH:
  - supplied_executable_1
  - supplied_executable_2
  - ...

packages:

  • supplied_package_1@v1
  • supplied_package_2@v1.1
  • ...

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder lets you do builds given config, S3 and a wr runner.

func New

func New(config *config.Config) (*Builder, error)

New takes the s3 build cache URL, the repo and checkout reference of your custom spack repo, and returns a Builder.

func (*Builder) Build

func (b *Builder) Build(def *Definition) (err error)

Build uploads a singularity.def generated by GenerateSingularityDef() to S3 and adds a job to wr to build the image. You'll need a wr manager running that can run jobs with root and access the S3, ie. a cloud deployment.

type ConcreteSpec

type ConcreteSpec struct {
	Name, Version string
}

type Definition

type Definition struct {
	EnvironmentPath    string
	EnvironmentName    string
	EnvironmentVersion string
	Description        string
	Packages           Packages
}

Definition describes the environment a user wanted to create, which comprises a EnvironmentPath such as "users/username", and EnvironmentName such as "mainpackage", and EnvironmentVersion, such as "1". The given Packages will be installed for this Environment, and the Description will become the help text for making use of the Packages.

func (*Definition) FullEnvironmentPath

func (d *Definition) FullEnvironmentPath() string

FullEnvironmentPath returns the complete environment path: the location under environments in the environments git repository that the artefacts will be stored.

func (*Definition) Interpreters added in v1.1.0

func (d *Definition) Interpreters() []string

Interpreters returns interpreter executable names required by interpreter-specific packages.

func (*Definition) ModuleUsage

func (d *Definition) ModuleUsage(loadPath string) string

ModuleUsage returns a markdown formatted usage that tells a user to module load our environment installed in the given loadPath.

func (*Definition) ToModule

func (d *Definition) ToModule(installDir string, deps, exes []string) string

ToModule creates a tcl module based on our packages, and uses installDir to prepend a PATH for the exe wrapper scripts that will be at the installed location of the module. Any supplied module dependencies will be module loaded.

func (*Definition) Validate added in v1.1.0

func (d *Definition) Validate() error

Validate returns an error if the Path is invalid, if Version isn't set, if there are no packages defined, or if any package has no name.

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Package

type Package struct {
	Name    string
	Version string
}

Package describes the name and optional version of a spack package.

func (*Package) Validate added in v1.1.0

func (p *Package) Validate() error

Validate returns an error if Name isn't set.

type Packages added in v1.1.0

type Packages []Package

func (Packages) Validate added in v1.1.0

func (p Packages) Validate() error

Validate returns an error if p is zero length, or any of its Packages are invalid.

type SpackLock

type SpackLock struct {
	Roots []struct {
		Hash, Spec string
	}
	ConcreteSpecs map[string]ConcreteSpec `json:"concrete_specs"`
}

Jump to

Keyboard shortcuts

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