workerruntime

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: BSD-3-Clause Imports: 11 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 RunJobID added in v0.53.0

func RunJobID(ctx context.Context) string

func SetJobID

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

func SetKeysDirectory

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

func SetRunJobID added in v0.53.0

func SetRunJobID(ctx context.Context, i string) 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
	GetIntegrationPlugin(pluginType string) *sdk.GRPCPlugin
	GetActionPlugin(pluginName string) *sdk.GRPCPlugin
	SetActionPlugin(p *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
	ClientV2() cdsclient.V2WorkerInterface
	BaseDir() afero.Fs
	Environ() []string
	Blur(interface{}) error
	HTTPPort() int32
	Parameters() []sdk.Parameter
	PluginGet(pluginName string) (*sdk.GRPCPlugin, error)
	PluginGetBinary(name, os, arch string, w io.Writer) error
}

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"`
	CDNEndpoint              string            `json:"cdn_endpoint"`
	GelfServiceAddr          string            `json:"gelf_service_addr"`
	GelfServiceAddrEnableTLS bool              `json:"gelf_service_addr_enable_tls,omitempty"`
	Model                    string            `json:"model"`
	BookedJobID              int64             `json:"booked_job_id,omitempty"`
	RunJobID                 string            `json:"run_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