Documentation
¶
Index ¶
- func CreateCondaOverlay(ctx context.Context, opts *overlay.CreateOptions, pkgs []string, ...) error
- func DescribeInitialCondaPackages(pkgs []string) string
- func InitCondaEnv(ctx context.Context, imgPath string, pkgs []string, fakeroot bool, io IO) error
- func InstallPackages(ctx context.Context, imgPath string, pkgs []string, fakeroot bool, io IO) error
- func RemovePackages(ctx context.Context, imgPath string, pkgs []string, fakeroot bool, io IO) error
- func ResolveInitialCondaPackages(pkgs []string) []string
- func Run(ctx context.Context, options Options, ioStreams IO) error
- func RunPostInstall(ctx context.Context, imgPath, postCmd string, fakeroot bool, io IO) error
- func RunPrepared(ctx context.Context, plan *Plan, ioStreams IO) error
- func WithIO(ctx context.Context, ioStreams IO) context.Context
- type Diagnostic
- type IO
- type Options
- type Plan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCondaOverlay ¶ added in v1.5.0
func CreateCondaOverlay(ctx context.Context, opts *overlay.CreateOptions, pkgs []string, postInstallCmd string, fakeroot bool, io IO) error
CreateCondaOverlay creates a new user-owned ext3 overlay at opts.Path, initializes a conda environment with pkgs using mm-create, then moves and allocates the final file. This mirrors the `condatainer overlay create -- <pkgs>` flow.
postInstallCmd is run inside the overlay after conda init (empty = skip). fakeroot should be false for normal user-owned overlays.
func DescribeInitialCondaPackages ¶ added in v1.5.0
DescribeInitialCondaPackages returns user-facing text for the resolved initial package list.
func InitCondaEnv ¶ added in v1.5.0
InitCondaEnv creates a new conda environment inside imgPath using mm-create, then cleans the micromamba package cache to reduce overlay size. Use for initial environment creation on a fresh overlay. For adding packages to an existing environment, use InstallPackages.
func InstallPackages ¶ added in v1.5.0
func InstallPackages(ctx context.Context, imgPath string, pkgs []string, fakeroot bool, io IO) error
InstallPackages installs additional conda packages into an existing base environment inside imgPath using mm-install (respects overlay's .condarc channels).
func RemovePackages ¶ added in v1.5.0
RemovePackages removes conda packages from the base environment inside imgPath.
func ResolveInitialCondaPackages ¶ added in v1.5.0
ResolveInitialCondaPackages returns the package list used to initialize a fresh conda overlay. An empty list gets a tiny package so mm-create creates the environment instead of receiving no specs.
func Run ¶
Run executes a command inside a configured Apptainer container. It is silent by default; callers that want terminal or web output must pass explicit IO writers.
func RunPostInstall ¶ added in v1.5.0
RunPostInstall runs an arbitrary command inside imgPath after package installation.
func RunPrepared ¶ added in v1.5.0
RunPrepared executes a prepared plan with caller-owned IO streams.
Types ¶
type Diagnostic ¶ added in v1.5.0
Diagnostic is a non-fatal execution message returned to presentation layers.
type IO ¶ added in v1.5.0
IO contains caller-owned process streams. Nil streams are silent/no input.
func IOFromContext ¶ added in v1.5.0
IOFromContext returns caller-owned process streams from ctx, if present.
type Options ¶
type Options struct {
Overlays []string
Command []string
EnvSettings []string
BindPaths []string
ApptainerFlags []string // Flags to pass directly to apptainer (e.g., --home=/path, --nv)
Fakeroot bool
WritableImg bool
HidePrompt bool
BaseImage string
ApptainerBin string
// PassThruStdin is retained for callers that track whether stdin is expected.
// Actual stdin is owned by IO.Stdin so internal execution never assumes a terminal.
PassThruStdin bool
}
Options configures how CondaTainer executes a command inside an Apptainer container.
type Plan ¶ added in v1.5.0
type Plan struct {
Options Options
Setup *container.SetupResult
Fakeroot bool
EnvList []string
Diagnostics []Diagnostic
ExecOptions *apptainer.ExecOptions
OverlayLocks []*overlay.Lock
}
Plan is a prepared container execution. Call Close if RunPrepared is not used.