job_compilers

package
v0.0.0-...-dfed899 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package job_compilers contains functionality to convert a Flamenco job definition into concrete tasks and commands to execute by Workers.

Index

Constants

This section is empty.

Variables

View Source
var ErrJobTypeBadEtag = errors.New("job type etag does not match")
View Source
var ErrJobTypeUnknown = errors.New("job type unknown")
View Source
var ErrScriptIncomplete = errors.New("job compiler script incomplete")

Functions

func AuthorModule

func AuthorModule(r *goja.Runtime, module *goja.Object)

AuthorModule exports the Author module members to Goja.

func PathModule

func PathModule(r *goja.Runtime, module *goja.Object)

PathModule provides file path manipulation functions by wrapping Go's `path`.

func ProcessModule

func ProcessModule(r *goja.Runtime, module *goja.Object)

Types

type Author

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

Author allows scripts to author tasks and commands.

func (*Author) Command

func (a *Author) Command(cmdName string, parameters AuthoredCommandParameters) (*AuthoredCommand, error)

func (*Author) Task

func (a *Author) Task(name string, taskType string) (*AuthoredTask, error)

type AuthoredCommand

type AuthoredCommand struct {
	Name       string
	Parameters AuthoredCommandParameters
}

type AuthoredCommandParameters

type AuthoredCommandParameters map[string]interface{}

type AuthoredJob

type AuthoredJob struct {
	JobID         string
	WorkerTagUUID string

	Name     string
	JobType  string
	Priority int
	Status   api.JobStatus

	Created time.Time

	Settings JobSettings
	Metadata JobMetadata
	Storage  JobStorageInfo

	Tasks []AuthoredTask
}

func (*AuthoredJob) AddTask

func (aj *AuthoredJob) AddTask(at *AuthoredTask)

type AuthoredTask

type AuthoredTask struct {
	// Tasks already get their UUID in the authoring stage. This makes it simpler
	// to store the dependencies, as the code doesn't have to worry about value
	// vs. pointer semantics. Tasks can always be unambiguously referenced by
	// their UUID.
	UUID     string
	Name     string
	Type     string
	Priority int
	Commands []AuthoredCommand

	// Dependencies are tasks that need to be completed before this one can run.
	Dependencies []*AuthoredTask `json:"omitempty" yaml:"omitempty"`
}

func (*AuthoredTask) AddCommand

func (at *AuthoredTask) AddCommand(ac *AuthoredCommand)

func (*AuthoredTask) AddDependency

func (at *AuthoredTask) AddDependency(dep *AuthoredTask) error

type Compiler

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

type ErrInvalidRange

type ErrInvalidRange struct {
	Range   string // The frame range that was invalid.
	Message string // The error message
	// contains filtered or unexported fields
}

func (ErrInvalidRange) Error

func (e ErrInvalidRange) Error() string

func (ErrInvalidRange) Unwrap

func (e ErrInvalidRange) Unwrap() error

type JobMetadata

type JobMetadata map[string]string

type JobSettings

type JobSettings map[string]interface{}

type JobStorageInfo

type JobStorageInfo struct {
	ShamanCheckoutID string
}

type Process

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

Process implements a subset of the built-in NodeJS process object. It purely exists to make a few NPM-installed packages work. See https://nodejs.org/api/process.html

type Service

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

Service contains job compilers defined in JavaScript.

func Load

func Load(ts TimeService) (*Service, error)

Load returns a job compiler service with all JS files loaded.

func (*Service) Compile

func (s *Service) Compile(ctx context.Context, sj api.SubmittedJob) (*AuthoredJob, error)

func (*Service) GetJobType

func (s *Service) GetJobType(typeName string) (api.AvailableJobType, error)

GetJobType returns information about the named job type. Returns ErrJobTypeUnknown when the name doesn't correspond with a known job type.

func (*Service) ListJobTypes

func (s *Service) ListJobTypes() api.AvailableJobTypes

ListJobTypes returns the list of available job types.

type TimeService

type TimeService interface {
	Now() time.Time
}

TimeService is a service that can tell the current time.

type VM

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

Jump to

Keyboard shortcuts

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