core

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingularityDefBasename = "singularity.def"
	ExesBasename           = "executables"
	SoftpackYaml           = "softpack.yml"
	SpackLockFile          = "spack.lock"
	BuilderOut             = "builder.out"
	ModuleForCoreBasename  = "module"
	UsageBasename          = "README.md"
	ImageBasename          = "singularity.sif"
	ErrNoCoreURL           = "no coreURL specified in config"
	ErrSomeResendsFailed   = "some queued environments failed to be resent from core to builder"
)
View Source
const (
	ErrNoPackages    = internal.Error("packages required")
	ErrNoPackageName = internal.Error("package names required")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

Core is used to interact with a real softpack-core service.

func New

func New(conf *config.Config) (*Core, error)

New creates a new Core struct, to contact the core via its configured URL.

func (*Core) Create

func (c *Core) Create(path, desc string, pkgs Packages) error

Create contacts the core to schedule an environment build.

func (*Core) Delete

func (c *Core) Delete(path string) error

Delete contacts the core to delete an environment.

func (*Core) ResendPendingBuilds

func (c *Core) ResendPendingBuilds() error

ResendPendingBuilds posts to core's resend-pending-builds endpoint and returns an error if the post failed, or core did not respond with a full success.

type EnvironmentResponse

type EnvironmentResponse struct {
	Message string `json:"message"`
	Error   string `json:"error"`
}

EnvironmentResponse is the kind of return value we get from the core.

type Package

type Package struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

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

func (*Package) Validate

func (p *Package) Validate() error

Validate returns an error if Name isn't set.

type Packages

type Packages []Package

func (Packages) Validate

func (p Packages) Validate() error

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

type ResendResponse

type ResendResponse struct {
	Message   string
	Successes int
	Failures  int
}

ResendResponse is the response that the core service sends when a resend request is sent to it.

func (*ResendResponse) FullSuccess

func (rr *ResendResponse) FullSuccess() bool

FullSuccess returns true if there were no failures.

Jump to

Keyboard shortcuts

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