Documentation
¶
Index ¶
- Constants
- func Execute()
- func ExitIfJobsSubmitted(graph *build.BuildGraph)
- func ExitWithError(format string, a ...interface{})
- func KnownFlags() map[string]bool
- func ParseCommandArgs(subcommand string) ([]string, []string)
- func ParseInstanceArgs(subcommand string) (string, []string)
- func PrepareCommandAndHidePrompt(commands []string) ([]string, bool)
- func RegisterCommonFlags(cmd *cobra.Command, flags *CommonFlags)
- func ResolveBaseImage(baseImage string) string
- type CommonFlags
- type HelperScriptEntry
- type PackageInfo
Constants ¶
const ( // Generic error code ExitCodeError = 1 // Returned when jobs were submitted to a scheduler (overlays will be created asynchronously) ExitCodeJobsSubmitted = 3 )
Exit codes used by various commands
Variables ¶
This section is empty.
Functions ¶
func ExitIfJobsSubmitted ¶ added in v1.1.1
func ExitIfJobsSubmitted(graph *build.BuildGraph)
ExitIfJobsSubmitted exits the process with ExitCodeJobsSubmitted if a scheduler submission was requested and the graph shows job IDs were created.
func ExitWithError ¶ added in v1.1.1
func ExitWithError(format string, a ...interface{})
ExitWithError prints an error and exits with ExitCodeError
func KnownFlags ¶ added in v1.1.1
KnownFlags returns a map of all known condatainer flags
func ParseCommandArgs ¶ added in v1.1.1
ParseCommandArgs parses arguments from os.Args after a given subcommand Returns: commands (positional args), apptainerFlags (unknown flags for apptainer)
func ParseInstanceArgs ¶ added in v1.1.1
ParseInstanceArgs parses arguments for instance start/run commands Returns: instanceName, apptainerFlags
func PrepareCommandAndHidePrompt ¶ added in v1.1.1
PrepareCommandAndHidePrompt prepares the command array and determines if prompt should be hidden If commands is empty, defaults to ["bash"] with hidePrompt=false If commands has 1 element, returns hidePrompt=false Otherwise returns hidePrompt=true
func RegisterCommonFlags ¶ added in v1.1.1
func RegisterCommonFlags(cmd *cobra.Command, flags *CommonFlags)
RegisterCommonFlags registers common flags on a cobra command
func ResolveBaseImage ¶ added in v1.1.1
ResolveBaseImage resolves a base image path to an absolute path Returns empty string if baseImage is empty
Types ¶
type CommonFlags ¶ added in v1.1.1
type CommonFlags struct {
Overlays []string
WritableImg bool
EnvSettings []string
BaseImage string
BindPaths []string
Fakeroot bool
}
CommonFlags holds the common flags used by exec, instance start, and instance exec
type HelperScriptEntry ¶
type HelperScriptEntry struct {
Path string `json:"path"`
}
HelperScriptEntry represents a helper script metadata entry
type PackageInfo ¶
type PackageInfo struct {
Name string // name/version format
Path string // full path to build script
IsContainer bool // true if .def file
IsInstalled bool // true if overlay exists
IsRemote bool // true if from remote repository
}
PackageInfo holds information about a build script