endpoint

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

This package sets the paths that will be used for control files over Lustre.

Documentation

Index

Constants

View Source
const (
	PodGlobalDirectoryPermissions = os.FileMode(0o777)
	PodSpecJsonFilePermissions    = os.FileMode(0o600)
	ContainerJobPermissions       = os.FileMode(0o777)
)
View Source
const (
	// ExtensionCRD describes the file where HPK will write the pod definition.
	ExtensionCRD = ".crd"

	// ExtensionStdout describes the file where the sbatch script will write its stdout.
	ExtensionStdout = ".stdout"

	// ExtensionStderr describes the file where the sbatch script will write its stderr.
	ExtensionStderr = ".stderr"
)

Pod-Related Extensions

View Source
const (
	// ExtensionEnvironment describes the file  where the environment variables for the container are held.
	ExtensionEnvironment = ".env"

	// ExtensionLogs describes the file  where the sbatch script will write its logs.
	ExtensionLogs = ".logs"
)

Container-Related Extensions

Variables

This section is empty.

Functions

func IsEmpty

func IsEmpty(name string) (bool, error)

IsEmpty return true of the path is empty.

Types

type ContainerPath

type ContainerPath struct {
	// contains filtered or unexported fields
}

func (ContainerPath) EnvFilePath

func (c ContainerPath) EnvFilePath() string

func (ContainerPath) ExitCodePath

func (c ContainerPath) ExitCodePath() string

func (ContainerPath) IDPath

func (c ContainerPath) IDPath() string

func (ContainerPath) LogsPath

func (c ContainerPath) LogsPath() string

type ControlFileType

type ControlFileType = string
const (
	// ExtensionSysError describes the file where the sbatch will describe its failure.
	ExtensionSysError ControlFileType = ".syserror"

	// ExtensionIP describes the file where the sbatch script will write its ip.
	ExtensionIP ControlFileType = ".ip"

	// ExtensionExitCode describes the file where the sbatch script will write its exit code.
	ExtensionExitCode ControlFileType = ".exitCode"

	// ExtensionJobID describes the file  where the sbatch script will write its job id.
	ExtensionJobID ControlFileType = ".jobid"
)

Control File (Written by the Sbatch script)

type HPKPath

type HPKPath string

func HPK

func HPK(rootPath string) HPKPath

func (HPKPath) CorruptedDir

func (p HPKPath) CorruptedDir() string

func (HPKPath) ImageDir

func (p HPKPath) ImageDir() string

func (HPKPath) ParseControlFilePath

func (p HPKPath) ParseControlFilePath(absPath string) (podKey types.NamespacedName, fileName string, invalid bool)

ParseControlFilePath parses the path according to the expected HPK format, and returns the corresponding fields. Validated through: https://regex101.com/r/olnlMx/1

func (HPKPath) Pod

func (p HPKPath) Pod(podRef client.ObjectKey) PodPath

func (HPKPath) String

func (p HPKPath) String() string

func (HPKPath) WalkPodDirectories

func (p HPKPath) WalkPodDirectories(f WalkPodFunc) error

type PodPath

type PodPath string

func (PodPath) CgroupFilePath

func (p PodPath) CgroupFilePath() string

CgroupFilePath .hpk/namespace/podName/.virtualenv/cgroup.toml

func (PodPath) ConstructorFilePath

func (p PodPath) ConstructorFilePath() string

ConstructorFilePath .hpk/namespace/podName/.virtualenv/constructor.sh

func (PodPath) Container

func (p PodPath) Container(containerName string) ContainerPath

func (PodPath) ControlFileDir

func (p PodPath) ControlFileDir() string

func (PodPath) EncodedJSONPath

func (p PodPath) EncodedJSONPath() string

EncodedJSONPath .hpk/namespace/podName/.virtualenv/pod.crd

func (PodPath) IPAddressPath

func (p PodPath) IPAddressPath() string

IPAddressPath points $HPK/<namespace>/<podName>/controlfile/.ip

func (PodPath) JobDir

func (p PodPath) JobDir() string

JobDir .hpk/namespace/podName/.virtualenv

func (PodPath) LogDir

func (p PodPath) LogDir() string

func (PodPath) PodEnvironmentIsOK

func (p PodPath) PodEnvironmentIsOK() (bool, string)

PodEnvironmentIsOK checks if the pod structure is ok, and if it is not, it returns an indiciate reason

func (PodPath) StderrPath

func (p PodPath) StderrPath() string

StderrPath $HPK/<namespace>/<podName>/logs/.stderr

func (PodPath) StdoutPath

func (p PodPath) StdoutPath() string

StdoutPath $HPK/<namespace>/<podName>/logs/.stdout

func (PodPath) String

func (p PodPath) String() string

func (PodPath) SubmitJobPath

func (p PodPath) SubmitJobPath() string

SubmitJobPath .hpk/namespace/podName/.virtualenv/submit.sh

func (PodPath) SysErrorFilePath

func (p PodPath) SysErrorFilePath() string

SysErrorFilePath points to $HPK/<namespace>/<podName>/controlfile/.syserror

func (PodPath) VolumeDir

func (p PodPath) VolumeDir() string

type WalkPodFunc

type WalkPodFunc func(path PodPath) error

Jump to

Keyboard shortcuts

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