group

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRunnerGroupSpecFromURI

func NewRunnerGroupSpecFromURI(clientset kubernetes.Interface, specURI string) (*types.RunnerGroupSpec, error)

NewRunnerGroupSpecFromURI builds RunnerGroupSpec via URI. Current supported schemes are:

  • file - The spec is stored in filesystem.

  • configmap - The spec is stored in kubernetes as configmap.

For configmap, current supported query parameters:

  • namespace: The namespace scope for the configmap. Using `default` if not set or empty.

  • specName: The name of data which stores RunnerGroupSpec. Using `spec` if not set or empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is to run a set of runners with same load profile.

func NewHandler

func NewHandler(
	clientset kubernetes.Interface,
	namespace, name string,
	spec *types.RunnerGroupSpec,
	imageRef string,
) (*Handler, error)

NewHandler returns new instance of Handler.

func (*Handler) Deploy

func (h *Handler) Deploy(ctx context.Context, uploadURL string) error

Deploy deploys a group of runners.

func (*Handler) Info

func (h *Handler) Info(ctx context.Context) *types.RunnerGroup

Info returns RunnerGroup information with status.

func (*Handler) IsControlled

func (h *Handler) IsControlled(ctx context.Context, podName string) (bool, error)

IsControlled returns true if the pod is controlled by the group.

func (*Handler) Name

func (h *Handler) Name() string

Name returns RunnerGroup's name

func (*Handler) Pods

func (h *Handler) Pods(ctx context.Context) ([]*corev1.Pod, error)

Pods returns all the pods controlled by the job.

func (*Handler) Wait

func (h *Handler) Wait(ctx context.Context) error

Wait waits runners until they finish.

type SpecURIType

type SpecURIType string

SpecURIType is the scheme of RunnerGroupSpec's URI.

const (
	// SpecURITypeFile is file scheme.
	SpecURITypeFile SpecURIType = "file"

	// SpecURITypeConfigMap is configmap scheme.
	SpecURITypeConfigMap SpecURIType = "configmap"
)

Jump to

Keyboard shortcuts

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