addons

package
v0.1.13-1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Registry               = make(map[string]Addon)
	AddonFamilyPerformance = "performance"
	AddonFamilyVolume      = "volume"
	AddonFamilyApplication = "application"
	AddonFamilyWorkload    = "workload"
)

Functions

func Metadata

func Metadata(a Addon) string

Default metadata (in JSON) to also put at the top of addons That append to an entrypoint with their metadata

func Register

func Register(a Addon)

Register a new addon!

Types

type Addon

type Addon interface {

	// Metadata
	Name() string
	Family() string
	Description() string

	// Options and exportable attributes
	SetOptions(*api.MetricAddon, *api.MetricSet)
	Options() map[string]intstr.IntOrString
	ListOptions() map[string][]intstr.IntOrString
	MapOptions() map[string]map[string]intstr.IntOrString

	// What addons can control:
	AssembleVolumes() []specs.VolumeSpec
	AssembleContainers() []specs.ContainerSpec

	CustomizeEntrypoints([]*specs.ContainerSpec, []*jobset.ReplicatedJob)

	// Instead of exposing individual pieces (volumes, settings, etc)
	// We simply allow it to modify the job
	// Attributes for JobSet, etc.
	Validate() bool
}

A general metric is a container added to a JobSet

func GetAddon

func GetAddon(a *api.MetricAddon, set *api.MetricSet) (Addon, error)

GetAddon looks up and validates an addon

type AddonBase

type AddonBase struct {
	Identifier string
	Url        string
	Summary    string
	Family     string
	// contains filtered or unexported fields
}

Shared based of metadata and functions

func (*AddonBase) AssembleContainers

func (b *AddonBase) AssembleContainers() []specs.ContainerSpec

func (*AddonBase) AssembleVolumes

func (b *AddonBase) AssembleVolumes() []specs.VolumeSpec

Assemble Volumes (for now) just generates one

func (*AddonBase) CustomizeEntrypoints

func (b *AddonBase) CustomizeEntrypoints([]*specs.ContainerSpec, []*jobset.ReplicatedJob)

func (*AddonBase) Description

func (b *AddonBase) Description() string

func (*AddonBase) ListOptions

func (b *AddonBase) ListOptions() map[string][]intstr.IntOrString

func (*AddonBase) MapOptions

func (b *AddonBase) MapOptions() map[string]map[string]intstr.IntOrString

func (*AddonBase) Name

func (b *AddonBase) Name() string

func (*AddonBase) Options

func (b *AddonBase) Options() map[string]intstr.IntOrString

func (*AddonBase) SetOptions

func (b *AddonBase) SetOptions(addon *api.MetricAddon, metric *api.MetricSet)

func (*AddonBase) Validate

func (b *AddonBase) Validate() bool

type ApplicationAddon

type ApplicationAddon struct {
	AddonBase
	// contains filtered or unexported fields
}

Container addons are typically for applications

func (ApplicationAddon) AssembleContainers

func (a ApplicationAddon) AssembleContainers() []specs.ContainerSpec

AssembleContainers adds the addon application container

func (*ApplicationAddon) DefaultOptions

func (a *ApplicationAddon) DefaultOptions() map[string]intstr.IntOrString

Underlying function that can be shared

func (ApplicationAddon) Family

func (m ApplicationAddon) Family() string

func (*ApplicationAddon) MapOptions

func (a *ApplicationAddon) MapOptions() map[string]map[string]intstr.IntOrString

Return formatted map options

func (*ApplicationAddon) Options

func (a *ApplicationAddon) Options() map[string]intstr.IntOrString

Exported options and list options

func (*ApplicationAddon) SetDefaultOptions

func (a *ApplicationAddon) SetDefaultOptions(metric *api.MetricAddon)

Set custom options / attributes for the metric

func (*ApplicationAddon) SetOptions

func (a *ApplicationAddon) SetOptions(addon *api.MetricAddon, metric *api.MetricSet)

Calling the default allows a custom application that uses this to do the same

func (*ApplicationAddon) Validate

func (a *ApplicationAddon) Validate() bool

Validate we have an executable provided, and args and optional

type CommandAddon

type CommandAddon struct {
	AddonBase
	// contains filtered or unexported fields
}

Command addons primarily edit the entrypoint commands

func (*CommandAddon) CustomizeEntrypoints

func (a *CommandAddon) CustomizeEntrypoints(
	cs []*specs.ContainerSpec,
	rjs []*jobset.ReplicatedJob,
)

CustomizeEntrypoint scripts

func (*CommandAddon) DefaultOptions

func (a *CommandAddon) DefaultOptions() map[string]intstr.IntOrString

Underlying function that can be shared

func (CommandAddon) Family

func (m CommandAddon) Family() string

Application family for now...

func (*CommandAddon) SetOptions

func (a *CommandAddon) SetOptions(addon *api.MetricAddon, metric *api.MetricSet)

func (*CommandAddon) SetSharedCommandOptions

func (a *CommandAddon) SetSharedCommandOptions(metric *api.MetricAddon)

Set custom options / attributes for the metric

func (*CommandAddon) Validate

func (a *CommandAddon) Validate() bool

Doesn't make sense to have an empty command prefix / pre and post!

type ConfigMapVolume

type ConfigMapVolume struct {
	VolumeBase
	// contains filtered or unexported fields
}

A general metric is a container added to a JobSet

func (*ConfigMapVolume) AssembleVolumes

func (v *ConfigMapVolume) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes for a config map

func (*ConfigMapVolume) MapOptions

func (v *ConfigMapVolume) MapOptions() map[string]map[string]intstr.IntOrString

Return formatted map options

func (*ConfigMapVolume) Options

func (v *ConfigMapVolume) Options() map[string]intstr.IntOrString

Exported options and list options

func (*ConfigMapVolume) SetOptions

func (v *ConfigMapVolume) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes for the metric

func (*ConfigMapVolume) Validate

func (v *ConfigMapVolume) Validate() bool

Validate we have an executable provided, and args and optional

type EmptyVolume

type EmptyVolume struct {
	VolumeBase
}

An empty volume requires nothing! Nice!

func (*EmptyVolume) AssembleVolumes

func (v *EmptyVolume) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes for an empty volume

func (*EmptyVolume) SetOptions

func (v *EmptyVolume) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes

func (*EmptyVolume) Validate

func (v *EmptyVolume) Validate() bool

Validate we have an executable provided, and args and optional

type FluxFramework

type FluxFramework struct {
	SpackView
	// contains filtered or unexported fields
}

func (FluxFramework) AssembleVolumes

func (m FluxFramework) AssembleVolumes() []specs.VolumeSpec

func (*FluxFramework) CustomizeEntrypoints

func (a *FluxFramework) CustomizeEntrypoints(
	cs []*specs.ContainerSpec,
	rjs []*jobset.ReplicatedJob,
)

CustomizeEntrypoint scripts

func (FluxFramework) Family

func (m FluxFramework) Family() string

func (*FluxFramework) Options

func (a *FluxFramework) Options() map[string]intstr.IntOrString

Exported options and list options

func (*FluxFramework) SetOptions

func (a *FluxFramework) SetOptions(metric *api.MetricAddon, set *api.MetricSet)

Set custom options / attributes for the addon metric

func (*FluxFramework) Validate

func (a *FluxFramework) Validate() bool

Validate we have an executable provided, and args and optional

type HPCToolkit

type HPCToolkit struct {
	SpackView
	// contains filtered or unexported fields
}

func (HPCToolkit) AssembleVolumes

func (m HPCToolkit) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes to provide an empty volume for the application to share We also need to provide a config map volume for our container spec

func (*HPCToolkit) CustomizeEntrypoints

func (a *HPCToolkit) CustomizeEntrypoints(
	cs []*specs.ContainerSpec,
	rjs []*jobset.ReplicatedJob,
)

CustomizeEntrypoint scripts

func (HPCToolkit) Family

func (m HPCToolkit) Family() string

func (*HPCToolkit) Options

func (a *HPCToolkit) Options() map[string]intstr.IntOrString

Exported options and list options

func (*HPCToolkit) SetOptions

func (a *HPCToolkit) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes for the metric

func (*HPCToolkit) Validate

func (a *HPCToolkit) Validate() bool

Validate we have an executable provided, and args and optional

type HostPathVolume

type HostPathVolume struct {
	VolumeBase
	// contains filtered or unexported fields
}

A hostPath volume

func (*HostPathVolume) AssembleVolumes

func (v *HostPathVolume) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes for a host volume

func (*HostPathVolume) SetOptions

func (v *HostPathVolume) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes

func (*HostPathVolume) Validate

func (v *HostPathVolume) Validate() bool

Validate we have an executable provided, and args and optional

type MPITrace

type MPITrace struct {
	SpackView
	// contains filtered or unexported fields
}

func (MPITrace) AssembleVolumes

func (m MPITrace) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes to provide an empty volume for the application to share We also need to provide a config map volume for our container spec

func (*MPITrace) CustomizeEntrypoints

func (a *MPITrace) CustomizeEntrypoints(
	cs []*specs.ContainerSpec,
	rjs []*jobset.ReplicatedJob,
)

CustomizeEntrypoint scripts

func (MPITrace) Family

func (m MPITrace) Family() string

func (*MPITrace) Options

func (a *MPITrace) Options() map[string]intstr.IntOrString

Exported options and list options

func (*MPITrace) SetOptions

func (a *MPITrace) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes for the metric

func (*MPITrace) Validate

func (a *MPITrace) Validate() bool

Validate we have an executable provided, and args and optional

type PerfAddon

type PerfAddon struct {
	CommandAddon
}

Perf addon expects the same command structure, but adds sys caps for trace and admin

func (*PerfAddon) CustomizeEntrypoints

func (a *PerfAddon) CustomizeEntrypoints(
	cs []*specs.ContainerSpec,
	rjs []*jobset.ReplicatedJob,
)

CustomizeEntrypoint scripts

func (*PerfAddon) SetOptions

func (a *PerfAddon) SetOptions(addon *api.MetricAddon, metric *api.MetricSet)

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	VolumeBase
	// contains filtered or unexported fields
}

An existing peristent volume claim

func (*PersistentVolumeClaim) AssembleVolumes

func (v *PersistentVolumeClaim) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes for a pvc

func (*PersistentVolumeClaim) SetOptions

func (v *PersistentVolumeClaim) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes

func (*PersistentVolumeClaim) Validate

func (v *PersistentVolumeClaim) Validate() bool

Validate we have an executable provided, and args and optional

type SecretVolume

type SecretVolume struct {
	VolumeBase
	// contains filtered or unexported fields
}

An existing secret

func (*SecretVolume) AssembleVolumes

func (v *SecretVolume) AssembleVolumes() []specs.VolumeSpec

AssembleVolumes for a Secret

func (*SecretVolume) SetOptions

func (v *SecretVolume) SetOptions(metric *api.MetricAddon, m *api.MetricSet)

Set custom options / attributes

func (*SecretVolume) Validate

func (v *SecretVolume) Validate() bool

Validate we have an executable provided, and args and optional

type SpackView

type SpackView struct {
	ApplicationAddon

	Setup              string
	SpackViewContainer string
	VolumeName         string
	EntrypointPath     string
	Mount              string
	InitContainer      bool
}

A spack view expects to copy a view from /opt/view into a mount This is a virtual struct in that it just provides shared functions for others

func (*SpackView) AssembleContainers

func (a *SpackView) AssembleContainers() []specs.ContainerSpec

Generate a container spec that will map to a listing of containers for the replicated job

func (*SpackView) GetSpackViewVolumes

func (m *SpackView) GetSpackViewVolumes() []specs.VolumeSpec

AssembleVolumes to provide an empty volume for the application to share We also need to provide a config map volume for our container spec

type VolumeBase

type VolumeBase struct {
	AddonBase
	// contains filtered or unexported fields
}

func (*VolumeBase) DefaultSetOptions

func (v *VolumeBase) DefaultSetOptions(metric *api.MetricAddon)

DefaultSetOptions across volume types for shared attributes

func (*VolumeBase) DefaultValidate

func (v *VolumeBase) DefaultValidate() bool

func (VolumeBase) Family

func (m VolumeBase) Family() string

Jump to

Keyboard shortcuts

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