operation

package
v0.0.0-...-21a76b1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 19 Imported by: 0

Documentation

Overview

Package operation contains the operation logic

Package operation contains the operation logic

Package operation contains the operation logic

Package operation contains the operation logic

Index

Constants

View Source
const (
	// PodNameLabelKey is the label key for the pod name which generated the stream
	PodNameLabelKey = "k8s.v6d.io/created-podname"
	// PodNameSpaceLabelKey is the label key for the pod namespace which generated the stream
	PodNameSpaceLabelKey = "k8s.v6d.io/created-podnamespace"
	// NeedInjectedAssemblyKey represents the pod need to be injected with the assembly job
	NeedInjectedAssemblyKey = "need-injected-assembly"
	// AssemblyPrefix is the prefix of the assembly job
	AssemblyPrefix = "assemble-"
)
View Source
const (
	// RepartitionPrefix is the prefix of the assembly job
	RepartitionPrefix = "repartition-"
	// NeedInjecteRepartitionKey represents the pod need to be injected with the repartition job
	NeedInjecteRepartitionKey = "need-injected-repartition"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssemblyOperation

type AssemblyOperation struct {
	client.Client
	ClientUtils
	// contains filtered or unexported fields
}

AssemblyOperation is the operation for the assembly

func (*AssemblyOperation) CreateJob

func (ao *AssemblyOperation) CreateJob(ctx context.Context, o *v1alpha1.Operation) error

CreateJob creates the job for the operation

func (*AssemblyOperation) IsDone

func (ao *AssemblyOperation) IsDone() bool

IsDone will check if the assembly operation is done

type ClientUtils

type ClientUtils struct {
	client.Client
}

func (*ClientUtils) ResolveRequiredVineyarddSocket

func (c *ClientUtils) ResolveRequiredVineyarddSocket(
	ctx context.Context,
	name string, namespace string, objectNamespace string,
) (string, error)

func (*ClientUtils) UpdateConfigmap

func (c *ClientUtils) UpdateConfigmap(ctx context.Context, target map[string]bool,
	o *v1alpha1.Operation, prefix string, data *map[string]string,
) error

UpdateConfigmap will update the configmap when the assembly operation is done

type DaskRepartitionConfig

type DaskRepartitionConfig struct {
	Name                 string
	Namespace            string
	GlobalObjectID       string
	Replicas             string
	InstanceToWorker     string
	DaskScheduler        string
	JobName              string
	TimeoutSeconds       int64
	VineyardSockPath     string
	DaskRepartitionImage string
}

DaskRepartitionConfig is the config for the dask repartition job

var DaskRepartitionConfigTemplate DaskRepartitionConfig

DaskRepartitionConfigTemplate is the template config for the dask repartition job

func GetDaskRepartitionConfig

func GetDaskRepartitionConfig() DaskRepartitionConfig

GetDaskRepartitionConfig gets the dask repartition config

type DistributedAssemblyConfig

type DistributedAssemblyConfig struct {
	Name                     string
	Namespace                string
	StreamID                 string
	JobName                  string
	GlobalObjectID           string
	OldObjectToNewObject     string
	TimeoutSeconds           int64
	VineyardSockPath         string
	DistributedAssemblyImage string
}

DistributedAssemblyConfig is the config for the distributed assembly job

var DistributedAssemblyConfigTemplate DistributedAssemblyConfig

DistributedAssemblyConfigTemplate is the template config for the distributed assembly job

func GetDistributedAssemblyConfig

func GetDistributedAssemblyConfig() DistributedAssemblyConfig

GetDistributedAssemblyConfig gets the distributed assembly config

type LocalAssemblyConfig

type LocalAssemblyConfig struct {
	Name               string
	Namespace          string
	StreamID           string
	JobName            string
	NodeName           string
	TimeoutSeconds     int64
	VineyardSockPath   string
	LocalAssemblyImage string
}

LocalAssemblyConfig is the config for the local assembly job

var LocalAssemblyConfigTemplate LocalAssemblyConfig

LocalAssemblyConfigTemplate is the template config for the assembly job

func GetAssemblyConfig

func GetAssemblyConfig() LocalAssemblyConfig

GetAssemblyConfig gets the local assembly config

type PluggableOperation

type PluggableOperation interface {
	CreateJob(ctx context.Context, o *v1alpha1.Operation) error
	IsDone() bool
}

PluggableOperation is the interface for the operation

func NewPluggableOperation

func NewPluggableOperation(
	opName string,
	client client.Client,
	clientset *kubernetes.Clientset,
	app *swckkube.Application,
) PluggableOperation

NewPluggableOperation returns a new pluggable operation according to the operation type

type RepartitionOperation

type RepartitionOperation struct {
	client.Client
	*kubernetes.Clientset
	ClientUtils
	// contains filtered or unexported fields
}

RepartitionOperation is the operation for the repartition

func (*RepartitionOperation) CreateJob

CreateJob creates the job for the repartition

func (*RepartitionOperation) IsDone

func (ro *RepartitionOperation) IsDone() bool

IsDone checks whether the repartition operation is done

Jump to

Keyboard shortcuts

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