config

package
v0.38.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BasicAuthZType is the default authz string id.
	BasicAuthZType = "basic"
	RBACAuthZType  = "rbac"
)

Authz string ids.

View Source
const (
	// KubernetesDefaultPriority is the default K8 resource manager priority.
	KubernetesDefaultPriority = 50

	// InfiniteTokenLifespan is the value to set the token lifespan to infinite.
	InfiniteTokenLifespan = -1
	// InfiniteTokenLifespanString is the string representation of InfiniteTokenLifespan.
	InfiniteTokenLifespanString = "-1"
	// DefaultTokenLifespanDays is the default token lifespan in days.
	DefaultTokenLifespanDays = 30
	// MaxAllowedTokenLifespanDays is the max allowed lifespan for tokens.
	// This is the maximum number of days a go duration can represent.
	MaxAllowedTokenLifespanDays = 106751
)
View Source
const (
	// KeyTypeRSA uses RSA.
	KeyTypeRSA = "RSA"
	// KeyTypeECDSA uses ECDSA.
	KeyTypeECDSA = "ECDSA"
	// KeyTypeED25519 uses ED25519.
	KeyTypeED25519 = "ED25519"
)
View Source
const (
	Project     = "project"
	Workspace   = "workspace"
	Label       = "label"
	LabelPrefix = "label:"
)

job labeling modes.

View Source
const (
	// DefaultSchedulingPriority is the default resource manager priority.
	DefaultSchedulingPriority = 42

	// FairShareScheduling schedules tasks proportional to the available resources.
	FairShareScheduling = "fair_share"
	// PriorityScheduling schedules tasks based on their priority.
	PriorityScheduling = "priority"
	// RoundRobinScheduling schedules tasks based on the order in which they arrive.
	RoundRobinScheduling = "round_robin"
)
View Source
const DefaultClusterName = "default"

DefaultClusterName is the default resource manager's cluster name when a user does not provide one.

View Source
const DefaultRMIndex = 0

DefaultRMIndex is the default resource manager index given a list of Resources().

Variables

View Source
var (
	DefaultSegmentMasterKey = ""
	DefaultSegmentWebUIKey  = ""
)

These are package-level variables so that they can be set at link time. WARN: if you move them to a different package, you need to change the linked path in the make file and CI.

Functions

func DefaultPriorityForPool

func DefaultPriorityForPool(rpName string) int

DefaultPriorityForPool returns the default priority for any jobs (user-defined if provided, otherwise our default).

func GetCertPEM

func GetCertPEM(cert *tls.Certificate) []byte

GetCertPEM returns the PEM-encoded certificate.

func ReadPriority

func ReadPriority(rpName string, jobConf interface{}) int

ReadPriority resolves the priority value for a job.

func ReadRMPreemptionStatus

func ReadRMPreemptionStatus(rpName string) bool

ReadRMPreemptionStatus resolves the preemption status for a resource manager. TODO(Brad): Move these to a resource pool level API.

func ReadWeight

func ReadWeight(rpName string, jobConf interface{}) float64

ReadWeight resolves the weight value for a job.

func RegisterAuthZType

func RegisterAuthZType(authzType string)

RegisterAuthZType adds new known authz type.

func SetMasterConfig

func SetMasterConfig(aConfig *Config)

SetMasterConfig sets the master config singleton.

Types

type AgentResourceManagerConfig

type AgentResourceManagerConfig struct {
	ClusterName                string           `json:"cluster_name"`
	Scheduler                  *SchedulerConfig `json:"scheduler"`
	DefaultAuxResourcePool     string           `json:"default_aux_resource_pool"`
	DefaultComputeResourcePool string           `json:"default_compute_resource_pool"`
	NoDefaultResourcePools     bool             `json:"no_default_resource_pools"`
	// Deprecated: use DefaultAuxResourcePool instead.
	DefaultCPUResourcePool string `json:"default_cpu_resource_pool,omitempty"`
	// Deprecated: use DefaultComputeResourcePool instead.
	DefaultGPUResourcePool string `json:"default_gpu_resource_pool,omitempty"`

	RequireAuthentication bool   `json:"require_authentication"`
	ClientCA              string `json:"client_ca"`

	// Deprecated: use ClusterName.
	Name     string            `json:"name"`
	Metadata map[string]string `json:"metadata"`
}

AgentResourceManagerConfig hosts configuration fields for the determined resource manager.

func (*AgentResourceManagerConfig) UnmarshalJSON

func (a *AgentResourceManagerConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (AgentResourceManagerConfig) Validate

func (a AgentResourceManagerConfig) Validate() []error

Validate implements the check.Validatable interface.

type AssignWorkspaceCreatorConfig

type AssignWorkspaceCreatorConfig struct {
	Enabled bool `json:"enabled"`
	RoleID  int  `json:"role_id"`
}

AssignWorkspaceCreatorConfig configures behavior of assigning a role on workspace creation.

func (AssignWorkspaceCreatorConfig) Validate

func (a AssignWorkspaceCreatorConfig) Validate() []error

Validate the RoleID of the config.

type AuthConfig

type AuthConfig struct {
	BasicAuthConfig *BasicAuthConfig `union:"type,basic" json:"-"`
	OAuthConfig     *OAuthConfig     `union:"type,oauth" json:"-"`
}

AuthConfig describes authentication configuration for SCIM.

func (AuthConfig) MarshalJSON

func (a AuthConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*AuthConfig) UnmarshalJSON

func (a *AuthConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type AuthZConfig

type AuthZConfig struct {
	Type          string  `json:"type"`
	FallbackType  *string `json:"fallback"`
	RBACUIEnabled *bool   `json:"rbac_ui_enabled"`
	// Removed: this option is removed and will not have any effect.
	StrictNTSCEnabled      bool                         `json:"_strict_ntsc_enabled"`
	AssignWorkspaceCreator AssignWorkspaceCreatorConfig `json:"workspace_creator_assign_role"`
	StrictJobQueueControl  bool                         `json:"strict_job_queue_control"`
}

AuthZConfig is a authz-related section of master config.

func DefaultAuthZConfig

func DefaultAuthZConfig() *AuthZConfig

DefaultAuthZConfig returns default authz config.

func GetAuthZConfig

func GetAuthZConfig() AuthZConfig

GetAuthZConfig returns current global authz config.

func (AuthZConfig) IsRBACEnabled

func (c AuthZConfig) IsRBACEnabled() bool

IsRBACEnabled returns if the authz config type is using the RBAC implementation and will attempt to use Fallback and Default types if necessary.

func (AuthZConfig) IsRBACUIEnabled

func (c AuthZConfig) IsRBACUIEnabled() bool

IsRBACUIEnabled returns if the feature flag RBAC should be enabled.

func (*AuthZConfig) Validate

func (c *AuthZConfig) Validate() []error

Validate the authz config.

type BasicAuthConfig

type BasicAuthConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

BasicAuthConfig describes HTTP Basic authentication configuration for SCIM.

func (BasicAuthConfig) Validate

func (b BasicAuthConfig) Validate() []error

Validate implements the check.Validatable interface.

type CacheConfig

type CacheConfig struct {
	CacheDir string `json:"cache_dir"`
}

CacheConfig is the configuration for file cache.

type Config

type Config struct {
	ConfigFile            string                            `json:"config_file"`
	Log                   logger.Config                     `json:"log"`
	DB                    DBConfig                          `json:"db"`
	TensorBoardTimeout    int                               `json:"tensorboard_timeout"`
	NotebookTimeout       *int                              `json:"notebook_timeout"`
	Security              SecurityConfig                    `json:"security"`
	CheckpointStorage     expconf.CheckpointStorageConfig   `json:"checkpoint_storage"`
	TaskContainerDefaults model.TaskContainerDefaultsConfig `json:"task_container_defaults"`
	Port                  int                               `json:"port"`
	Root                  string                            `json:"root"`
	Telemetry             config.TelemetryConfig            `json:"telemetry"`
	EnableCors            bool                              `json:"enable_cors"`
	LaunchError           bool                              `json:"launch_error"`
	ClusterName           string                            `json:"cluster_name"`
	UICustomization       UICustomizationConfig             `json:"ui_customization"`
	Logging               model.LoggingConfig               `json:"logging"`
	RetentionPolicy       model.LogRetentionPolicy          `json:"retention_policy"`
	Observability         ObservabilityConfig               `json:"observability"`
	Cache                 CacheConfig                       `json:"cache"`
	Webhooks              WebhooksConfig                    `json:"webhooks"`
	FeatureSwitches       []string                          `json:"feature_switches"`
	ReservedPorts         []int                             `json:"reserved_ports"`
	ResourceConfig

	// Internal contains "hidden" useful debugging configurations.
	InternalConfig InternalConfig `json:"__internal"`

	Scim         ScimConfig         `json:"scim"`
	SAML         SAMLConfig         `json:"saml"`
	OIDC         OIDCConfig         `json:"oidc"`
	DetCloud     DetCloudConfig     `json:"det_cloud"`
	Integrations IntegrationsConfig `json:"integrations"`
}

Config is the configuration of the master.

It is populated, in the following order, by the master configuration file, environment variables and command line arguments.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration of the master.

func GetMasterConfig

func GetMasterConfig() *Config

GetMasterConfig returns reference to the master config singleton.

func (*Config) Deprecations

func (c *Config) Deprecations() (errs []error)

Deprecations describe fields which were recently or will soon be removed.

func (Config) Printable

func (c Config) Printable() ([]byte, error)

Printable returns a printable string.

func (*Config) Resolve

func (c *Config) Resolve() error

Resolve resolves the values in the configuration.

type DBConfig

type DBConfig struct {
	User             string `json:"user"`
	Password         string `json:"password"`
	Migrations       string `json:"migrations"`
	ViewsAndTriggers string `json:"views_and_triggers"`
	Host             string `json:"host"`
	Port             string `json:"port"`
	Name             string `json:"name"`
	SSLMode          string `json:"ssl_mode"`
	SSLRootCert      string `json:"ssl_root_cert"`
}

DBConfig hosts configuration fields of the database.

func DefaultDBConfig

func DefaultDBConfig() *DBConfig

DefaultDBConfig returns the default configuration of the database.

type DetCloudConfig

type DetCloudConfig struct {
	Enabled        bool   `json:"enabled"`
	LoginURL       string `json:"login_url"`
	AlwaysRedirect bool   `json:"always_redirect"`
}

DetCloudConfig allows det-cloud specific configuration.

func (DetCloudConfig) Validate

func (c DetCloudConfig) Validate() []error

Validate implements the check.Validatable interface.

type DispatcherPartitionOverrideConfigs

type DispatcherPartitionOverrideConfigs struct {
	//nolint:lll // I honestly don't know how to break this line within Go's grammar.
	RendezvousNetworkInterface  *string                            `json:"rendezvous_network_interface"`
	ProxyNetworkInterface       *string                            `json:"proxy_network_interface"`
	SlotType                    *device.Type                       `json:"slot_type"`
	TaskContainerDefaultsConfig *model.TaskContainerDefaultsConfig `json:"task_container_defaults"`
	Description                 string                             `json:"description"`
}

DispatcherPartitionOverrideConfigs describes per-partition overrides.

type DispatcherResourceManagerConfig

type DispatcherResourceManagerConfig struct {
	ClusterName                string       `json:"cluster_name"`
	MasterHost                 string       `json:"master_host"`
	MasterPort                 int          `json:"master_port"`
	LauncherHost               string       `json:"host"`
	LauncherPort               int          `json:"port"`
	LauncherProtocol           string       `json:"protocol"`
	SlotType                   *device.Type `json:"slot_type"`
	LauncherAuthFile           string       `json:"auth_file"`
	LauncherContainerRunType   string       `json:"container_run_type"`
	RendezvousNetworkInterface string       `json:"rendezvous_network_interface"`
	ProxyNetworkInterface      string       `json:"proxy_network_interface"`
	// Configuration parameters that are proxies for launcher.conf
	// and will be applied there by the init script.
	UserName             string `json:"user_name"`
	GroupName            string `json:"group_name"`
	SingularityImageRoot string `json:"singularity_image_root"`
	ApptainerImageRoot   string `json:"apptainer_image_root"`
	JobStorageRoot       string `json:"job_storage_root"`
	Path                 string `json:"path"`
	LdLibraryPath        string `json:"ld_library_path"`
	LauncherJvmArgs      string `json:"launcher_jvm_args"`
	SudoAuthorized       string `json:"sudo_authorized"`
	// Configuration parameters handled by DispatchRM within master
	TresSupported              bool    `json:"tres_supported"`
	GresSupported              bool    `json:"gres_supported"`
	DefaultAuxResourcePool     *string `json:"default_aux_resource_pool"`
	DefaultComputeResourcePool *string `json:"default_compute_resource_pool"`
	JobProjectSource           *string `json:"job_project_source"`

	// Deprecated: use ClusterName.
	Name     string            `json:"name"`
	Metadata map[string]string `json:"metadata"`

	Security           *DispatcherSecurityConfig                     `json:"security"`
	PartitionOverrides map[string]DispatcherPartitionOverrideConfigs `json:"partition_overrides"`
}

DispatcherResourceManagerConfig is the object that stores the values of the "resource_manager" section of "tools/devcluster.yaml".

func (DispatcherResourceManagerConfig) ResolveProxyNetworkInterface

func (c DispatcherResourceManagerConfig) ResolveProxyNetworkInterface(partition string) string

ResolveProxyNetworkInterface resolves the proxy network interface by first looking for a partition-specific setting and then falling back to the master config.

func (DispatcherResourceManagerConfig) ResolveRendezvousNetworkInterface

func (c DispatcherResourceManagerConfig) ResolveRendezvousNetworkInterface(
	partition string,
) string

ResolveRendezvousNetworkInterface resolves the rendezvous network interface by first looking for a partition-specific setting and then falling back to the master config.

func (DispatcherResourceManagerConfig) ResolveSlotType

func (c DispatcherResourceManagerConfig) ResolveSlotType(partition string) *device.Type

ResolveSlotType resolves the slot type by first looking for a partition-specific setting, then falling back to the master config, and finally falling back to what we can infer.

func (DispatcherResourceManagerConfig) ResolveSlotTypeFromOverrides

func (c DispatcherResourceManagerConfig) ResolveSlotTypeFromOverrides(
	partition string,
) *device.Type

ResolveSlotTypeFromOverrides scans the available partition overrides for a slot type definition for the specified partition.

func (DispatcherResourceManagerConfig) ResolveTaskContainerDefaults

func (c DispatcherResourceManagerConfig) ResolveTaskContainerDefaults(
	partition string,
) *model.TaskContainerDefaultsConfig

ResolveTaskContainerDefaults resolves the task container defaults by first looking for a partition-specific setting and then falling back to the master config.

func (*DispatcherResourceManagerConfig) UnmarshalJSON

func (c *DispatcherResourceManagerConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (DispatcherResourceManagerConfig) Validate

func (c DispatcherResourceManagerConfig) Validate() []error

Validate performs validation.

type DispatcherSecurityConfig

type DispatcherSecurityConfig struct {
	TLS model.TLSClientConfig `json:"tls"`
}

DispatcherSecurityConfig configures security-related options for the elastic logging backend.

type ExperimentConfigPatch

type ExperimentConfigPatch struct {
	Name *string `json:"name,omitempty"`
}

ExperimentConfigPatch is the updatedble fields for patching an experiment.

type FairShareSchedulerConfig

type FairShareSchedulerConfig struct{}

FairShareSchedulerConfig holds configurations for the fair share scheduler.

type FluentConfig

type FluentConfig struct {
	Image string `json:"image"`
	UID   int    `json:"uid"`
	GID   int    `json:"gid"`
}

FluentConfig stores k8s-configurable Fluent Bit-related options.

type IntegrationsConfig

type IntegrationsConfig struct {
	Pachyderm PachydermConfig `json:"pachyderm"`
}

IntegrationsConfig stores configs related to integrations like pachyderm.

type InternalConfig

type InternalConfig struct {
	AuditLoggingEnabled bool                   `json:"audit_logging_enabled"`
	ExternalSessions    model.ExternalSessions `json:"external_sessions"`
	ProxiedServers      []ProxiedServerConfig  `json:"proxied_servers"`
}

InternalConfig is the configuration for internal knobs.

func (*InternalConfig) Validate

func (i *InternalConfig) Validate() []error

Validate implements the check.Validatable interface.

type InternalTaskGatewayConfig

type InternalTaskGatewayConfig struct {
	// GatewayName as defined in the k8s cluster.
	GatewayName string `json:"gateway_name"`
	// GatewayNamespace as defined in the k8s cluster.
	GatewayNamespace string `json:"gateway_namespace"`
	GatewayIP        string `json:"gateway_ip"`
	// GWPortStart denotes the inclusive start of the available and exclusive port range to
	// MLDE for InternalTaskGateway.
	GWPortStart int `json:"gateway_port_range_start"`
	// GWPortEnd denotes the inclusive end of the available and exclusive port range to
	// MLDE for InternalTaskGateway.
	GWPortEnd int `json:"gateway_port_range_end"`
}

InternalTaskGatewayConfig is config for exposing Determined tasks to outside of the cluster. Useful for multirm when we can only be running in a single cluster.

func (*InternalTaskGatewayConfig) UnmarshalJSON

func (i *InternalTaskGatewayConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*InternalTaskGatewayConfig) Validate

func (i *InternalTaskGatewayConfig) Validate() []error

Validate implements the check.Validatable interface.

type KubernetesResourceManagerConfig

type KubernetesResourceManagerConfig struct {
	// Changed from "Namespace" to "DefaultNamespace". DefaultNamespace is an optional field that
	// allows the user to specify the default namespace to bind a workspace to, for each RM.
	DefaultNamespace string `json:"default_namespace"`

	MaxSlotsPerPod *int `json:"max_slots_per_pod"`

	ClusterName              string                  `json:"cluster_name"`
	MasterServiceName        string                  `json:"master_service_name"`
	LeaveKubernetesResources bool                    `json:"leave_kubernetes_resources"`
	DefaultScheduler         string                  `json:"default_scheduler"`
	SlotType                 device.Type             `json:"slot_type"`
	SlotResourceRequests     PodSlotResourceRequests `json:"slot_resource_requests"`
	// deprecated, no longer in use.
	Fluent         FluentConfig `json:"fluent"`
	KubeconfigPath string       `json:"kubeconfig_path"`

	DetMasterScheme string `json:"determined_master_scheme,omitempty"`
	DetMasterHost   string `json:"determined_master_host,omitempty"`
	DetMasterPort   int32  `json:"determined_master_port,omitempty"`

	DefaultAuxResourcePool     string `json:"default_aux_resource_pool"`
	DefaultComputeResourcePool string `json:"default_compute_resource_pool"`
	NoDefaultResourcePools     bool   `json:"no_default_resource_pools"`

	InternalTaskGateway *InternalTaskGatewayConfig `json:"internal_task_gateway"`

	// Deprecated: use ClusterName.
	Name string `json:"name"`

	Metadata map[string]string `json:"metadata"`
}

KubernetesResourceManagerConfig hosts configuration fields for the kubernetes resource manager.

func (*KubernetesResourceManagerConfig) UnmarshalJSON

func (k *KubernetesResourceManagerConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (KubernetesResourceManagerConfig) Validate

func (k KubernetesResourceManagerConfig) Validate() []error

Validate implements the check.Validatable interface.

type MediaAssetVariations

type MediaAssetVariations struct {
	DarkHorizontal  string `json:"dark_horizontal"`
	DarkVeritical   string `json:"dark_vertical"`
	LightHorizontal string `json:"light_horizontal"`
	LightVeritical  string `json:"light_vertical"`
}

MediaAssetVariations allow variations of a media asset to be defined.

func (MediaAssetVariations) PickVariation

func (m MediaAssetVariations) PickVariation(mode, orientation string) string

PickVariation returns the best variation for the given mode and orientation.

type OAuthConfig

type OAuthConfig struct{}

OAuthConfig describes OAuth configuration for SCIM (currently empty because we need a placeholder for the union type unmarshaling).

type OIDCConfig

type OIDCConfig struct {
	Enabled                     bool   `json:"enabled"`
	Provider                    string `json:"provider"`
	ClientID                    string `json:"client_id"`
	ClientSecret                string `json:"client_secret"`
	IDPSSOURL                   string `json:"idp_sso_url"`
	IDPRecipientURL             string `json:"idp_recipient_url"`
	AuthenticationClaim         string `json:"authentication_claim"`
	SCIMAuthenticationAttribute string `json:"scim_authentication_attribute"`
	AutoProvisionUsers          bool   `json:"auto_provision_users"`
	GroupsAttributeName         string `json:"groups_attribute_name"`
	DisplayNameAttributeName    string `json:"display_name_attribute_name"`
	AgentUIDAttributeName       string `json:"agent_uid_attribute_name"`
	AgentGIDAttributeName       string `json:"agent_gid_attribute_name"`
	AgentUserNameAttributeName  string `json:"agent_user_name_attribute_name"`
	AgentGroupNameAttributeName string `json:"agent_group_name_attribute_name"`
	AlwaysRedirect              bool   `json:"always_redirect"`
	ExcludeGroupsScope          bool   `json:"exclude_groups_scope"`
}

OIDCConfig holds the parameters for the OIDC provider.

func (OIDCConfig) Validate

func (c OIDCConfig) Validate() []error

Validate implements the check.Validatable interface.

type ObservabilityConfig

type ObservabilityConfig struct {
	EnablePrometheus bool `json:"enable_prometheus"`
}

ObservabilityConfig is the configuration for observability metrics. Defaulted to true.

type PachydermConfig

type PachydermConfig struct {
	// pachyderm daemon address.
	Address string `json:"address"`
}

PachydermConfig stores fields needed to integrate Pachyderm with determined.

type PodSlotResourceRequests

type PodSlotResourceRequests struct {
	CPU float32 `json:"cpu"`
}

PodSlotResourceRequests contains the per-slot container requests.

type PrioritySchedulerConfig

type PrioritySchedulerConfig struct {
	Preemption      bool `json:"preemption"`
	DefaultPriority *int `json:"default_priority"`
}

PrioritySchedulerConfig holds the configurations for the priority scheduler.

func (PrioritySchedulerConfig) Validate

func (p PrioritySchedulerConfig) Validate() []error

Validate implements the check.Validatable interface.

type ProxiedServerConfig

type ProxiedServerConfig struct {
	// Prefix is the path prefix to match for this proxy.
	PathPrefix string `json:"path_prefix"`
	// Destination is the URL to proxy to.
	Destination string `json:"destination"`
}

ProxiedServerConfig is the configuration for a internal proxied server.

func (*ProxiedServerConfig) Validate

func (p *ProxiedServerConfig) Validate() []error

Validate implements the check.Validatable interface.

type ResourceConfig

type ResourceConfig struct {
	// Deprecated: do not use this. All access should be through ResourceManagers().
	RootManagerInternal *ResourceManagerConfig `json:"resource_manager"`
	// Deprecated: do not use this. All access should be through ResourceManagers().
	RootPoolsInternal []ResourcePoolConfig `json:"resource_pools"`
	// Deprecated: do not use this. All access should be through ResourceManagers().
	AdditionalResourceManagersInternal []*ResourceManagerWithPoolsConfig `json:"additional_resource_managers"`
}

ResourceConfig hosts configuration fields of the resource manager and resource pools.

func DefaultResourceConfig

func DefaultResourceConfig() *ResourceConfig

DefaultResourceConfig returns the default resource configuration.

func (*ResourceConfig) GetAgentRMConfig

func (r *ResourceConfig) GetAgentRMConfig() (*ResourceManagerWithPoolsConfig, bool)

GetAgentRMConfig gets the agent rm config if it exists and returns a bool indiciating if it exists.

func (*ResourceConfig) GetKubernetesClusterNames

func (r *ResourceConfig) GetKubernetesClusterNames() []string

GetKubernetesClusterNames gets the list of Kubernetes Cluster names.

func (*ResourceConfig) ResolveResource

func (r *ResourceConfig) ResolveResource() error

ResolveResource resolves the config.

func (*ResourceConfig) ResourceManagers

func (r *ResourceConfig) ResourceManagers() []*ResourceManagerWithPoolsConfig

ResourceManagers returns a list of resource managers and pools. All access should go through here and not struct items.

func (ResourceConfig) Validate

func (r ResourceConfig) Validate() []error

Validate implements the check.Validatable interface.

type ResourceManagerConfig

type ResourceManagerConfig struct {
	AgentRM      *AgentResourceManagerConfig      `union:"type,agent" json:"-"`
	KubernetesRM *KubernetesResourceManagerConfig `union:"type,kubernetes" json:"-"`
	DispatcherRM *DispatcherResourceManagerConfig `union:"type,slurm" json:"-"`
	PbsRM        *DispatcherResourceManagerConfig `union:"type,pbs" json:"-"`
}

ResourceManagerConfig hosts configuration fields for the resource manager.

func (ResourceManagerConfig) ClusterName

func (r ResourceManagerConfig) ClusterName() string

ClusterName returns the cluster name associated with the resource manager. If the cluster name is empty, it gets assigned to the (possibly) assigned resource manager name.

func (ResourceManagerConfig) MarshalJSON

func (r ResourceManagerConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*ResourceManagerConfig) UnmarshalJSON

func (r *ResourceManagerConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type ResourceManagerWithPoolsConfig

type ResourceManagerWithPoolsConfig struct {
	ResourceManager *ResourceManagerConfig `json:"resource_manager"`
	ResourcePools   []ResourcePoolConfig   `json:"resource_pools"`
}

ResourceManagerWithPoolsConfig is a resource manager pool config pair.

type ResourcePoolConfig

type ResourcePoolConfig struct {
	PoolName                 string                             `json:"pool_name"`
	Description              string                             `json:"description"`
	Provider                 *provconfig.Config                 `json:"provider"`
	Scheduler                *SchedulerConfig                   `json:"scheduler,omitempty"`
	MaxAuxContainersPerAgent int                                `json:"max_aux_containers_per_agent"`
	TaskContainerDefaults    *model.TaskContainerDefaultsConfig `json:"task_container_defaults"`
	// AgentReattachEnabled defines if master & agent try to recover
	// running containers after a clean restart.
	AgentReattachEnabled bool `json:"agent_reattach_enabled"`
	// AgentReconnectWait define the time master will wait for agent
	// before abandoning it.
	AgentReconnectWait model.Duration `json:"agent_reconnect_wait"`

	// Deprecated: Use MaxAuxContainersPerAgent instead.
	MaxCPUContainersPerAgent int `json:"max_cpu_containers_per_agent,omitempty"`
}

ResourcePoolConfig hosts the configuration for a resource pool.

func (ResourcePoolConfig) Printable

func (r ResourcePoolConfig) Printable() ResourcePoolConfig

Printable returns a printable object.

func (*ResourcePoolConfig) UnmarshalJSON

func (r *ResourcePoolConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (ResourcePoolConfig) Validate

func (r ResourcePoolConfig) Validate() []error

Validate implements the check.Validatable interface.

type RoundRobinSchedulerConfig

type RoundRobinSchedulerConfig struct{}

RoundRobinSchedulerConfig holds the configurations for the round robing scheduler.

type SAMLConfig

type SAMLConfig struct {
	Enabled                     bool   `json:"enabled"`
	Provider                    string `json:"provider"`
	IDPRecipientURL             string `json:"idp_recipient_url"`
	IDPSSOURL                   string `json:"idp_sso_url"`
	IDPSSODescriptorURL         string `json:"idp_sso_descriptor_url"`
	IDPMetadataURL              string `json:"idp_metadata_url"`
	AutoProvisionUsers          bool   `json:"auto_provision_users"`
	GroupsAttributeName         string `json:"groups_attribute_name"`
	DisplayNameAttributeName    string `json:"display_name_attribute_name"`
	AgentUIDAttributeName       string `json:"agent_uid_attribute_name"`
	AgentGIDAttributeName       string `json:"agent_gid_attribute_name"`
	AgentUserNameAttributeName  string `json:"agent_user_name_attribute_name"`
	AgentGroupNameAttributeName string `json:"agent_group_name_attribute_name"`
	AlwaysRedirect              bool   `json:"always_redirect"`
}

SAMLConfig describes config for SAML.

func (SAMLConfig) Validate

func (c SAMLConfig) Validate() []error

Validate implements the check.Validatable interface.

type SSHConfig

type SSHConfig struct {
	RsaKeySize int    `json:"rsa_key_size"`
	KeyType    string `json:"key_type"`
}

SSHConfig is the configuration setting for SSH.

func (*SSHConfig) Validate

func (t *SSHConfig) Validate() []error

Validate implements the check.Validatable interface.

type SchedulerConfig

type SchedulerConfig struct {
	FairShare              *FairShareSchedulerConfig  `union:"type,fair_share" json:"-"`
	Priority               *PrioritySchedulerConfig   `union:"type,priority" json:"-"`
	RoundRobin             *RoundRobinSchedulerConfig `union:"type,round_robin" json:"-"`
	FittingPolicy          string                     `json:"fitting_policy"`
	AllowHeterogeneousFits bool                       `json:"allow_heterogeneous_fits"`
}

SchedulerConfig holds the configurations for scheduling policies.

func DefaultSchedulerConfig

func DefaultSchedulerConfig() *SchedulerConfig

DefaultSchedulerConfig returns the default fair share configuration for the scheduler.

func (*SchedulerConfig) GetPreemption

func (s *SchedulerConfig) GetPreemption() bool

GetPreemption returns whether the scheduler is set to preempt.

func (*SchedulerConfig) GetType

func (s *SchedulerConfig) GetType() string

GetType returns the type of scheduler that is configured.

func (SchedulerConfig) MarshalJSON

func (s SchedulerConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*SchedulerConfig) UnmarshalJSON

func (s *SchedulerConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (SchedulerConfig) Validate

func (s SchedulerConfig) Validate() []error

Validate implements the check.Validatable interface.

type ScimConfig

type ScimConfig struct {
	Enabled bool       `json:"enabled"`
	Auth    AuthConfig `json:"auth"`
}

ScimConfig describes config for SCIM.

type SecurityConfig

type SecurityConfig struct {
	DefaultTask model.AgentUserGroup `json:"default_task"`
	TLS         TLSConfig            `json:"tls"`
	SSH         SSHConfig            `json:"ssh"`
	AuthZ       AuthZConfig          `json:"authz"`
	Token       TokenConfig          `json:"token"`

	InitialUserPassword string `json:"initial_user_password"`
}

SecurityConfig is the security configuration for the master.

type TLSConfig

type TLSConfig struct {
	Cert string `json:"cert"`
	Key  string `json:"key"`
}

TLSConfig is the configuration for setting up serving over TLS.

func (*TLSConfig) Enabled

func (t *TLSConfig) Enabled() bool

Enabled returns whether this configuration makes it possible to enable TLS.

func (*TLSConfig) ReadCertificate

func (t *TLSConfig) ReadCertificate() (*tls.Certificate, error)

ReadCertificate returns the certificate described by this configuration (nil if it does not allow TLS to be enabled).

func (*TLSConfig) Validate

func (t *TLSConfig) Validate() []error

Validate implements the check.Validatable interface.

type TokenConfig

type TokenConfig struct {
	MaxLifespanDays     int `json:"max_lifespan_days"`
	DefaultLifespanDays int `json:"default_lifespan_days"`
}

TokenConfig is the configuration setting for tokens.

func (*TokenConfig) DefaultLifespan

func (t *TokenConfig) DefaultLifespan() time.Duration

DefaultLifespan returns DefaultLifespanDays as a time.Duration.

func (*TokenConfig) MaxLifespan

func (t *TokenConfig) MaxLifespan() time.Duration

MaxLifespan returns MaxLifespanDays as a time.Duration.

func (*TokenConfig) Validate

func (t *TokenConfig) Validate() []error

Validate implements the check.Validatable interface for the TokenConfig.

type UICustomizationConfig

type UICustomizationConfig struct {
	// LogoPaths is the path to variations of the custom logo to use in the web UI.
	LogoPaths *MediaAssetVariations `json:"logo_paths"`
}

UICustomizationConfig holds the configuration for customizing the UI.

func (u UICustomizationConfig) HasCustomLogo() bool

HasCustomLogo returns whether the UI customization has a custom logo.

func (UICustomizationConfig) Validate

func (u UICustomizationConfig) Validate() []error

Validate checks if the paths in UICustomizationConfig are valid filesystem paths and reachable.

type WebhooksConfig

type WebhooksConfig struct {
	BaseURL    string `json:"base_url"`
	SigningKey string `json:"signing_key"`
}

WebhooksConfig hosts configuration fields for webhook functionality.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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