Documentation
¶
Index ¶
- Variables
- func ConfigCleanup() error
- func GetFlyteSandboxConfig() error
- func GetSandbox(ctx context.Context, cli Docker) *types.Container
- func GetSandboxPorts() (map[nat.Port]struct{}, map[nat.Port][]nat.PortBinding, error)
- func PullDockerImage(ctx context.Context, cli Docker, image string) error
- func ReadLogs(ctx context.Context, cli Docker, id string) (*bufio.Scanner, error)
- func RemoveSandbox(ctx context.Context, cli Docker, reader io.Reader) error
- func SetupFlyteDir() error
- func StartContainer(ctx context.Context, cli Docker, volumes []mount.Mount, ...) (string, error)
- func WaitForSandbox(reader *bufio.Scanner, message string) bool
- func WatchError(ctx context.Context, cli Docker, id string) (<-chan container.ContainerWaitOKBody, <-chan error)
- type Docker
- type FlyteDocker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Kubeconfig = f.FilePathJoin(f.UserHomeDir(), ".flyte", "k3s", "k3s.yaml") FlytectlConfig = f.FilePathJoin(f.UserHomeDir(), ".flyte", "config-sandbox.yaml") SuccessMessage = "Flyte is ready! Flyte UI is available at http://localhost:30081/console" ImageName = "cr.flyte.org/flyteorg/flyte-sandbox:dind" FlyteSandboxClusterName = "flyte-sandbox" Environment = []string{"SANDBOX=1", "KUBERNETES_API_PORT=30086", "FLYTE_HOST=localhost:30081", "FLYTE_AWS_ENDPOINT=http://localhost:30084"} FlyteSnackDir = "/usr/src" K3sDir = "/etc/rancher/" Client Docker Volumes = []mount.Mount{ { Type: mount.TypeBind, Source: f.FilePathJoin(f.UserHomeDir(), ".flyte"), Target: K3sDir, }, } )
Functions ¶
func ConfigCleanup ¶
func ConfigCleanup() error
ConfigCleanup will remove the sandbox config from flyte dir
func GetFlyteSandboxConfig ¶
func GetFlyteSandboxConfig() error
GetFlyteSandboxConfig download the flyte sandbox config
func GetSandbox ¶
GetSandbox will return sandbox container if it exist
func GetSandboxPorts ¶
GetSandboxPorts will return sandbox ports
func PullDockerImage ¶
PullDockerImage will Pull docker image
func RemoveSandbox ¶
RemoveSandbox will remove sandbox container if exist
func StartContainer ¶
func StartContainer(ctx context.Context, cli Docker, volumes []mount.Mount, exposedPorts map[nat.Port]struct{}, portBindings map[nat.Port][]nat.PortBinding, name, image string) (string, error)
StartContainer will create and start docker container
func WaitForSandbox ¶
WaitForSandbox will wait until it doesn't get success message
func WatchError ¶
func WatchError(ctx context.Context, cli Docker, id string) (<-chan container.ContainerWaitOKBody, <-chan error)
WatchError will return channel for watching errors of a container
Types ¶
type Docker ¶
type Docker interface { ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) }
func GetDockerClient ¶
GetDockerClient will returns the docker client
type FlyteDocker ¶
Click to show internal directories.
Click to hide internal directories.