options

package
v0.750.8 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RocrVisibleDevices define the ROCm resources allocated by Slurm.
	RocrVisibleDevices = "ROCR_VISIBLE_DEVICES"
	// CudaVisibleDevices define the CUDA resources allocated by Slurm.
	CudaVisibleDevices = "CUDA_VISIBLE_DEVICES"
)
View Source
const (
	DockerContainerRuntime = "docker"
)

Available container runtimes.

Variables

View Source
var DefaultFluentOptions = FluentOptions{
	ContainerName: "",
	Port:          0,
	Image:         "",
}

DefaultFluentOptions stores defaults for Agent FluentBit options, deprecated.

Functions

func VisibleGPUsFromEnvironment

func VisibleGPUsFromEnvironment() (visDevices string)

VisibleGPUsFromEnvironment returns GPU visibility information from the environment if any, else "".

Types

type ContainerRuntime

type ContainerRuntime string

ContainerRuntime configures which container runtime to use.

type FluentOptions

type FluentOptions struct {
	Image         string `json:"image"`
	Port          int    `json:"port"`
	ContainerName string `json:"container_name"`
}

FluentOptions stores configurable Fluent Bit-related options, deprecated no longer in use.

type HooksOptions

type HooksOptions struct {
	OnConnectionLost []string `json:"on_connection_lost"`
}

HooksOptions contains external commands to be run when specific things happen.

type Options

type Options struct {
	ConfigFile string        `json:"config_file"`
	Log        logger.Config `json:"log"`

	MasterHost string `json:"master_host"`
	MasterPort int    `json:"master_port"`
	AgentID    string `json:"agent_id"`

	// Label has been deprecated; we now use ResourcePool to classify the agent.
	ResourcePool string `json:"resource_pool"`

	ContainerMasterHost string `json:"container_master_host"`
	ContainerMasterPort int    `json:"container_master_port"`

	SlotType    string `json:"slot_type"`
	VisibleGPUs string `json:"visible_gpus"`

	Security SecurityOptions `json:"security"`

	Debug           bool `json:"debug"`
	ArtificialSlots int  `json:"artificial_slots"`

	TLS         bool   `json:"tls"`
	TLSCertFile string `json:"tls_cert"`
	TLSKeyFile  string `json:"tls_key"`

	APIEnabled bool   `json:"api_enabled"`
	BindIP     string `json:"bind_ip"`
	BindPort   int    `json:"bind_port"`

	HTTPProxy  string `json:"http_proxy"`
	HTTPSProxy string `json:"https_proxy"`
	FTPProxy   string `json:"ftp_proxy"`
	NoProxy    string `json:"no_proxy"`

	AgentReconnectAttempts int `json:"agent_reconnect_attempts"`
	// TODO(ilia): switch this to better parsing with `model.Duration` similar to
	// master config.
	AgentReconnectBackoff int `json:"agent_reconnect_backoff"`

	ContainerRuntime string `json:"container_runtime"`

	ContainerAutoRemoveDisabled bool `json:"container_auto_remove_disabled"`

	Hooks HooksOptions `json:"hooks"`

	// The Fluent docker image to use, deprecated.
	Fluent FluentOptions `json:"fluent"`
}

Options stores all the configurable options for the Determined agent.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default configurable options for the Determined agent.

func (Options) Deprecations

func (o Options) Deprecations() (errs []error)

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

func (Options) Printable

func (o Options) Printable() ([]byte, error)

Printable returns a printable string.

func (*Options) Resolve

func (o *Options) Resolve()

Resolve fully resolves the agent configuration, handling dynamic defaults.

func (*Options) SetAgentID

func (o *Options) SetAgentID() error

SetAgentID resolves the name (or ID) of the agent.

func (Options) Validate

func (o Options) Validate() []error

Validate validates the state of the Options struct.

type SecurityOptions

type SecurityOptions struct {
	TLS TLSOptions `json:"tls"`
}

SecurityOptions stores configurable security-related options.

type TLSOptions

type TLSOptions struct {
	Enabled        bool   `json:"enabled"`
	SkipVerify     bool   `json:"skip_verify"`
	MasterCert     string `json:"master_cert"`
	MasterCertName string `json:"master_cert_name"`
	ClientCert     string `json:"client_cert"`
	ClientKey      string `json:"client_key"`
}

TLSOptions is the TLS connection configuration for the agent.

func (TLSOptions) ReadClientCertificate

func (t TLSOptions) ReadClientCertificate() (*tls.Certificate, error)

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

func (TLSOptions) Validate

func (t TLSOptions) Validate() []error

Validate implements the check.Validatable interface.

Jump to

Keyboard shortcuts

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