ui

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func FormatAge(d time.Duration) string

FormatAge formats an elapsed duration as a compact human-readable string (e.g. "6h11m", "2d3h", "45m", "<1m") suitable for "... %s ago" displays.

func FormatRunResources

func FormatRunResources(r *helper.HelperRun) string

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

func MonitorHelper(ctx context.Context, id string) error

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

func OfferSingletonBlocked(name string, running []*helper.HelperRun, serverPort int) error

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

func PrintLaunchSpec(plan *helper.RunPlan)

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

func RenderExecPlan(plan *execpkg.Plan)

RenderExecPlan prints CLI-only diagnostics and environment notes for a prepared exec plan.

func RunStatusTag added in v1.5.1

func RunStatusTag(r *helper.HelperRun) (tag, verb string)

RunStatusTag returns the bracketed status tag and verb for an active run, e.g. ("[PENDING]", "submitted") or ("[RUNNING]", "started").

func WaitBeforeStart

func WaitBeforeStart(ctx context.Context, d time.Duration) error

WaitBeforeStart prints a countdown and blocks until done or ctx is cancelled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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