globalmanager

package
v0.0.0-...-6005cdf Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBackOff is the default backoff period
	DefaultBackOff = 10 * time.Second
	// MaxBackOff is the max backoff period
	MaxBackOff = 360 * time.Second
)

Variables

This section is empty.

Functions

func CreateEnvVars

func CreateEnvVars(envMap map[string]string) []v1.EnvVar

CreateEnvVars creates EnvMap for container include EnvName and EnvValue map for stage of creating a pod

func CreateKubernetesService

func CreateKubernetesService(kubeClient kubernetes.Interface, object CommonInterface, inputPort int32, inputIP string) (int32, error)

CreateKubernetesService creates a k8s service for an object given ip and port

func CreateVolumeMap

func CreateVolumeMap(containerPara *ContainerPara) ([]v1.VolumeMount, []v1.Volume)

CreateVolumeMap creates volumeMap for container and returns volumeMounts and volumes for stage of creating pod

func GenerateLabels

func GenerateLabels(object CommonInterface) map[string]string

GenerateLabels generates labels for an object

func GenerateSelector

func GenerateSelector(object CommonInterface) (labels.Selector, error)

GenerateSelector generates selector for an object

func GetNodeIPByName

func GetNodeIPByName(kubeClient kubernetes.Interface, name string) (string, error)

GetNodeIPByName get node ip by node name

func IsFLJobFinished

func IsFLJobFinished(j *neptunev1.FederatedLearningJob) bool

func IsIncrementalJobFinished

func IsIncrementalJobFinished(j *neptunev1.IncrementalLearningJob) bool

func MatchContainerBaseImage

func MatchContainerBaseImage(imageHub map[string]string, frameName string, frameVersion string) (string, error)

MatchContainerBaseImage searches the base image

func NewFLJobCondition

func NewFLJobCondition(conditionType neptunev1.FLJobConditionType, reason, message string) neptunev1.FLJobCondition

func NewIncrementalJobCondition

func NewIncrementalJobCondition(conditionType neptunev1.ILJobStageConditionType, jobStage neptunev1.ILJobStage) neptunev1.ILJobCondition

func NewJointInferenceServiceCondition

func NewJointInferenceServiceCondition(conditionType neptunev1.JointInferenceServiceConditionType, reason, message string) neptunev1.JointInferenceServiceCondition

NewJointInferenceServiceCondition creates a new joint condition

Types

type CommonInterface

type CommonInterface interface {
	metav1.Object
	schema.ObjectKind
}

CommonInterface describes the commom interface of CRs

type ContainerPara

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

ContainerPara describes initial values need by creating a pod

type DownstreamController

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

DownstreamController watch kubernetes api server and send the controller resource change to edge

func (*DownstreamController) GetName

func (dc *DownstreamController) GetName() string

GetName returns the name of the downstream controller

func (*DownstreamController) Start

func (dc *DownstreamController) Start() error

Start starts the controller

type FLJobStage

type FLJobStage string
const (
	FLJobStageAgg   FLJobStage = "Aggregation"
	FLJobStageTrain FLJobStage = "Training"
)

type FeatureControllerI

type FeatureControllerI interface {
	Start() error
	GetName() string
}

FeatureControllerI defines the interface of an AI Feature controller

func NewDownstreamController

func NewDownstreamController(cfg *config.ControllerConfig) (FeatureControllerI, error)

NewDownstreamController creates a controller DownstreamController from config

func NewFederatedController

func NewFederatedController(cfg *config.ControllerConfig) (FeatureControllerI, error)

NewFederatedController creates a new FederatedLearningJob controller that keeps the relevant pods in sync with their corresponding FFederatedLearningJob objects.

func NewIncrementalJobController

func NewIncrementalJobController(cfg *config.ControllerConfig) (FeatureControllerI, error)

NewIncrementalJobController creates a new IncrementalJob controller that keeps the relevant pods in sync with their corresponding IncrementalJob objects.

func NewJointController

func NewJointController(cfg *config.ControllerConfig) (FeatureControllerI, error)

NewJointController creates a new JointInferenceService controller that keeps the relevant pods in sync with their corresponding JointInferenceService objects.

func NewUpstreamController

func NewUpstreamController(cfg *config.ControllerConfig) (FeatureControllerI, error)

NewUpstreamController creates a new Upstream controller from config

type FederatedController

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

FederatedController ensures that all FLJob objects have corresponding pods to run their configured workload.

func (*FederatedController) GetName

func (fc *FederatedController) GetName() string

func (*FederatedController) Start

func (fc *FederatedController) Start() error

Run the main goroutine responsible for watching and syncing jobs.

type IncrementalCondData

type IncrementalCondData struct {
	Input *struct {
		// Only one model cases
		Model  *Model  `json:"model,omitempty"`
		Models []Model `json:"models,omitempty"`

		DataURL   string `json:"dataURL,omitempty"`
		OutputDir string `json:"outputDir,omitempty"`
	} `json:"input,omitempty"`

	Output *struct {
		Model  *Model  `json:"model,omitempty"`
		Models []Model `json:"models,omitempty"`
	} `json:"output,omitempty"`
}

the data of this condition including the input/output to do the next step

func (*IncrementalCondData) GetInputModelURLs

func (cd *IncrementalCondData) GetInputModelURLs() []string

func (*IncrementalCondData) GetOutputModelURLs

func (cd *IncrementalCondData) GetOutputModelURLs() []string

func (IncrementalCondData) Marshal

func (cd IncrementalCondData) Marshal() ([]byte, error)

func (*IncrementalCondData) Unmarshal

func (cd *IncrementalCondData) Unmarshal(data []byte) error

type IncrementalJobController

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

IncrementalJobController ensures that all IncrementalLearningJob objects have corresponding pods to run their configured workload.

func (*IncrementalJobController) GetName

func (jc *IncrementalJobController) GetName() string

GetName returns the name of the incrementallearning job controller

func (*IncrementalJobController) Start

func (jc *IncrementalJobController) Start() error

Run the main goroutine responsible for watching and syncing jobs.

type JointInferenceServiceController

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

JointInferenceServiceController ensures that all JointInferenceService objects have corresponding pods to run their configured workload.

func (*JointInferenceServiceController) GetName

GetName returns the name of the joint inference controller

func (*JointInferenceServiceController) Start

Start starts the main goroutine responsible for watching and syncing services.

type MainController

type MainController struct {
	Config *config.ControllerConfig
}

MainController defines the main controller

func NewController

func NewController(cc *config.ControllerConfig) *MainController

NewController creates a new main controller

func (*MainController) Start

func (c *MainController) Start()

Start starts the main controller

type Model

type Model struct {
	Format  string                 `json:"format,omitempty"`
	URL     string                 `json:"url,omitempty"`
	Metrics map[string]interface{} `json:"metrics,omitempty"`
}

func (*Model) GetURL

func (m *Model) GetURL() string

type UpstreamController

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

UpstreamController subscribes the updates from edge and syncs to k8s api server

func (*UpstreamController) GetName

func (uc *UpstreamController) GetName() string

GetName returns the name of the upstream controller

func (*UpstreamController) Start

func (uc *UpstreamController) Start() error

Start the upstream controller

Directories

Path Synopsis
ws

Jump to

Keyboard shortcuts

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