localcluster

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package localcluster implements a runner.Cluster using the local machine's docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// Pool is the local pool
	pool.Pool
	// Log is the logger to write logs out to.
	Log *log.Logger
	// Client is the local docker client.
	Client *docker.Client
	// Session is the aws session.
	Session *session.Session
	// contains filtered or unexported fields
}

Cluster implements a cluster abstraction using the local machine.

func (*Cluster) Allocate

func (c *Cluster) Allocate(ctx context.Context, req reflow.Requirements, labels pool.Labels) (alloc pool.Alloc, err error)

Allocate allocates an alloc on the local machine with the specified requirements.

func (*Cluster) CanAllocate

func (c *Cluster) CanAllocate(r reflow.Resources) (bool, error)

CanAllocate returns whether this cluster can allocate the given amount of resources.

func (*Cluster) Flags

func (c *Cluster) Flags(flags *flag.FlagSet)

Flags implements infra.Provider

func (*Cluster) GetName

func (c *Cluster) GetName() string

GetName implements runner.Cluster

func (*Cluster) Help

func (*Cluster) Help() string

Help implements infra.Provider

func (*Cluster) Init

func (c *Cluster) Init(tls tls.Certs, session *session.Session, logger *log.Logger, creds *credentials.Credentials, tdb taskdb.TaskDB) error

Init implements infra.Provider

func (*Cluster) MaxAlloc

func (c *Cluster) MaxAlloc() reflow.Resources

MaxAlloc returns the max resources which can be obtained in a single alloc from this cluster.

Jump to

Keyboard shortcuts

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