instance

package
v4.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SingSubDir represents directory where Singularity instance files are stored
	SingSubDir = "sing"
	// LogSubDir represents directory where Singularity instance log files are stored
	LogSubDir = "logs"
)
View Source
const (
	// ProgPrefix is the prefix used by a singularity instance process
	ProgPrefix = "Singularity instance"
)

Variables

This section is empty.

Functions

func CheckName

func CheckName(name string) error

CheckName checks if name is a valid instance name

func ExtractName

func ExtractName(name string) string

ExtractName extracts instance name from an instance:// URI

func GetDir

func GetDir(name string, subDir string) (string, error)

GetDir returns directory where instances file will be stored

func GetLogFilePaths

func GetLogFilePaths(name string, subDir string) (string, string, error)

GetLogFilePaths returns the paths of log files containing .err, .out streams, respectively

func ProcName

func ProcName(name string, username string) (string, error)

ProcName returns process name based on instance name and username

func SetLogFile

func SetLogFile(name string, uid int, subDir string) (*os.File, *os.File, error)

SetLogFile replaces stdout/stderr streams and redirect content to log file

Types

type File

type File struct {
	Path       string `json:"-"`
	Pid        int    `json:"pid"`
	PPid       int    `json:"ppid"`
	Name       string `json:"name"`
	User       string `json:"user"`
	Image      string `json:"image"`
	Config     []byte `json:"config"`
	UserNs     bool   `json:"userns"`
	Cgroup     bool   `json:"cgroup"`
	IP         string `json:"ip"`
	LogErrPath string `json:"logErrPath"`
	LogOutPath string `json:"logOutPath"`
}

File represents an instance file storing instance information

func Add

func Add(name string, subDir string) (*File, error)

Add creates an instance file for a named instance in a privileged or unprivileged path

func Get

func Get(name string, subDir string) (*File, error)

Get returns the instance file corresponding to instance name

func List

func List(username string, name string, subDir string) ([]*File, error)

List returns instance files matching username and/or name pattern

func (*File) Delete

func (i *File) Delete() error

Delete deletes instance file

func (*File) Update

func (i *File) Update() error

Update stores instance information in associated instance file

Jump to

Keyboard shortcuts

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