helpers

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDMCommand

func BuildDMCommand(profile *nnfv1alpha4.NnfDataMovementProfile, hostfile string, dm *nnfv1alpha4.NnfDataMovement, log logr.Logger) ([]string, error)

func CreateMpiHostfile

func CreateMpiHostfile(profile *nnfv1alpha4.NnfDataMovementProfile, hosts []string, dm *nnfv1alpha4.NnfDataMovement) (string, error)

Create an MPI hostfile given settings from a profile and user config from the dm

func ExtractIndexMountDir

func ExtractIndexMountDir(path, namespace string) (string, error)

Pull out the index mount directory from the path for the correct file systems that require it

func GetDestinationDir

func GetDestinationDir(profile *nnfv1alpha4.NnfDataMovementProfile, dm *nnfv1alpha4.NnfDataMovement, mpiHostfile string, log logr.Logger) (string, error)

Determine the directory path to create based on the source and destination. Returns the mkdir directory and error.

func GetStorageNodeNames

func GetStorageNodeNames(clnt client.Client, ctx context.Context, dm *nnfv1alpha4.NnfDataMovement) ([]string, error)

Retrieve the NNF Nodes that are the target of the data movement operation

func GetWorkerHostnames

func GetWorkerHostnames(clnt client.Client, ctx context.Context, nodes []string) ([]string, error)

func HandleIndexMountDir

func HandleIndexMountDir(profile *nnfv1alpha4.NnfDataMovementProfile, dm *nnfv1alpha4.NnfDataMovement, destDir, indexMount, mpiHostfile string, log logr.Logger) (string, error)

Given a destination directory and index mount directory, apply the necessary changes to the destination directory and the DM's destination path to account for index mount directories

func ParseDcpProgress

func ParseDcpProgress(line string, cmdStatus *nnfv1alpha4.NnfDataMovementCommandStatus) error

func ParseDcpStats

func ParseDcpStats(line string, cmdStatus *nnfv1alpha4.NnfDataMovementCommandStatus) error

Go through the list of dcp stat regexes, parse them, and put them in their appropriate place in cmdStatus

func PeekMpiHostfile

func PeekMpiHostfile(hostfile string) string

Get the first line of the hostfile for verification

func PrepareDestination

func PrepareDestination(clnt client.Client, ctx context.Context, profile *nnfv1alpha4.NnfDataMovementProfile, dm *nnfv1alpha4.NnfDataMovement, mpiHostfile string, log logr.Logger) error

func ProgressCollectionEnabled

func ProgressCollectionEnabled(collectInterval time.Duration) bool

func WriteMpiHostfile

func WriteMpiHostfile(dmName string, hosts []string, slots, maxSlots int) (string, error)

Create the MPI Hostfile given a list of hosts, slots, and maxSlots. A temporary directory is created based on the DM Name. The hostfile is created inside of this directory. A value of 0 for slots or maxSlots will not use it in the hostfile.

Types

type DataMovementCancelContext

type DataMovementCancelContext struct {
	Ctx    context.Context
	Cancel context.CancelFunc
}

Keep track of the context and its cancel function so that we can track and cancel data movement operations in progress

Jump to

Keyboard shortcuts

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