Documentation
¶
Index ¶
- Constants
- func AnnotationsWithWorkload(base map[string]string, workloadName, apiVersion, resourceKind string) map[string]string
- func ComparePodPriority(a, b kube.PodSummary) bool
- func DiscoveryLabelSelector(labels map[string]string) string
- func LabelsWithWorkload(base map[string]string, workloadName, resourceKind string) map[string]string
- func ResolveManifestPath(configPath, manifestPath string) string
- type ApplyClient
- type ControllerWorkload
- type DeleteClient
- type GenericRuntime
- func (r *GenericRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
- func (r *GenericRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
- func (r *GenericRuntime) Kind() string
- func (r *GenericRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
- func (r *GenericRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, ...) error
- func (r *GenericRuntime) WorkloadName() string
- func (r *GenericRuntime) WorkloadRef() (string, string, string, error)
- type PodRuntime
- func (r *PodRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
- func (r *PodRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
- func (r *PodRuntime) Kind() string
- func (r *PodRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
- func (r *PodRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, ...) error
- func (r *PodRuntime) WorkloadName() string
- func (r *PodRuntime) WorkloadRef() (string, string, string, error)
- type RefProvider
- type Runtime
- type TargetClient
- type TargetRef
- type WaitClient
- type WorkloadManifestTemplateVars
Constants ¶
const ( TypePod = "pod" TypeJob = "job" TypePyTorchJob = "pytorchjob" TypeGeneric = "generic" AnnotationLastAppliedSpec = "okdev.io/last-applied-spec" AnnotationLastAppliedHash = "okdev.io/last-applied-spec-sha256" )
const DefaultTargetContainer = "dev"
Variables ¶
This section is empty.
Functions ¶
func AnnotationsWithWorkload ¶
func ComparePodPriority ¶
func ComparePodPriority(a, b kube.PodSummary) bool
ComparePodPriority is the canonical pod scoring function used by both runtime target selection and session view display. Pods are scored by: +8 for having a last-attach annotation, +4 for Running phase, +2 for Ready status. Ties broken by creation time (newest first), then name.
func DiscoveryLabelSelector ¶
DiscoveryLabelSelector returns a label selector using only the session-identifying labels needed for pod discovery. This avoids passing workload-specific labels that controllers might not propagate to child pods.
func LabelsWithWorkload ¶
func ResolveManifestPath ¶
Types ¶
type ApplyClient ¶
type ControllerWorkload ¶ added in v0.7.3
ControllerWorkload describes a supported controller-backed workload kind whose pods are created indirectly and may not exist immediately after apply. Callers use this list to discover sessions that have been reconciled but are still waiting for pods to be scheduled.
func ControllerWorkloads ¶ added in v0.7.3
func ControllerWorkloads() []ControllerWorkload
ControllerWorkloads returns the set of controller-backed workload kinds that okdev manages. Adding a new controller runtime should extend this list so discovery paths (status/list/session resolution) pick it up automatically.
type DeleteClient ¶
type GenericRuntime ¶
type GenericRuntime struct {
SessionName string
WorkloadNameOverride string
WorkloadKind string
ManifestPath string
WorkspaceMountPath string
SidecarImage string
SidecarResources corev1.ResourceRequirements
Tmux bool
PreStop string
TargetContainer string
Volumes []corev1.Volume
Labels map[string]string
Annotations map[string]string
Inject []config.WorkloadInjectSpec
LastAppliedSpecJSON string
LastAppliedSpecHash string
// contains filtered or unexported fields
}
func (*GenericRuntime) Apply ¶
func (r *GenericRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
func (*GenericRuntime) Delete ¶
func (r *GenericRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
func (*GenericRuntime) Kind ¶
func (r *GenericRuntime) Kind() string
func (*GenericRuntime) SelectTarget ¶
func (r *GenericRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
func (*GenericRuntime) WaitReady ¶
func (r *GenericRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
func (*GenericRuntime) WorkloadName ¶
func (r *GenericRuntime) WorkloadName() string
func (*GenericRuntime) WorkloadRef ¶
func (r *GenericRuntime) WorkloadRef() (string, string, string, error)
type PodRuntime ¶
type PodRuntime struct {
SessionName string
WorkloadNameOverride string
Labels map[string]string
Annotations map[string]string
PodSpec corev1.PodSpec
Volumes []corev1.Volume
WorkspaceMountPath string
SidecarImage string
SidecarResources corev1.ResourceRequirements
Tmux bool
PreStop string
TargetContainer string
LastAppliedSpecJSON string
LastAppliedSpecHash string
}
func NewPodRuntime ¶
func (*PodRuntime) Apply ¶
func (r *PodRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
func (*PodRuntime) Delete ¶
func (r *PodRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
func (*PodRuntime) Kind ¶
func (r *PodRuntime) Kind() string
func (*PodRuntime) SelectTarget ¶
func (r *PodRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
func (*PodRuntime) WaitReady ¶
func (r *PodRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
func (*PodRuntime) WorkloadName ¶
func (r *PodRuntime) WorkloadName() string
func (*PodRuntime) WorkloadRef ¶
func (r *PodRuntime) WorkloadRef() (string, string, string, error)
type RefProvider ¶
type Runtime ¶
type Runtime interface {
Kind() string
WorkloadName() string
Apply(ctx context.Context, k ApplyClient, namespace string) error
Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
}