driver

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobStateRunning  JobState = "running"
	JobStatePending           = "pending"
	JobStateComplete          = "complete"
	JobStateFailed            = "failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

type Docker struct {
	Client DockerClient
}

func (Docker) Cleanup

func (d Docker) Cleanup(job *Job) error

func (Docker) Start

func (d Docker) Start(job *Job) (*Job, error)

func (Docker) Wait

func (d Docker) Wait(job *Job) (*Job, error)

type DockerClient added in v1.10.1

type DockerClient interface {
	ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error)
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
	ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error
	ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
	ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error)
	ContainerRemove(ctx context.Context, containerID string, options container.RemoveOptions) error
}

type Driver

type Driver interface {
	Start(job *Job) (*Job, error)
	Wait(job *Job) (*Job, error)
	Cleanup(job *Job) error
}

type Inline

type Inline struct {
	Logger  *zap.Logger
	GrpcUrl string
}

func NewInlineRunner added in v1.10.1

func NewInlineRunner(logger *zap.Logger, grpcUrl string) Inline

func (Inline) Cleanup

func (i Inline) Cleanup(job *Job) error

func (Inline) Start

func (i Inline) Start(job *Job) (*Job, error)

func (Inline) Wait

func (i Inline) Wait(job *Job) (*Job, error)

type Job

type Job struct {
	Spec   *JobSpec
	Status *JobStatus
}

func NewJob

func NewJob(spec *JobSpec) *Job

func (*Job) GetMetadata

func (job *Job) GetMetadata(key string) (string, error)

type JobSpec

type JobSpec struct {
	OrganizationId string
	Image          string
	Run            *apiv1.Run
	Workspace      *apiv1.Workspace
	Token          string
	Credentials    string
	Variables      []*apiv1.Variable
}

type JobState added in v1.10.1

type JobState string

type JobStatus

type JobStatus struct {
	Metadata map[string]string
	State    JobState
}

type Kubernetes

type Kubernetes struct {
	Client *kubernetes.Clientset
}

func (Kubernetes) Cleanup

func (k Kubernetes) Cleanup(job *Job) error

func (Kubernetes) Start

func (k Kubernetes) Start(job *Job) (*Job, error)

func (Kubernetes) Wait

func (k Kubernetes) Wait(job *Job) (*Job, error)

Jump to

Keyboard shortcuts

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