learner

package
v0.1.1-rc Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: Apache-2.0, CC-BY-4.0, MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DataStoreTypeS3 is the type string for the S3-based object store.
	DataStoreTypeMountVolume = "mount_volume"

	// This at the level of the data or result volume
	DataStoreHostMountVolume = "host_mount"

	DataStoreTypeMountCOSS3 = "mount_cos"
	DataStoreTypeS3         = "s3_datastore"
)

TODO: Fix copy-paste from trainer/storage/s3_object_store.go, to avoid circular ref

Variables

This section is empty.

Functions

func CreateContainerSpec

func CreateContainerSpec(container Container) v1core.Container

CreateContainerSpec ...

func CreatePodSpec

func CreatePodSpec(containers []v1core.Container, volumes []v1core.Volume, labels map[string]string, nodeSelector map[string]string, imagePullSecret string) 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) (string, 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 {
	VolumeType, ID, Region, Bucket, Endpoint, SecretRef, CacheSize, DiskFree, HostPath 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 SSHVolumeSecret

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

SSHVolumeSecret ...

type Secrets

type Secrets struct {
	TrainingDataSecret *COSVolumeSecret
	ResultsDirSecret   *COSVolumeSecret
}

Secrets ...

type VolumeMountSpec

type VolumeMountSpec struct {
	MountPath, SubPath, Name string
}

VolumeMountSpec ...

type Volumes

type Volumes struct {
	TrainingData *COSVolume
	ResultsDir   *COSVolume
}

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