Documentation ¶
Index ¶
- Variables
- func HasImg() bool
- func TempDockerConfig(log hclog.Logger, target *Image, encodedAuth string) (string, error)
- type Builder
- type BuilderConfig
- type ClientConfig
- type Config
- type Deployment
- func (*Deployment) Descriptor() ([]byte, []int)deprecated
- func (x *Deployment) GetContainer() string
- func (x *Deployment) GetId() string
- func (x *Deployment) GetName() string
- func (x *Deployment) GetResourceState() *anypb.Any
- func (*Deployment) ProtoMessage()
- func (x *Deployment) ProtoReflect() protoreflect.Message
- func (x *Deployment) Reset()
- func (x *Deployment) String() string
- type Image
- func (*Image) Descriptor() ([]byte, []int)deprecated
- func (x *Image) GetDocker() *emptypb.Empty
- func (x *Image) GetImage() string
- func (x *Image) GetImg() *emptypb.Empty
- func (m *Image) GetLocation() isImage_Location
- func (x *Image) GetRegistry() *emptypb.Empty
- func (x *Image) GetTag() string
- func (i *Image) Name() string
- func (*Image) ProtoMessage()
- func (x *Image) ProtoReflect() protoreflect.Message
- func (x *Image) Reset()
- func (x *Image) String() string
- type Image_Docker
- type Image_Img
- type Image_Registry
- type Platform
- func (p *Platform) Auth() error
- func (p *Platform) AuthFunc() interface{}
- func (p *Platform) Config() (interface{}, error)
- func (p *Platform) Deploy(ctx context.Context, log hclog.Logger, src *component.Source, ...) (*Deployment, error)
- func (p *Platform) DeployFunc() interface{}
- func (p *Platform) Destroy(ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI) error
- func (p *Platform) DestroyFunc() interface{}
- func (p *Platform) Documentation() (*docs.Documentation, error)
- func (p *Platform) Status(ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI) (*sdk.StatusReport, error)
- func (p *Platform) StatusFunc() interface{}
- func (p *Platform) ValidateAuth() error
- func (p *Platform) ValidateAuthFunc() interface{}
- type PlatformConfig
- type Registry
- type Release
- type Resource
- type Resource_Container
- func (*Resource_Container) Descriptor() ([]byte, []int)deprecated
- func (x *Resource_Container) GetId() string
- func (x *Resource_Container) GetName() string
- func (*Resource_Container) ProtoMessage()
- func (x *Resource_Container) ProtoReflect() protoreflect.Message
- func (x *Resource_Container) Reset()
- func (x *Resource_Container) String() string
- type Resource_Network
- type TaskInfo
- type TaskLauncher
- func (b *TaskLauncher) Config() (interface{}, error)
- func (b *TaskLauncher) Documentation() (*docs.Documentation, error)
- func (b *TaskLauncher) StartTask(ctx context.Context, log hclog.Logger, tli *component.TaskLaunchInfo) (*TaskInfo, error)
- func (b *TaskLauncher) StartTaskFunc() interface{}
- func (b *TaskLauncher) StopTask(ctx context.Context, log hclog.Logger, ti *TaskInfo) error
- func (b *TaskLauncher) StopTaskFunc() interface{}
- type TaskLauncherConfig
- type TaskResources
Constants ¶
This section is empty.
Variables ¶
var File_waypoint_builtin_docker_plugin_proto protoreflect.FileDescriptor
var Options = []sdk.Option{ sdk.WithComponents(&Builder{}, &Registry{}, &Platform{}, &TaskLauncher{}), }
Options are the SDK options to use for instantiation.
Functions ¶
func HasImg ¶ added in v0.3.0
func HasImg() bool
HasImg returns true if "img" is available on the PATH.
This doesn't do any fancy checking that "img" is the "img" we expect. We can make the checking here more advanced later.
func TempDockerConfig ¶ added in v0.3.0
TempDockerConfig creates a new Docker configuration with the configured auth in it. It saves this Docker config to a temporary path and returns the path to that Docker file.
We have to do this because `img` doesn't support setting auth for a single operation. Therefore, we must set auth in the Docker config, but we don't want to pollute any concurrent runs or the main file. So we create a copy.
This can return ("", nil) if there is no custom Docker config necessary.
Callers should defer file deletion for this temporary file.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder uses `docker build` to build a Docker image.
func (*Builder) Build ¶
func (b *Builder) Build( ctx context.Context, ui terminal.UI, src *component.Source, log hclog.Logger, ) (*Image, error)
Build
func (*Builder) BuildFunc ¶
func (b *Builder) BuildFunc() interface{}
BuildFunc implements component.Builder
func (*Builder) Documentation ¶
func (b *Builder) Documentation() (*docs.Documentation, error)
type BuilderConfig ¶
type BuilderConfig struct { // Control whether or not to inject the entrypoint binary into the resulting image DisableCEB bool `hcl:"disable_entrypoint,optional"` // Controls whether or not the image should be build with buildkit or docker v1 UseBuildKit bool `hcl:"buildkit,optional"` // The name/path to the Dockerfile if it is not the root of the project Dockerfile string `hcl:"dockerfile,optional"` // Controls the passing of platform flag variables Platform string `hcl:"platform,optional"` // Controls the passing of build time variables BuildArgs map[string]*string `hcl:"build_args,optional"` // Controls the passing of build context Context string `hcl:"context,optional"` }
BuilderConfig is the configuration structure for the registry.
type ClientConfig ¶ added in v0.1.3
type ClientConfig struct { // Host to use when connecting to Docker // This can be used to connect to remote Docker instances Host string `hcl:"host,optional"` // Path to load the certificates for the Docker Engine CertPath string `hcl:"cert_path,optional"` // Docker API version to use for connection APIVersion string `hcl:"api_version,optional"` }
type Config ¶
type Config struct { // Image is the name of the image plus tag that the image will be pushed as. Image string `hcl:"image,attr"` // Tag is the tag to apply to the image. Tag string `hcl:"tag,attr"` // Local if true will not push this image to a remote registry. Local bool `hcl:"local,optional"` // The docker specific encoded authentication string to use to talk to the registry. EncodedAuth string `hcl:"encoded_auth,optional"` }
Config is the configuration structure for the registry.
type Deployment ¶
type Deployment struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Container string `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"` ResourceState *anypb.Any `protobuf:"bytes,4,opt,name=resource_state,json=resourceState,proto3" json:"resource_state,omitempty"` // contains filtered or unexported fields }
func (*Deployment) Descriptor
deprecated
func (*Deployment) Descriptor() ([]byte, []int)
Deprecated: Use Deployment.ProtoReflect.Descriptor instead.
func (*Deployment) GetContainer ¶
func (x *Deployment) GetContainer() string
func (*Deployment) GetId ¶
func (x *Deployment) GetId() string
func (*Deployment) GetName ¶
func (x *Deployment) GetName() string
func (*Deployment) GetResourceState ¶ added in v0.4.0
func (x *Deployment) GetResourceState() *anypb.Any
func (*Deployment) ProtoMessage ¶
func (*Deployment) ProtoMessage()
func (*Deployment) ProtoReflect ¶ added in v0.3.0
func (x *Deployment) ProtoReflect() protoreflect.Message
func (*Deployment) Reset ¶
func (x *Deployment) Reset()
func (*Deployment) String ¶
func (x *Deployment) String() string
type Image ¶
type Image struct { Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` // location is where this image is currently. This can be used to // determine if the image is pulled or not based on this proto rather // than environment inspection. // // If this is not set, it will be assumed that the image is in a local // Docker daemon registry for backwards compatiblity reasons. // // Types that are assignable to Location: // *Image_Registry // *Image_Docker // *Image_Img Location isImage_Location `protobuf_oneof:"location"` // contains filtered or unexported fields }
Image is the artifact type for the registry.
func (*Image) Descriptor
deprecated
func (*Image) GetLocation ¶ added in v0.3.0
func (m *Image) GetLocation() isImage_Location
func (*Image) GetRegistry ¶ added in v0.3.0
func (*Image) ProtoMessage ¶
func (*Image) ProtoMessage()
func (*Image) ProtoReflect ¶ added in v0.3.0
func (x *Image) ProtoReflect() protoreflect.Message
type Image_Docker ¶ added in v0.3.0
type Image_Img ¶ added in v0.3.0
type Image_Img struct { // img is set if the image is in a local img content store directory. // img: https://github.com/genuinetools/img Img *emptypb.Empty `protobuf:"bytes,5,opt,name=img,proto3,oneof"` }
type Image_Registry ¶ added in v0.3.0
type Image_Registry struct { // registry is set if the image is in a remote registry. This value // might mean the image is local, too, but we never formally "pulled" // it so we aren't sure. The image should be treated as remote. Registry *emptypb.Empty `protobuf:"bytes,3,opt,name=registry,proto3,oneof"` }
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform is the Platform implementation for Docker.
func (*Platform) AuthFunc ¶
func (p *Platform) AuthFunc() interface{}
AuthFunc implements component.Authenticator
func (*Platform) Deploy ¶
func (p *Platform) Deploy( ctx context.Context, log hclog.Logger, src *component.Source, job *component.JobInfo, img *Image, deployConfig *component.DeploymentConfig, dcr *component.DeclaredResourcesResp, ui terminal.UI, ) (*Deployment, error)
Deploy deploys an image to Docker.
func (*Platform) DeployFunc ¶
func (p *Platform) DeployFunc() interface{}
DeployFunc implements component.Platform
func (*Platform) Destroy ¶
func (p *Platform) Destroy( ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI, ) error
Destroy deletes a Docker deployment.
func (*Platform) DestroyFunc ¶
func (p *Platform) DestroyFunc() interface{}
DestroyFunc implements component.Destroyer
func (*Platform) Documentation ¶
func (p *Platform) Documentation() (*docs.Documentation, error)
func (*Platform) Status ¶ added in v0.4.0
func (p *Platform) Status( ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI, ) (*sdk.StatusReport, error)
func (*Platform) StatusFunc ¶ added in v0.4.0
func (p *Platform) StatusFunc() interface{}
StatusFunc implements component.Status
func (*Platform) ValidateAuth ¶
func (*Platform) ValidateAuthFunc ¶
func (p *Platform) ValidateAuthFunc() interface{}
ValidateAuthFunc implements component.Authenticator
type PlatformConfig ¶
type PlatformConfig struct { // A list of folders to mount to the container. Binds []string `hcl:"binds,optional"` // ClientConfig allow the user to specify the connection to the Docker // engine. By default we try to load this from env vars: // DOCKER_HOST to set the url to the docker server. // DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. // DOCKER_CERT_PATH to load the TLS certificates from. // DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. ClientConfig *ClientConfig `hcl:"client_config,block"` // The command to run in the container. This is an array of arguments // that are executed directly. These are not executed in the context of // a shell. If you want to use a shell, add that to this command manually. Command []string `hcl:"command,optional"` // Force pull the image from the remote repository ForcePull bool `hcl:"force_pull,optional"` // A map of key/value pairs, stored in docker as a string. Each key/value pair must // be unique. Validiation occurs at the docker layer, not in Waypoint. Label // keys are alphanumeric strings which may contain periods (.) and hyphens (-). // See the docker docs for more info: https://docs.docker.com/config/labels-custom-metadata/ Labels map[string]string `hcl:"labels,optional"` // An array of strings with network names to connect the container to Networks []string `hcl:"networks,optional"` // A map of resources to configure the container with such as memory and cpu // limits. Resources map[string]string `hcl:"resources,optional"` // A path to a directory that will be created for the service to store // temporary data. ScratchSpace string `hcl:"scratch_path,optional"` // Environment variables that are meant to configure the application in a static // way. This might be control an image that has mulitple modes of operation, // selected via environment variable. Most configuration should use the waypoint // config commands. StaticEnvVars map[string]string `hcl:"static_environment,optional"` // Additional ports the application is listening on to expose on the container ExtraPorts []uint `hcl:"extra_ports,optional"` // Port that your service is running on within the actual container. // Defaults to port 3000. // TODO Evaluate if this should remain as a default 3000, should be a required field, // or default to another port. ServicePort uint `hcl:"service_port,optional"` }
Config is the configuration structure for the Platform.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry represents access to a Docker registry.
func (*Registry) Documentation ¶
func (r *Registry) Documentation() (*docs.Documentation, error)
type Release ¶
type Release struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*Release) Descriptor
deprecated
func (*Release) ProtoMessage ¶
func (*Release) ProtoMessage()
func (*Release) ProtoReflect ¶ added in v0.3.0
func (x *Release) ProtoReflect() protoreflect.Message
type Resource ¶ added in v0.4.0
type Resource struct {
// contains filtered or unexported fields
}
Resource contains the internal resource states.
func (*Resource) Descriptor
deprecated
added in
v0.4.0
func (*Resource) ProtoMessage ¶ added in v0.4.0
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶ added in v0.4.0
func (x *Resource) ProtoReflect() protoreflect.Message
type Resource_Container ¶ added in v0.4.0
type Resource_Container struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Resource_Container) Descriptor
deprecated
added in
v0.4.0
func (*Resource_Container) Descriptor() ([]byte, []int)
Deprecated: Use Resource_Container.ProtoReflect.Descriptor instead.
func (*Resource_Container) GetId ¶ added in v0.4.0
func (x *Resource_Container) GetId() string
func (*Resource_Container) GetName ¶ added in v0.4.0
func (x *Resource_Container) GetName() string
func (*Resource_Container) ProtoMessage ¶ added in v0.4.0
func (*Resource_Container) ProtoMessage()
func (*Resource_Container) ProtoReflect ¶ added in v0.4.0
func (x *Resource_Container) ProtoReflect() protoreflect.Message
func (*Resource_Container) Reset ¶ added in v0.4.0
func (x *Resource_Container) Reset()
func (*Resource_Container) String ¶ added in v0.4.0
func (x *Resource_Container) String() string
type Resource_Network ¶ added in v0.4.0
type Resource_Network struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Resource_Network) Descriptor
deprecated
added in
v0.4.0
func (*Resource_Network) Descriptor() ([]byte, []int)
Deprecated: Use Resource_Network.ProtoReflect.Descriptor instead.
func (*Resource_Network) GetName ¶ added in v0.4.0
func (x *Resource_Network) GetName() string
func (*Resource_Network) ProtoMessage ¶ added in v0.4.0
func (*Resource_Network) ProtoMessage()
func (*Resource_Network) ProtoReflect ¶ added in v0.4.0
func (x *Resource_Network) ProtoReflect() protoreflect.Message
func (*Resource_Network) Reset ¶ added in v0.4.0
func (x *Resource_Network) Reset()
func (*Resource_Network) String ¶ added in v0.4.0
func (x *Resource_Network) String() string
type TaskInfo ¶ added in v0.5.0
type TaskInfo struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*TaskInfo) Descriptor
deprecated
added in
v0.5.0
func (*TaskInfo) ProtoMessage ¶ added in v0.5.0
func (*TaskInfo) ProtoMessage()
func (*TaskInfo) ProtoReflect ¶ added in v0.5.0
func (x *TaskInfo) ProtoReflect() protoreflect.Message
type TaskLauncher ¶ added in v0.5.0
type TaskLauncher struct {
// contains filtered or unexported fields
}
TaskLauncher uses `docker build` to build a Docker iamge.
func (*TaskLauncher) Config ¶ added in v0.5.0
func (b *TaskLauncher) Config() (interface{}, error)
TaskLauncher implements Configurable
func (*TaskLauncher) Documentation ¶ added in v0.5.0
func (b *TaskLauncher) Documentation() (*docs.Documentation, error)
func (*TaskLauncher) StartTask ¶ added in v0.5.0
func (b *TaskLauncher) StartTask( ctx context.Context, log hclog.Logger, tli *component.TaskLaunchInfo, ) (*TaskInfo, error)
StartTask creates a docker container for the task.
func (*TaskLauncher) StartTaskFunc ¶ added in v0.5.0
func (b *TaskLauncher) StartTaskFunc() interface{}
BuildFunc implements component.TaskLauncher
func (*TaskLauncher) StopTask ¶ added in v0.5.0
func (b *TaskLauncher) StopTask( ctx context.Context, log hclog.Logger, ti *TaskInfo, ) error
StopTask signals to docker to stop the container created previously
func (*TaskLauncher) StopTaskFunc ¶ added in v0.5.0
func (b *TaskLauncher) StopTaskFunc() interface{}
BuildFunc implements component.TaskLauncher
type TaskLauncherConfig ¶ added in v0.5.0
type TaskLauncherConfig struct { // A list of folders to mount to the container. Binds []string `hcl:"binds,optional"` // ClientConfig allow the user to specify the connection to the Docker // engine. By default we try to load this from env vars: // DOCKER_HOST to set the url to the docker server. // DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. // DOCKER_CERT_PATH to load the TLS certificates from. // DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. ClientConfig *ClientConfig `hcl:"client_config,block"` // Force pull the image from the remote repository ForcePull bool `hcl:"force_pull,optional"` // A map of key/value pairs, stored in docker as a string. Each key/value pair must // be unique. Validiation occurs at the docker layer, not in Waypoint. Label // keys are alphanumeric strings which may contain periods (.) and hyphens (-). // See the docker docs for more info: https://docs.docker.com/config/labels-custom-metadata/ Labels map[string]string `hcl:"labels,optional"` // An array of strings with network names to connect the container to Networks []string `hcl:"networks,optional"` // Resources configures the resource constraints such as cpu and memory for the // created containers. Resources TaskResources `hcl:"resources,block"` // Environment variables that are meant to configure the application in a static // way. This might be start an image in a specific mode, // selected via environment variable. Most configuration should use the waypoint // config commands. StaticEnvVars map[string]string `hcl:"static_environment,optional"` }
TaskLauncherConfig is the configuration structure for the task plugin.