runtime

package
v0.0.0-...-f0390b6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuntimeRegistrySingleton = registry.NewRegistry("processor_build_runtime")

Functions

This section is empty.

Types

type AbstractRuntime

type AbstractRuntime struct {
	Logger         logger.Logger
	StagingDir     string
	FunctionConfig *functionconfig.Config
	DockerClient   dockerclient.Client
	CmdRunner      cmdrunner.CmdRunner
	VersionInfo    *version.Info
}

func NewAbstractRuntime

func NewAbstractRuntime(logger logger.Logger,
	containerBuilderKind string,
	stagingDir string,
	functionConfig *functionconfig.Config) (*AbstractRuntime, error)

func (*AbstractRuntime) DetectFunctionHandlers

func (ar *AbstractRuntime) DetectFunctionHandlers(functionPath string) ([]string, error)

DetectFunctionHandlers returns a list of all the handlers in that directory given a path holding a function (or functions)

func (*AbstractRuntime) GetFunctionDir

func (ar *AbstractRuntime) GetFunctionDir() string

func (*AbstractRuntime) GetHandlerDirObjectPaths

func (ar *AbstractRuntime) GetHandlerDirObjectPaths() []string

GetHandlerDirObjectPaths returns the paths of all objects that should reside in the handler directory

func (*AbstractRuntime) GetOverrideImageRegistryFromMap

func (ar *AbstractRuntime) GetOverrideImageRegistryFromMap(imagesOverrideMap map[string]string) string

func (*AbstractRuntime) GetProcessorImageObjectPaths

func (ar *AbstractRuntime) GetProcessorImageObjectPaths() map[string]string

GetProcessorImageObjectPaths return a map of objects the runtime needs to copy into the processor image the key can be a dir, a file or a url of a file the value is an absolute path into the docker image

func (*AbstractRuntime) GetRuntimeBuildArgs

func (ar *AbstractRuntime) GetRuntimeBuildArgs(runtimeConfig *runtimeconfig.Config) map[string]string

func (*AbstractRuntime) OnAfterStagingDirCreated

func (ar *AbstractRuntime) OnAfterStagingDirCreated(runtimeConfig *runtimeconfig.Config, stagingDir string) error

type Artifact

type Artifact struct {
	Name          string
	Image         string
	Paths         map[string]string
	ExternalImage bool
}

type Factory

type Factory interface {
	Create(logger.Logger, string, string, *functionconfig.Config) (Runtime, error)
}

type ProcessorDockerfileInfo

type ProcessorDockerfileInfo struct {
	BaseImage          string
	ImageArtifactPaths map[string]string
	OnbuildArtifacts   []Artifact
	Directives         map[string][]functionconfig.Directive
	DockerfileContents string
	DockerfilePath     string
	BuildArgs          map[string]string
}

type Runtime

type Runtime interface {
	// DetectFunctionHandlers returns a list of all the handlers
	// in that directory given a path holding a function (or functions)
	DetectFunctionHandlers(functionPath string) ([]string, error)

	// OnAfterStagingDirCreated prepares anything it may need in that directory
	// towards building a functioning processor,
	OnAfterStagingDirCreated(runtimeConfig *runtimeconfig.Config, stagingDir string) error

	// GetProcessorDockerfileInfo returns information required to build the processor Dockerfile
	GetProcessorDockerfileInfo(runtimeConfig *runtimeconfig.Config, onbuildImageRegistry string) (*ProcessorDockerfileInfo, error)

	// GetName returns the name of the runtime, including version if applicable
	GetName() string

	// GetHandlerDirObjectPaths returns the paths of all objects that should reside in the handler
	// directory
	GetHandlerDirObjectPaths() []string

	// GetOverrideImageRegistryFromMap returns an override image for the runtime from the given map
	GetOverrideImageRegistryFromMap(map[string]string) string

	// GetRuntimeBuildArgs returns building arguments
	GetRuntimeBuildArgs(runtimeConfig *runtimeconfig.Config) map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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