wr

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SingularityBuildInS3WRInput

func SingularityBuildInS3WRInput(s3Path, hash string) (string, error)

SingularityBuildInS3WRInput returns wr input that could be piped to `wr add` and that would run a singularity build where the working directory is a fuse mount of the given s3Path.

Types

type Error

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

func (Error) Error

func (e Error) Error() string

type Runner

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

Runner lets you Run() a wr add command.

func New

func New(deployment string) *Runner

New returns a Runner that will use the given wr deployment to wr add jobs during Run().

func (*Runner) Add added in v1.5.0

func (r *Runner) Add(wrInput string) (string, error)

Run pipes the given wrInput (eg. as produced by SingularityBuildInS3WRInput()) to `wr add`, which adds a job to wr's queue and returns its ID. You should call Wait(ID) to actually wait for the job to finishing running.

The memory defaults to 8GB, time to 8hrs, and if the cmd in the input has previously been run, the cmd will be re-run.

NB: if the cmd is a duplicate of a currently queued job, this will not generate an error, but just return the id of the existing job.

func (*Runner) Status added in v1.5.0

func (r *Runner) Status(id string) (WRJobStatus, error)

Status returns the status of the wr job with the given internal ID.

Returns WRJobStatusInvalid if the ID wasn't found. Returns WRJobStatusBuried if it failed. Only returns an error if there was a problem getting the status.

func (*Runner) Wait added in v1.5.0

func (r *Runner) Wait(id string) (WRJobStatus, error)

Wait waits for the given wr job to exit.

func (*Runner) WaitForRunning added in v1.5.0

func (r *Runner) WaitForRunning(id string) error

WaitForRunning waits until the given wr job either starts running, or exits.

type WRJobStatus added in v1.5.0

type WRJobStatus int
const (
	WRJobStatusInvalid WRJobStatus = iota
	WRJobStatusDelayed
	WRJobStatusReady
	WRJobStatusReserved
	WRJobStatusRunning
	WRJobStatusLost
	WRJobStatusBuried
	WRJobStatusComplete
)

Jump to

Keyboard shortcuts

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