workerruntime

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobID

func JobID(ctx context.Context) (int64, error)

func KeysDirectory

func KeysDirectory(ctx context.Context) (afero.File, error)

func SetJobID

func SetJobID(ctx context.Context, i int64) context.Context

func SetKeysDirectory

func SetKeysDirectory(ctx context.Context, s afero.File) context.Context

func SetStepName

func SetStepName(ctx context.Context, name string) context.Context

func SetStepOrder

func SetStepOrder(ctx context.Context, i int) context.Context

func SetTmpDirectory

func SetTmpDirectory(ctx context.Context, s afero.File) context.Context

func SetWorkingDirectory

func SetWorkingDirectory(ctx context.Context, s afero.File) context.Context

func StepName

func StepName(ctx context.Context) (string, error)

func StepOrder

func StepOrder(ctx context.Context) (int, error)

func TmpDirectory

func TmpDirectory(ctx context.Context) (afero.File, error)

func WorkingDirectory

func WorkingDirectory(ctx context.Context) (afero.File, error)

Types

type CDSVersionSet

type CDSVersionSet struct {
	Value string `json:"value"`
}

type DownloadArtifact

type DownloadArtifact struct {
	Workflow    string `json:"workflow"`
	Number      int64  `json:"number"`
	Pattern     string `json:"pattern" cli:"pattern"`
	Tag         string `json:"tag" cli:"tag"`
	Destination string `json:"destination"`
}

type FilePath

type FilePath struct {
	Path string `json:"path"`
}

type KeyResponse

type KeyResponse struct {
	PKey    string      `json:"pkey"`
	Type    sdk.KeyType `json:"type"`
	Content []byte      `json:"-"`
}

type Level

type Level string
const (
	LevelDebug Level = "DEBUG"
	LevelInfo  Level = "INFO"
	LevelWarn  Level = "WARN"
	LevelError Level = "ERROR"
)

type Runtime

type Runtime interface {
	Name() string
	Register(ctx context.Context) error
	Take(ctx context.Context, job sdk.WorkflowNodeJobRun) error
	ProcessJob(job sdk.WorkflowNodeJobRunData) sdk.Result
	SendLog(ctx context.Context, level Level, format string)
	RunResultSignature(fileName string, perm uint32, t sdk.WorkflowRunResultType) (string, error)
	WorkerCacheSignature(tag string) (string, error)
	FeatureEnabled(featureName sdk.FeatureName) bool
	GetPlugin(pluginType string) *sdk.GRPCPlugin
	GetJobIdentifiers() (int64, int64, int64)
	CDNHttpURL() string
	InstallKey(key sdk.Variable) (*KeyResponse, error)
	InstallKeyTo(key sdk.Variable, destinationPath string) (*KeyResponse, error)
	Unregister(ctx context.Context) error
	Client() cdsclient.WorkerInterface
	BaseDir() afero.Fs
	Environ() []string
	Blur(interface{}) error
	HTTPPort() int32
	Parameters() []sdk.Parameter
}

type TmplPath

type TmplPath struct {
	Path        string `json:"path"`
	Destination string `json:"destination"`
}

type UploadArtifact

type UploadArtifact struct {
	Name             string `json:"name"`
	Tag              string `json:"tag"`
	WorkingDirectory string `json:"working_directory"`
}

type WorkerConfig

type WorkerConfig struct {
	Name                string            `json:"name"`
	Basedir             string            `json:"basedir"`
	Log                 cdslog.Conf       `json:"log"`
	HatcheryName        string            `json:"hatchery_name"`
	APIEndpoint         string            `json:"api_endpoint"`
	APIEndpointInsecure bool              `json:"api_endpoint_insecure,omitempty"`
	APIToken            string            `json:"api_token"`
	Model               string            `json:"model"`
	BookedJobID         int64             `json:"booked_job_id,omitempty"`
	Region              string            `json:"region,omitempty"`
	InjectEnvVars       map[string]string `json:"inject_env_vars,omitempty"`
}

func (WorkerConfig) EncodeBase64

func (cfg WorkerConfig) EncodeBase64() string

Jump to

Keyboard shortcuts

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