Documentation ¶
Index ¶
- Variables
- func DockerHostExposedPorts() ([]int, error)
- func RunAsync(s Stream, cmd *exec.Cmd, done chan error, opts RunnerOptions)
- func UpperName(name string) string
- type ArgOptions
- type Build
- type BuildOptions
- type Command
- type Environment
- type EnvironmentItem
- type Exec
- type ExternalNetwork
- type InternalNetwork
- type Labels
- type Manifest
- func (m Manifest) BalancerResourceName(process string) string
- func (m Manifest) Balancers() []ManifestBalancer
- func (m *Manifest) Build(dir, appName string, s Stream, opts BuildOptions) error
- func (m Manifest) EntryNames() []string
- func (m *Manifest) ExternalPorts() []int
- func (m Manifest) GetBalancer(name string) *ManifestBalancer
- func (m Manifest) HasExternalPorts() bool
- func (m Manifest) HasProcesses() bool
- func (m *Manifest) InternalPorts() []int
- func (m Manifest) MarshalYAML() (interface{}, error)
- func (m *Manifest) PortConflicts() ([]int, error)
- func (m *Manifest) Push(template, app, build string, stream Stream) error
- func (m *Manifest) Raw() ([]byte, error)
- func (m *Manifest) Run(dir, app string, opts RunOptions) Run
- func (m Manifest) Service(name string) (*Service, error)
- func (m *Manifest) Shift(shift int) error
- func (m *Manifest) UDPPorts() []int
- func (m Manifest) Validate() []error
- type ManifestBalancer
- func (mb ManifestBalancer) DrainingTimeout() (string, error)
- func (mb ManifestBalancer) ExternalPorts() []Port
- func (mb ManifestBalancer) FirstPort() string
- func (mb ManifestBalancer) HealthInterval() (string, error)
- func (mb ManifestBalancer) HealthPath() string
- func (mb ManifestBalancer) HealthPort() string
- func (mb ManifestBalancer) HealthProtocol() string
- func (mb ManifestBalancer) HealthThresholdHealthy() string
- func (mb ManifestBalancer) HealthThresholdUnhealthy() string
- func (mb ManifestBalancer) HealthTimeout() string
- func (mb ManifestBalancer) IdleTimeout() (string, error)
- func (mb ManifestBalancer) InstanceProtocol(p Port) string
- func (mb ManifestBalancer) InternalPorts() []Port
- func (mb ManifestBalancer) ListenerProtocol(p Port) string
- func (mb ManifestBalancer) LoadBalancerName(app string) string
- func (mb ManifestBalancer) PortMappings() []Port
- func (mb ManifestBalancer) Ports() []string
- func (mb ManifestBalancer) ProcessName() string
- func (mb ManifestBalancer) Protocol(p Port) string
- func (mb ManifestBalancer) ProxyProtocol(p Port) bool
- func (mb ManifestBalancer) Randoms() map[string]int
- func (mb ManifestBalancer) ResourceName() string
- func (mb ManifestBalancer) Scheme() string
- type Memory
- type MountableVolume
- type Network
- type Networks
- type Output
- type Port
- type Ports
- type Process
- type Protocol
- type Proxy
- type Run
- type RunOptions
- type Runner
- type RunnerOptions
- type Service
- func (s Service) ContainerPorts() []string
- func (s Service) DefaultParams() string
- func (s Service) DeploymentMaximum() string
- func (s Service) DeploymentMinimum() string
- func (s Service) ExternalPorts() []Port
- func (s Service) ExtraHostsMap() map[string]string
- func (s Service) HasBalancer() bool
- func (s Service) InternalPorts() []Port
- func (s Service) IsAgent() bool
- func (s Service) LabelDefault(label, def string) string
- func (s Service) LabelsByPrefix(prefix string) map[string]string
- func (s Service) MountableVolumes() []MountableVolume
- func (s *Service) NetworkName() string
- func (s Service) ParamName(name string) string
- func (s *Service) Process(app string, m Manifest) Process
- func (s *Service) Proxies(app string) []Proxy
- func (s *Service) Randoms() map[string]int
- func (s Service) RegistryImage(appName, buildId string, outputs map[string]string) string
- func (s *Service) SyncPaths() (map[string]string, error)
- func (s Service) TCPPorts() []Port
- func (s *Service) Tag(appName string) string
- func (s Service) UDPPorts() []Port
- func (s Service) UseSecureEnvironment() bool
- type Services
- type Stream
Constants ¶
This section is empty.
Variables ¶
var ManifestRandomPorts = true
Functions ¶
func DockerHostExposedPorts ¶
Types ¶
type ArgOptions ¶
type Build ¶
type Build struct { Context string `yaml:"context,omitempty"` Dockerfile string `yaml:"dockerfile,omitempty"` Args map[string]string `yaml:"args,omitempty"` }
see yaml.go for unmarshallers
func (*Build) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaller interface.
type BuildOptions ¶
type Command ¶
Command represents the command docker will run either in string or array of strings
func (Command) MarshalYAML ¶
MarshalYAML implements the Marshaller interface for the Command type
func (*Command) UnmarshalYAML ¶
type Environment ¶
type Environment []EnvironmentItem
Environment is a service's default environment
func (Environment) Len ¶
func (ee Environment) Len() int
func (Environment) Less ¶
func (ee Environment) Less(i, j int) bool
func (Environment) MarshalYAML ¶
func (ee Environment) MarshalYAML() (interface{}, error)
MarshalYAML implements the Marshaller interface for the Environment type
func (Environment) Swap ¶
func (ee Environment) Swap(i, j int)
func (*Environment) UnmarshalYAML ¶
func (e *Environment) UnmarshalYAML(unmarshal func(interface{}) error) error
type EnvironmentItem ¶
type EnvironmentItem struct { Name string Value string Needed bool // if true this value should be provided by the user in .env or convox env }
EnvironmentItem is a single item in an environment
type Exec ¶
type Exec struct{}
func (*Exec) CombinedOutput ¶
CombinedOutput synchronously calls the command and returns the output, useful for internal checks
type ExternalNetwork ¶
type ExternalNetwork Network
type InternalNetwork ¶
type InternalNetwork map[string]ExternalNetwork
type Labels ¶
func (*Labels) UnmarshalYAML ¶
type Manifest ¶
type Manifest struct { Version string `yaml:"version"` Networks Networks `yaml:"networks,omitempty"` Services map[string]Service `yaml:"services"` }
func (Manifest) BalancerResourceName ¶
func (Manifest) Balancers ¶
func (m Manifest) Balancers() []ManifestBalancer
func (*Manifest) Build ¶
func (m *Manifest) Build(dir, appName string, s Stream, opts BuildOptions) error
func (Manifest) EntryNames ¶
func (*Manifest) ExternalPorts ¶
ExternalPorts returns a collection of ints of the Manifest's Services' external ports
func (Manifest) GetBalancer ¶
func (m Manifest) GetBalancer(name string) *ManifestBalancer
func (Manifest) HasExternalPorts ¶
HasExternalPorts returns true if the Manifest's Services have external ports
func (Manifest) HasProcesses ¶
func (*Manifest) InternalPorts ¶
InternalPorts returns a collection of ints of the Manifest's Services' internal ports
func (Manifest) MarshalYAML ¶
MarshalYAML implements the Marshaller interface for the Manifest type
func (*Manifest) PortConflicts ¶
Find any port conflits that would prevent this manifest from running TODO - Doesn't find UDP port conflicts
func (*Manifest) Run ¶
func (m *Manifest) Run(dir, app string, opts RunOptions) Run
Run Instantiate a Run object based on this manifest to be run via 'convox start'
func (*Manifest) Shift ¶
Shift all external ports and labels in this Manifest by the given amount and their shift labels
type ManifestBalancer ¶
func (ManifestBalancer) DrainingTimeout ¶
func (mb ManifestBalancer) DrainingTimeout() (string, error)
DrainingTimeout The amount of time to allow a draining balancer to keep active connections open.
func (ManifestBalancer) ExternalPorts ¶
func (mb ManifestBalancer) ExternalPorts() []Port
ExternalPorts returns a collection of Port structs of the Manifest's external ports
func (ManifestBalancer) FirstPort ¶
func (mb ManifestBalancer) FirstPort() string
FirstPort returns the first TCP Port defined on the first Service in the Manifest
func (ManifestBalancer) HealthInterval ¶
func (mb ManifestBalancer) HealthInterval() (string, error)
HealthInterval The amount of time in between health checks. This is derived from the timeout value, which must be less than the interval
func (ManifestBalancer) HealthPath ¶
func (mb ManifestBalancer) HealthPath() string
HealthPath The path to check for health. If unset, then implies TCP check
func (ManifestBalancer) HealthPort ¶
func (mb ManifestBalancer) HealthPort() string
HealthPort The balancer port that maps to the container port specified in manifest
func (ManifestBalancer) HealthProtocol ¶
func (mb ManifestBalancer) HealthProtocol() string
HealthProtocol returns the protocol to use for the health check
func (ManifestBalancer) HealthThresholdHealthy ¶
func (mb ManifestBalancer) HealthThresholdHealthy() string
HealthThresholdHealthy The number of consecutive successful health checks that must occur before declaring an EC2 instance healthy.
func (ManifestBalancer) HealthThresholdUnhealthy ¶
func (mb ManifestBalancer) HealthThresholdUnhealthy() string
HealthThresholdUnhealthy The number of consecutive failed health checks that must occur before declaring an EC2 instance unhealthy
func (ManifestBalancer) HealthTimeout ¶
func (mb ManifestBalancer) HealthTimeout() string
HealthTimeout The default health timeout when one is not specified
func (ManifestBalancer) IdleTimeout ¶
func (mb ManifestBalancer) IdleTimeout() (string, error)
IdleTimeout The amount of time to allow the balancer to keep idle connections open. This should be greater than the keep-alive timeout on your back-end, so that the balancer is responsible for closing connections
func (ManifestBalancer) InstanceProtocol ¶
func (mb ManifestBalancer) InstanceProtocol(p Port) string
InstanceProtocol returns protocol the container is listening with
func (ManifestBalancer) InternalPorts ¶
func (mb ManifestBalancer) InternalPorts() []Port
InternalPorts returns a collection of Port structs of the Manifest's internal ports
func (ManifestBalancer) ListenerProtocol ¶
func (mb ManifestBalancer) ListenerProtocol(p Port) string
ListenerProtocol returns the protocol the balancer should use to listen
func (ManifestBalancer) LoadBalancerName ¶
func (mb ManifestBalancer) LoadBalancerName(app string) string
func (ManifestBalancer) PortMappings ¶
func (mb ManifestBalancer) PortMappings() []Port
func (ManifestBalancer) Ports ¶
func (mb ManifestBalancer) Ports() []string
func (ManifestBalancer) ProcessName ¶
func (mb ManifestBalancer) ProcessName() string
func (ManifestBalancer) Protocol ¶
func (mb ManifestBalancer) Protocol(p Port) string
Protocol returns the desired listener protocol of the balancer
func (ManifestBalancer) ProxyProtocol ¶
func (mb ManifestBalancer) ProxyProtocol(p Port) bool
ProxyProtocol returns true if the container is listening for PROXY protocol
func (ManifestBalancer) Randoms ¶
func (mb ManifestBalancer) Randoms() map[string]int
func (ManifestBalancer) ResourceName ¶
func (mb ManifestBalancer) ResourceName() string
func (ManifestBalancer) Scheme ¶
func (mb ManifestBalancer) Scheme() string
type MountableVolume ¶
MountableVolume describes a mountable volume
func (MountableVolume) IsSystem ¶
func (v MountableVolume) IsSystem() bool
IsSystem white lists special host volumes to pass through to the container instead of turning them into an application EFS mount
type Networks ¶
type Networks map[string]InternalNetwork
type Port ¶
type Port struct { Name string Balancer int // the port exposed by the load balancer for TCP, or by the host for UDP Container int // the port used in the container and exposed by the Dockerfile Protocol Protocol // the network protocol used (ie, TCP or UDP) Public bool // whether the port is internet-facing or internal-only on the load balancer (TCP only) }
A Port represents a port as defined in docker-compose.yml Currently, UDP ports cannot be Public, as AWS ELBs only support TCP
func (Port) MarshalYAML ¶
MarshalYAML implements the Marshaller interface for the Port type
type Ports ¶
type Ports []Port
Ports is a collection of Port structs
func (Ports) Shift ¶
Shift all external ports by the given amount
If it's an internal-only port then make it external before incrementing
func (*Ports) UnmarshalYAML ¶
type Process ¶
func (*Process) GenerateArgs ¶
func (p *Process) GenerateArgs(opts *ArgOptions) ([]string, error)
GenerateArgs generates the argument list based on a process property Possible to optionally override certain fields via opts
type Proxy ¶
type Run ¶
type Run struct { App string Dir string Opts RunOptions Output Output Processes map[string]Process // contains filtered or unexported fields }
type RunOptions ¶
type Runner ¶
type Runner interface { CombinedOutput(cmd *exec.Cmd) ([]byte, error) Run(s Stream, cmd *exec.Cmd, opts RunnerOptions) error RunAsync(s Stream, cmd *exec.Cmd, dobe chan error, opts RunnerOptions) }
Runner is the interface to run commands
type RunnerOptions ¶
type RunnerOptions struct {
Verbose bool
}
RunnerOptions are optional settings for a Runner
type Service ¶
type Service struct { Name string `yaml:"-"` Build Build `yaml:"build,omitempty"` Command Command `yaml:"command,omitempty"` Dockerfile string `yaml:"dockerfile,omitempty"` Entrypoint string `yaml:"entrypoint,omitempty"` Environment Environment `yaml:"environment,omitempty"` ExtraHosts []string `yaml:"extra_hosts,omitempty"` Image string `yaml:"image,omitempty"` Labels Labels `yaml:"labels,omitempty"` Links []string `yaml:"links,omitempty"` Networks Networks `yaml:"-"` Ports Ports `yaml:"ports,omitempty"` Privileged bool `yaml:"privileged,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Cpu int64 `yaml:"cpu_shares,omitempty"` Memory Memory `yaml:"mem_limit,omitempty"` //TODO from models manifest, not passive and used at runtime Exports map[string]string `yaml:"-"` LinkVars map[string]template.HTML `yaml:"-"` Primary bool `yaml:"-"` // contains filtered or unexported fields }
func (Service) ContainerPorts ¶
func (Service) DefaultParams ¶
DefaultParams returns a string of comma-delimited Count, CPU, and Memory params
func (Service) DeploymentMaximum ¶
DeploymentMaximum returns the max percent of containers that are allowed during deployment This will be most likely be overridden and set to 100 for singleton processes like schedulers that cannot have 2 running at once
func (Service) DeploymentMinimum ¶
DeploymentMinimum returns the min percent of containers that are allowed during deployment
func (Service) ExternalPorts ¶
ExternalPorts returns a collection of Port structs from the Service which are TCP and Public
func (Service) ExtraHostsMap ¶
ExtraHostsMap is a convenience method to allow for easier use of the hosts in AWS templates
func (Service) HasBalancer ¶
HasBalancer returns false if the Service contains no public ports, or if the `convox.balancer` label is set to false
func (Service) InternalPorts ¶
InternalPorts returns a collection of Port structs from the Service which are TCP and not Public
func (Service) IsAgent ¶
IsAgent returns true if Service is a per-host agent, otherwise it returns false
func (Service) LabelDefault ¶
LabelDefault returns the value of a given label if it exists, otherwise the specified default
func (Service) LabelsByPrefix ¶
LabelsByPrefix retuns a map of string values with the labels filtered by prefix
func (Service) MountableVolumes ¶
func (s Service) MountableVolumes() []MountableVolume
MountableVolumes return the mountable volumes for a service
func (*Service) NetworkName ¶
NetworkName returns custom network name from the networks, defined in compose file. REturns empty string, if no custom network is defined. We pick the last one, as we currently support only single one.
func (Service) RegistryImage ¶
func (Service) TCPPorts ¶
TCPPorts returns a collection of Port structs from the Service which are TCP
func (Service) UDPPorts ¶
UDPPorts returns a collection of Port structs from the Service which are UDP
func (Service) UseSecureEnvironment ¶
UseSecureEnvironment - Determines if the service intends to use a secure environment