templates

package
v0.0.0-...-f4b31ea Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package templates defines the container templates

Index

Constants

View Source
const (
	// ContainerPortScheme is designed for docker bridge networks where the
	// communication within a network may use container name as the address.
	// The scheme indicates the port number used in the container (and
	// exposed and published when docker run) need to be populated into the
	// template. For example, if the service running in the container listens to
	// port 80 and the port has been exposed and published during docker run.
	// An IpEndpoint address of `ctr-container-port://container-name` indicates
	// that the address should be replaced with `container-name` and the port
	// should be replaced with actual port `80`. (Note that within a network, a
	// container can be referenced by name.)
	// To use this scheme, the port number in the input IpEndpoint must be 0.
	ContainerPortScheme = "ctr-container-port"
	// LocalhostPortScheme is designed for the docker `host` network (where
	// networking is shared with the host) for containers that have
	// go/cft-port-discovery implemented.
	// The schema indicates the host address and port number need to be populated
	// into the template. As the host address will always be `localhost`. The
	// current templated container must be in the `host` network.
	LocalhostPortScheme = "ctr-localhost-port"
)

Scheme definitions

View Source
const (
	DockerCacheServerPort    = "43150"
	DockerCacheServerLogsDir = "/tmp/cacheserver"
)
View Source
const CrosTestDirPrefix = "cros-test-"
View Source
const DockerGcsPublishLogsDir = "/tmp/gcs-publish/"
View Source
const DockerGcsPublishPort = "43147"
View Source
const DockerGcsPublishServiceAcctsCredsDir = "/tmp/gcs-publish-service-creds/"
View Source
const DockerGcsPublishTestArtifactsDir = "/tmp/gcs-publish-test-artifacts/"
View Source
const DockerPostProcessLogsDir = "/tmp/post-process/"
View Source
const DockerPostProcessLuciContextDir = "/tmp/post-process-luci-context/"
View Source
const DockerPostProcessPort = "43151"
View Source
const DockerPostProcessServiceAcctsCredsDir = "/tmp/post-process-service-creds/"
View Source
const DockerPostProcessTestResultsDir = "/tmp/test/results" // Follows how cros_testexec stores test artifacts
View Source
const DockerRdbLuciContextDir = "/tmp/rdb-luci-context/"
View Source
const DockerRdbPublishLogsDir = "/tmp/rdb-publish/"
View Source
const DockerRdbPublishLuciContextDir = "/tmp/rdb-luci-context/"
View Source
const DockerRdbPublishPort = "43149"
View Source
const DockerRdbPublishServiceAcctsCredsDir = "/tmp/rdb-publish-service-creds/"
View Source
const DockerRdbPublishTestResultsDir = "/tmp/test/results" // Follows how cros_testexec stores test artifacts
View Source
const DockerTkoPublishLogsDir = "/tmp/tko-publish/"
View Source
const DockerTkoPublishPort = "43148"
View Source
const DockerTkoPublishTestArtifactsDir = "/tmp/tko-publish-test-artifacts/"
View Source
const HostServiceAcctCredsDir = "/creds/service_accounts"

HostServiceAcctCredsDir is the path on the host where service account credentials are stored. This must be mounted into containers which are making requests to GCP.

View Source
const LuciContext = "LUCI_CONTEXT"

Variables

View Source
var TemplateUtils = templateUtils{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type ContainerLookuper

type ContainerLookuper interface {
	LookupContainerPortBindings(name string) ([]*api.Container_PortBinding, error)
}

ContainerLookuper provides interface to lookup information for a container

type RequestRouter

type RequestRouter struct{}

RequestRouter is the entry point to template processing.

func (*RequestRouter) Process

type TemplateProcessor

type TemplateProcessor interface {
	Process(*api.StartTemplatedContainerRequest) (*api.StartContainerRequest, error)
}

TemplateProcessor converts a container-specific template into a valid generic StartContainerRequest. Besides request conversions, a TemplateProcessor is also aware of a container's dependencies of other containers, whose addresses are determined at runtime. The addresses are provided as IpEndpoint placeholders in a template, and TemplateProcessor use placeholderPopulators to populate actual values.

Jump to

Keyboard shortcuts

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