workerruntime

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadinessServices added in v0.53.1

func IsReadinessServices(ctx context.Context) (bool, error)

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 SetIsReadinessServices added in v0.53.1

func SetIsReadinessServices(ctx context.Context, i bool) context.Context

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 V2_cacheLinkHandler added in v0.55.0

func V2_cacheLinkHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_cacheSignatureHandler added in v0.55.0

func V2_cacheSignatureHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_contextHandler added in v0.53.1

func V2_contextHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_jobRunHandler added in v0.53.1

func V2_jobRunHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_outputHandler added in v0.53.1

func V2_outputHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_projectKeyHandler added in v0.55.0

func V2_projectKeyHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_runResultHandler added in v0.53.1

func V2_runResultHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_runResultsSynchronizeHandler added in v0.55.0

func V2_runResultsSynchronizeHandler(ctx context.Context, wk Runtime) http.HandlerFunc

func V2_workerConfig added in v0.55.0

func V2_workerConfig(ctx context.Context, wk Runtime) http.HandlerFunc

func WorkingDirectory

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

Types

type CDNSignature added in v0.55.0

type CDNSignature struct {
	Signature  string `json:"signature"`
	CDNAddress string `json:"cdn_address"`
}

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 OutputRequest added in v0.53.1

type OutputRequest struct {
	Name             string `json:"name"`
	Value            string `json:"value"`
	WorkflowRunID    string `json:"workflow_run_id"`
	WorkflowRunJobID string `json:"workflow_run_job_id"`
}

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

	V2AddRunResult(ctx context.Context, req V2RunResultRequest) (*V2AddResultResponse, error)
	V2UpdateRunResult(ctx context.Context, req V2RunResultRequest) (*V2UpdateResultResponse, error)
	AddStepOutput(ctx context.Context, outputName string, outputValue string)
	V2RunResultsSynchronize(ctx context.Context) error
	V2GetRunResult(ctx context.Context, filter V2FilterRunResult) (*V2GetResultResponse, error)
	V2GetJobRun(ctx context.Context) *sdk.V2WorkflowRunJob
	V2GetJobContext(ctx context.Context) *sdk.WorkflowRunJobsContext
	V2GetCacheSignature(ctx context.Context, cacheKey string) (*CDNSignature, error)
	V2GetCacheLink(ctx context.Context, cacheKey string) (*sdk.CDNItemLinks, error)
	V2GetProjectKey(ctx context.Context, keyName string, clear bool) (*sdk.ProjectKey, 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 V2AddResultResponse added in v0.53.1

type V2AddResultResponse struct {
	RunResult    *sdk.V2WorkflowRunResult
	CDNSignature string
}

type V2FilterRunResult added in v0.53.1

type V2FilterRunResult struct {
	Pattern string
	Type    []sdk.V2WorkflowRunResultType
}

type V2GetResultResponse added in v0.53.1

type V2GetResultResponse struct {
	RunResults   []sdk.V2WorkflowRunResult
	CDNSignature string
}

type V2RunResultRequest added in v0.53.1

type V2RunResultRequest struct {
	RunResult   *sdk.V2WorkflowRunResult
	CDNItemLink sdk.CDNItemLink // TODO
}

type V2UpdateResultResponse added in v0.53.1

type V2UpdateResultResponse struct {
	RunResult *sdk.V2WorkflowRunResult
}

type V2WorkerConfig added in v0.55.0

type V2WorkerConfig struct {
	CDNEndpoint string `json:"cdn_endpoint"`
}

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

Directories

Path Synopsis
Package mock_workerruntime is a generated GoMock package.
Package mock_workerruntime is a generated GoMock package.

Jump to

Keyboard shortcuts

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