Documentation ¶
Index ¶
- Constants
- func ModuleDirFromName(moduleInstallBase, path, name string) string
- func ScriptsDirFromNameAndVersion(scriptInstallBase, path, name, version string) string
- func SpackLockToSoftPackYML(spackLockData []byte, desc string, exes []string) (string, error)
- type Builder
- type ConcreteSpec
- type Definition
- type Runner
- type S3
- type SpackLock
- type Status
Constants ¶
const ( ErrInvalidJSON = internal.Error("invalid spack lock JSON") ErrEnvironmentBuilding = internal.Error("build already running for environment") ErrInvalidEnvPath = internal.Error("invalid environment path") ErrInvalidVersion = internal.Error("environment version required") )
const ( ScriptsDirSuffix = "-scripts" ErrMakeDirectory = internal.Error("base not parent of leaf") )
const (
ErrBuildFailed = "environment build failed"
)
Variables ¶
This section is empty.
Functions ¶
func ModuleDirFromName ¶ added in v1.3.0
ModuleDirFromName returns the canonical module path for an environment.
func ScriptsDirFromNameAndVersion ¶ added in v1.3.0
ScriptsDirFromNameAndVersion returns the canonical scripts path for an environment.
func SpackLockToSoftPackYML ¶
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 ¶
New takes the s3 build cache URL, the repo and checkout reference of your custom spack repo, and returns a Builder. Optionally, supply objects that satisfy the S3 and Runner interfaces; if nil, these default to using the s3 and wr packages.
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.
func (*Builder) SetPostBuildCallback ¶ added in v1.4.0
func (b *Builder) SetPostBuildCallback(cb func())
SetPostBuildCallback causes the passed callback to be called after the spack-related parts of a build have completed.
type ConcreteSpec ¶
type ConcreteSpec struct {
Name, Version string
}
type Definition ¶
type Definition struct { EnvironmentPath string EnvironmentName string EnvironmentVersion string Description string Packages core.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 SpackLock ¶
type SpackLock struct { Roots []struct { Hash, Spec string } ConcreteSpecs map[string]ConcreteSpec `json:"concrete_specs"` }