runtime

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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