Documentation
¶
Overview ¶
Package runtime provides the ability for Vela to integrate with different supported Runtime environments.
Currently the following runtimes are supported:
* Docker - https://docker.io/ * Kubernetes - https://kubernetes.io/
Usage:
import "github.com/go-vela/pkg-runtime/runtime"
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Flags = []cli.Flag{ &cli.StringFlag{ EnvVars: []string{"RUNTIME_LOG_LEVEL", "VELA_LOG_LEVEL", "LOG_LEVEL"}, Name: "runtime.log.level", Usage: "set log level - options: (trace|debug|info|warn|error|fatal|panic)", Value: "info", }, &cli.StringFlag{ EnvVars: []string{"VELA_RUNTIME_DRIVER", "RUNTIME_DRIVER"}, Name: "runtime.driver", Usage: "name of runtime driver to use", Value: constants.DriverDocker, }, &cli.StringFlag{ EnvVars: []string{"VELA_RUNTIME_CONFIG", "RUNTIME_CONFIG"}, Name: "runtime.config", Usage: "path to runtime configuration file", }, &cli.StringFlag{ EnvVars: []string{"VELA_RUNTIME_NAMESPACE", "RUNTIME_NAMESPACE"}, Name: "runtime.namespace", Usage: "name of namespace for runtime configuration (kubernetes runtime only)", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_RUNTIME_VOLUMES", "RUNTIME_VOLUMES"}, Name: "runtime.volumes", Usage: "set of volumes to mount into the runtime", }, &cli.StringSliceFlag{ EnvVars: []string{"VELA_ALLOWED_PRIVILEGED_IMAGES", "RUNTIME_VOLUMES"}, Name: "runtime.allowed-privileged-images", Usage: "set of images that are allowed to run in privileged mode", }, }
Flags represents all supported command line interface (CLI) flags for the runtime.
Functions ¶
func WithContext ¶
WithContext inserts the runtime Engine into the context.Context.
func WithGinContext ¶
WithGinContext inserts the runtime Engine into the gin.Context.
Types ¶
type Engine ¶
type Engine interface {
// Driver defines a function that outputs
// the configured runtime driver.
Driver() string
// InspectContainer defines a function that inspects
// the pipeline container.
InspectContainer(context.Context, *pipeline.Container) error
// RemoveContainer defines a function that deletes
// (kill, remove) the pipeline container.
RemoveContainer(context.Context, *pipeline.Container) error
// RunContainer defines a function that creates
// and starts the pipeline container.
RunContainer(context.Context, *pipeline.Container, *pipeline.Build) error
// SetupContainer defines a function that prepares
// the image for the pipeline container.
SetupContainer(context.Context, *pipeline.Container) error
// TailContainer defines a function that captures
// the logs on the pipeline container.
TailContainer(context.Context, *pipeline.Container) (io.ReadCloser, error)
// WaitContainer defines a function that blocks
// until the pipeline container completes.
WaitContainer(context.Context, *pipeline.Container) error
// CreateImage defines a function that
// creates the pipeline container image.
CreateImage(context.Context, *pipeline.Container) error
// InspectImage defines a function that
// inspects the pipeline container image.
InspectImage(context.Context, *pipeline.Container) ([]byte, error)
// CreateNetwork defines a function that
// creates the pipeline network.
CreateNetwork(context.Context, *pipeline.Build) error
// InspectNetwork defines a function that
// inspects the pipeline network.
InspectNetwork(context.Context, *pipeline.Build) ([]byte, error)
// RemoveNetwork defines a function that
// deletes the pipeline network.
RemoveNetwork(context.Context, *pipeline.Build) error
// CreateVolume defines a function that
// creates the pipeline volume.
CreateVolume(context.Context, *pipeline.Build) error
// InspectVolume defines a function that
// inspects the pipeline volume.
InspectVolume(context.Context, *pipeline.Build) ([]byte, error)
// RemoveVolume defines a function that
// deletes the pipeline volume.
RemoveVolume(context.Context, *pipeline.Build) error
}
Engine represents the interface for Vela integrating with the different supported Runtime environments.
func FromContext ¶
FromContext retrieves the runtime Engine from the context.Context.
func FromGinContext ¶
FromGinContext retrieves the runtime Engine from the gin.Context.
type Setup ¶
type Setup struct {
Driver string
Config string
Namespace string
Volumes []string
PrivilegedImages []string
}
Setup represents the configuration necessary for creating a Vela engine capable of integrating with a configured runtime environment.
func (*Setup) Docker ¶
Docker creates and returns a Vela engine capable of integrating with a Docker runtime environment.
func (*Setup) Kubernetes ¶
Kubernetes creates and returns a Vela engine capable of integrating with a Kubernetes runtime environment.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package docker provides the ability for Vela to integrate with Docker as a runtime environment.
|
Package docker provides the ability for Vela to integrate with Docker as a runtime environment. |
|
Package kubernetes provides the ability for Vela to integrate with Kubernetes as a runtime environment.
|
Package kubernetes provides the ability for Vela to integrate with Kubernetes as a runtime environment. |