Documentation ¶
Index ¶
- func ApplyMigConfig(c *Context) error
- func ApplyMigConfigWithHooks(logger *logrus.Logger, context *cli.Context, modeOnly bool, hooks ApplyHooks, ...) (rerr error)
- func ApplyMigMode(c *Context) error
- func BuildCommand() *cli.Command
- func CheckFlags(f *Flags) error
- func GetHooksEnvsMap(c *cli.Context) hooks.EnvsMap
- func GetLogger() *logrus.Logger
- func ParseHooksFile(hooksFile string) (*hooks.Spec, error)
- type ApplyHooks
- type Context
- type Flags
- type MigConfigApplier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigConfig ¶
func ApplyMigConfigWithHooks ¶
func ApplyMigConfigWithHooks(logger *logrus.Logger, context *cli.Context, modeOnly bool, hooks ApplyHooks, applier MigConfigApplier) (rerr error)
ApplyMigConfigWithHooks orchestrates the calls of a 'MigConfigApplier' between a set of 'ApplyHooks' to the set MIG configuration of a node. If 'modeOnly' is 'true', then only the MIG mode settings embedded in the 'Context' are applied.
func ApplyMigMode ¶
func BuildCommand ¶
BuildCommand builds the 'apply' subcommand for injection into the main mig-parted CLI.
func CheckFlags ¶
CheckFlags ensures that any required flags are provided and ensures they are well-formed.
func GetHooksEnvsMap ¶
GetHooksEnvsMap builds a 'hooks.EnvsMap' from the set of environment variables set when the CLI was envoked by the user. These environment variables are then made available to all hooks when thex are executed later on.
Types ¶
type ApplyHooks ¶
type ApplyHooks interface { ApplyStart(envs hooks.EnvsMap, output bool) error PreApplyMode(envs hooks.EnvsMap, output bool) error PreApplyConfig(envs hooks.EnvsMap, output bool) error ApplyExit(envs hooks.EnvsMap, output bool) error }
func NewApplyHooks ¶
func NewApplyHooks(hooksMap hooks.HooksMap) ApplyHooks
type Context ¶
Context holds the state we want to pass around between functions associated with the 'apply' subcommand.
func (*Context) ApplyMigConfig ¶
ApplyMigConfig applies the full MIG config embedded in the 'Context' to the set of GPUs on the node.
func (*Context) ApplyMigMode ¶
ApplyMigMode applies the MIG mode settings of the config embedded in the 'Context' to the set of GPUs on the node.
func (*Context) AssertMigConfig ¶
AssertMigMode reuses calls from the 'assert' subcommand to ensures that all MIG settings of a given MIG config are currently applied. The 'MigConfig' being checked is embedded in the 'Context' struct itself.
func (*Context) AssertMigMode ¶
AssertMigMode reuses calls from the 'assert' subcommand to ensures that the MIG mode settings of a given MIG config are currently applied. The 'MigConfig' being checked is embedded in the 'Context' struct itself.