Documentation
¶
Index ¶
- func ApplyHistoryRun(opts *helper.RunOptions, r *helper.HelperRun)
- func FormatAge(d time.Duration) string
- func FormatRunResources(r *helper.HelperRun) string
- func GuidedInstallMissing(ctx context.Context, e *helper.ErrMissingPackages) error
- func GuidedOverlayCreate(ctx context.Context, helperName string, meta helper.HelperScriptMeta, ...) (string, error)
- func MonitorHelper(ctx context.Context, id string) error
- func OfferRecentSessions(ctx context.Context, name string, running []*helper.HelperRun, serverPort int) (chosen *helper.HelperRun, isRunning bool, startNew bool, err error)
- func OfferSingletonBlocked(name string, running []*helper.HelperRun, serverPort int) error
- func OfferStopPicker(ctx context.Context, name string, running []*helper.HelperRun) ([]*helper.HelperRun, error)
- func PrintLaunchSpec(plan *helper.RunPlan)
- func PromptSettings(ctx context.Context, params []helper.HelperParam, ...) (map[string]string, error)
- func RenderExecPlan(plan *execpkg.Plan)
- func RunStatusTag(r *helper.HelperRun) (tag, verb string)
- func WaitBeforeStart(ctx context.Context, d time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHistoryRun ¶
func ApplyHistoryRun(opts *helper.RunOptions, r *helper.HelperRun)
ApplyHistoryRun copies a previous run's settings into opts. All values are pre-filled and will appear in the PromptSettings table for the user to review and edit before launch.
func FormatAge ¶ added in v1.5.1
FormatAge formats an elapsed duration as a compact human-readable string (e.g. "6h11m", "2d3h", "45m", "<1m") suitable for "... %s ago" displays.
func FormatRunResources ¶
FormatRunResources returns a compact resource summary like "4c/16GB/12h/a100:1".
func GuidedInstallMissing ¶
func GuidedInstallMissing(ctx context.Context, e *helper.ErrMissingPackages) error
GuidedInstallMissing prompts the user to install packages that failed the #IMG_PACKAGES: check. Prints the unsatisfied specs, asks Y/n, then runs micromamba install inside the overlay if confirmed.
func GuidedOverlayCreate ¶
func GuidedOverlayCreate(ctx context.Context, helperName string, meta helper.HelperScriptMeta, params map[string]string, versions map[string][]string, cwd string) (string, error)
GuidedOverlayCreate runs the interactive wizard for creating a writable conda overlay and installing the packages specified by meta.ImgPackages. cwd is the working directory used to compute the default overlay path (env.img lives next to the project so FindEnvOverlay can auto-detect it on later runs). Returns the path of the created overlay.
func MonitorHelper ¶
MonitorHelper polls NFS state files until the job finishes or the user presses Ctrl+C. Returns nil once the service is ready or the job completes cleanly.
func OfferRecentSessions ¶
func OfferRecentSessions(ctx context.Context, name string, running []*helper.HelperRun, serverPort int, ) (chosen *helper.HelperRun, isRunning bool, startNew bool, err error)
OfferRecentSessions shows a combined list of active instances and recent history, deduplicated by CWD. Active entries are tagged with their actual status ([PENDING]/[STARTING]/[RUNNING]) and, when available, their access URL.
Return values:
- chosen != nil, isRunning=true → caller should print URL (or wait for a pending/starting job) and exit (no new launch)
- chosen != nil, isRunning=false → caller should call ApplyHistoryRun then continue
- startNew=true → caller continues with defaults
func OfferSingletonBlocked ¶
PrintDefaultSettings prints the script's default resource settings before prompts. OfferSingletonBlocked prints an informative message and returns a non-nil error when a singleton helper is already running.
func OfferStopPicker ¶
func OfferStopPicker(ctx context.Context, name string, running []*helper.HelperRun) ([]*helper.HelperRun, error)
OfferStopPicker prompts the user to choose which running instance(s) to stop. When name is empty, lists all running helpers with their names shown. Returns the runs to stop: one entry when the user picks a number, all when "a" is entered. Returns nil slice (no error) when the user cancels with an invalid input.
func PrintLaunchSpec ¶
PrintLaunchSpec prints the resolved launch settings before a helper starts.
func PromptSettings ¶
func PromptSettings(ctx context.Context, params []helper.HelperParam, values, saved map[string]string, versions map[string][]string, opts *helper.RunOptions, spec *scheduler.ResourceSpec, ) (map[string]string, error)
PromptSettings prints all settings in one combined block, then enters an edit loop where the user can type "key value" to update any field. An empty line accepts all values and continues. Pass spec=nil to skip resources. Empty-default params pass through as empty — the script handles them.
func RenderExecPlan ¶
RenderExecPlan prints CLI-only diagnostics and environment notes for a prepared exec plan.
func RunStatusTag ¶ added in v1.5.1
RunStatusTag returns the bracketed status tag and verb for an active run, e.g. ("[PENDING]", "submitted") or ("[RUNNING]", "started").
Types ¶
This section is empty.