learner

package
v0.0.0-...-8225f2e Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContainerSpec

func CreateContainerSpec(container Container, major string, minor string) v1core.Container

CreateContainerSpec ...

func CreatePodSpec

func CreatePodSpec(containers []v1core.Container, volumes []v1core.Volume, labels map[string]string, nodeSelector map[string]string, imagePullSecret []v1core.LocalObjectReference, nodeAffinity *v1core.NodeAffinity, gpuToleration []v1core.Toleration, termGracePeriodSecs int64) v1core.PodTemplateSpec

CreatePodSpec ...

func CreateServiceSpec

func CreateServiceSpec(name string, trainingID string) *v1core.Service

CreateServiceSpec ... this service will govern the statefulset

func CreateStatefulSetSpecForLearner

func CreateStatefulSetSpecForLearner(name, servicename string, replicas int, podTemplateSpec v1core.PodTemplateSpec) *v1beta1.StatefulSet

CreateStatefulSetSpecForLearner ...

func CreateVolumeSecretsSpec

func CreateVolumeSecretsSpec(secrets Secrets) []*v1core.Secret

CreateVolumeSecretsSpec ...

func GenerateImagePullSecret

func GenerateImagePullSecret(k8sClient kubernetes.Interface, req *service.JobDeploymentRequest) ([]v1core.LocalObjectReference, error)

GenerateImagePullSecret ... creates secret only for custom images; otherwise returns default secret name

func GetLearnerImageForFramework

func GetLearnerImageForFramework(image Image) string

GetLearnerImageForFramework returns the full route for the learner image

func PopulateLearnerEnvVariablesAndLabels

func PopulateLearnerEnvVariablesAndLabels(existingEnvVars []v1core.EnvVar, trainingID string, numLearners int, statefulsetName string, mountTrainingDataStoreInLearner, mountResultsStoreInLearner bool) []v1core.EnvVar

PopulateLearnerEnvVariablesAndLabels ... create envvars for learner from shared env vars. add learner specific envs vars + filter out what is not required

Types

type COSVolume

type COSVolume struct {
	ID, Region, Bucket, Endpoint, SecretRef, CacheSize, DiskFree string
	MountSpec                                                    VolumeMountSpec
}

COSVolume ...

type COSVolumeSecret

type COSVolumeSecret struct {
	ID, TrainingID, Username, APIKey string
}

COSVolumeSecret ...

type Container

type Container struct {
	Image
	Resources
	VolumeMounts  []v1core.VolumeMount
	Name, Command string //FIXME eventually get rid of command as well
	EnvVars       []v1core.EnvVar
}

Container ...

type Image

type Image struct {
	Framework, Version, Tag, Registry, Namespace string
}

Image ...

type Resources

type Resources struct {
	CPUs, Memory, GPUs v1resource.Quantity
}

Resources ...

type SHMVolume

type SHMVolume struct {
	ID        string
	Size      int64
	MountSpec VolumeMountSpec
}

SHMVolume ...

type SSHVolume

type SSHVolume struct {
	ID, SecretName string
	MountSpec      VolumeMountSpec
}

SSHVolume ...

type SSHVolumeSecret

type SSHVolumeSecret struct {
	ID, TrainingID, Framework, Version string
}

SSHVolumeSecret ...

type Secrets

type Secrets struct {
	TrainingDataSecret *COSVolumeSecret
	SSHVolumeSecret    *SSHVolumeSecret
	ResultsDirSecret   *COSVolumeSecret
}

Secrets ...

type VolumeMountSpec

type VolumeMountSpec struct {
	MountPath, SubPath string
}

VolumeMountSpec ...

type Volumes

type Volumes struct {
	TrainingDataVolumes []*COSVolume
	ResultsDir          *COSVolume
	SSHVolume           *SSHVolume
	SHMVolume           *SHMVolume
}

Volumes ...

func (Volumes) CreateVolumeForLearner

func (volumes Volumes) CreateVolumeForLearner() []v1core.Volume

CreateVolumeForLearner ...

func (Volumes) CreateVolumeMountsForLearner

func (volumes Volumes) CreateVolumeMountsForLearner() []v1core.VolumeMount

CreateVolumeMountsForLearner ...

Jump to

Keyboard shortcuts

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