Documentation ¶
Index ¶
- Constants
- func IsValidResourceProfile(p *ResourceProfile) bool
- func PodPhaseDesc(code PodPhase) string
- func PodStatusDesc(code PodStatus) string
- type ContainerImage
- type ContainerImages
- type EnvVar
- type POD
- type PODConfig
- type PODParams
- type PersistentDisk
- type PodPhase
- type PodRequestMode
- type PodStatus
- type PythonLib
- type PythonLibs
- type ResourceGroup
- type ResourceProfile
- type ResourceProfiles
- type Session
- type SessionAttrs
- type SessionStatus
- type User
- type UserAttrs
- type UserPOD
- type UserPersistentDisk
- type UserStatus
- type UserType
Constants ¶
const ( // IfNotPresent : Constant string IfNotPresent = "IfNotPresent" // Always : Constant Always = "Always" // OnFailure : Constant OnFailure = "OnFailure" // Notebook : PodType Notebook Notebook = "Notebook" // Lab : PodType LAB Lab = "Lab" // JobTypeNotebook : Job type of Notebook JobTypeNotebook = "Notebook" // JobTypeLab : Job type of LAB JobTypeLab = "Lab" // JobTypeSchedNotebook : Job type of scheduled notebook JobTypeSchedNotebook = "Scheduled Notebook" // JobTypeDefault : Default Job type if not Notebook or Lab JobTypeDefault = "Default" // PodReqModeSch : Pod Request Mode PodReqModeSch PodRequestMode = 1 // PodReqModeImd : Pod Request Mode PodReqModeImd PodRequestMode = 2 // PodReqModeBck : Pod Request Mode Background PodReqModeBck PodRequestMode = 3 // DefaultExternalPort : DefaultExternalPort = 80 // DefaultAppPort : DefaultAppPort = 8888 // PodStatusUnknown : POD in Unknown Status PodStatusUnknown PodStatus = 0 // PodReqScheduled : PodReqScheduled PodStatus = 10 // PodRequested : PodRequested PodStatus = 100 // PodReqInvalid : PodReqInvalid PodStatus = 200 // PodReqInitiating : PodReqInitiating PodStatus = 300 // PodReqInitiated : PodReqInitiated PodStatus = 400 // PodReqInitiatedDeploy : PodReqInitiatedDeploy PodStatus = 410 // PodReqServiceInitiated : PodReqServiceInitiated PodStatus = 420 // PodReqIngressInitiated : PodReqIngressInitiated PodStatus = 430 // PodReqCancelled : PodReqCancelled PodStatus = 500 // PodInitiating : PodInitiating PodStatus = 600 // PodRestarting : PodRestarting PodStatus = 700 // PodRunning : PodRunning PodStatus = 1000 // PodInit : PodInit PodStatus = 1100 //PodDestroy : PodDestroy PodStatus = 1200 // PodFailing : PodFailing PodStatus = 2000 // PodCompleted : PodCompleted PodStatus = 2100 // PodShuttingDown : PodShuttingDown PodStatus = 2200 // PodTerminated : PodTerminated PodStatus = 2300 // PodReqFailed : PodReqFailed PodStatus = 3000 // PodInitFailed : PodInitFailed PodStatus = 3100 // PodDestroyFailed : PodDestroyFailed PodStatus = 3200 // PodRuntimeFailure : PodRuntimeFailure PodStatus = 3300 // PodApplicationError : PodApplicationError PodStatus = 3400 // PhaseScheduled : PhaseScheduled = 5 // PhasePending : PhasePending = 10 // PhaseRunning : PhaseRunning = 20 // PhaseShutdown : PhaseShutdown = 40 // PhaseFailed : PhaseFailed = 50 // PhaseUnknown : PhaseUnknown = 0 )
const ( // SessionValid : SessionValid = "Valid" // SessionInvalid : SessionInvalid = "Invalid" // SessionStale : SessionStale = "Stale" )
const GuestUserName = "admin"
GuestUserName : Guest user name used in server auth is disabled
const (
// OutPathPostfix : Output path post fix for notebook jobs
OutPathPostfix = "_out"
)
Variables ¶
This section is empty.
Functions ¶
func IsValidResourceProfile ¶
func IsValidResourceProfile(p *ResourceProfile) bool
IsValidResourceProfile : Is valid resource profile?
func PodPhaseDesc ¶
PodPhaseDesc : Returns meaning for a phase code
func PodStatusDesc ¶
PodStatusDesc : Returns meaning for a phase code
Types ¶
type ContainerImage ¶
type ContainerImage struct { ID uint64 Name string Disabled bool RegistryURL string DescText string DescHTML string }
ContainerImage : Container images
type ContainerImages ¶
type ContainerImages []ContainerImage
ContainerImages : List of container images
type POD ¶
type POD struct { ID uint64 Name string PodType string // NB for notebook, LAB for jupyter lab RequestMode PodRequestMode CreatedBy *User AuthToken string // User Key is reference used for identifying the pod by user UserKey string ServiceName string ServicePort int32 Config *PODConfig Phase PodPhase Status PodStatus Started time.Time Ended time.Time Created time.Time Updated time.Time Failed time.Time Cancelled time.Time FailureReason string Endpoint string Result string }
POD :
func NewPOD ¶
func NewPOD(user *User, jobType string, requestMode PodRequestMode, c *PODConfig) *POD
NewPOD :
func (*POD) SetRequestMode ¶
func (p *POD) SetRequestMode(m PodRequestMode)
SetRequestMode : Sets POD request Mode
type PODConfig ¶
type PODConfig struct { *PODParams Resources *ResourceProfile Image *ContainerImage ImagePullPolicy string Command string AppPort uint16 ExternalPort uint16 EnvVars []*EnvVar PythonLibs []*PythonLib Disk *PersistentDisk RestartPolicy string }
PODConfig : represents a compute pod launched for notebooks
func NewPODConfig ¶
func NewPODConfig(rp *ResourceProfile, ci *ContainerImage, cmd string, dsk *PersistentDisk, params *PODParams) (*PODConfig, error)
NewPODConfig : New POD Config
type PODParams ¶
type PODParams struct { // Input Notebook for scheduled / background notebooks InputPath string // Workspace Path (mostly s3 prefixed) to fetch s3 contents in the POD WorkspacePath string // Local Path where workspace contents need to be mounted MountPath string // Notebook output. Usually a notebook too OutputPath string // Persistent Disk host path in case volume persistence is enabled PersDiskHostPath string // Access / Secret key for saving or retrieving notebooks from s3 // TODO: store in vault AwsAccessKey string AwsSecretKey string }
PODParams : Additional Parameters for running job pods
func NewPodParams ¶
NewPodParams : Returns a new PodParams struct
type PersistentDisk ¶
PersistentDisk : Represents Persistent Disks / Volumes
type PodRequestMode ¶
type PodRequestMode int
PodRequestMode : Pod Request Mode; can be Immediate or Scheduled
type ResourceGroup ¶
type ResourceGroup struct { ID uint64 Name string ResourceProfiles []*ResourceProfile }
ResourceGroup : Resource Profile group
type ResourceProfile ¶
type ResourceProfile struct { ID uint64 Name string Disabled bool Subtitle string ShortDesc string LongDesc string CPU string GPU string GPURam string RAM string Disk string }
ResourceProfile : Resource Plans
type ResourceProfiles ¶
type ResourceProfiles []ResourceProfile
ResourceProfiles : List of resource plans
type SessionAttrs ¶
type SessionAttrs struct { ID uint64 Session *Session Created time.Time LastConnect time.Time Destroyed time.Time Status SessionStatus }
SessionAttrs : not used yet
type UserAttrs ¶
type UserAttrs struct { *User Email string PasswordHash string Status UserStatus Type UserType APIKey string }
UserAttrs : User attrbutes table
type UserPersistentDisk ¶
type UserPersistentDisk struct { User *User Disk *PersistentDisk }
UserPersistentDisk : User specific disk / pv details