Documentation
¶
Index ¶
- Constants
- func BatchJobToJobInfo(job *batchpb.Job) (drmaa2interface.JobInfo, error)
- func ConvertJobState(job *batchpb.Job) (drmaa2interface.JobState, string, error)
- func ConvertJobTemplateToJobRequest(session, project, location string, jt drmaa2interface.JobTemplate) (batchpb.CreateJobRequest, error)
- func CreateMissingStageOutBuckets(project string, stageOutFiles map[string]string) error
- func CreateRunnables(barriers bool, prolog string) []*batchpb.Runnable
- func GetAcceleratorsExtension(jt drmaa2interface.JobTemplate) (string, int64, bool)
- func GetDockerOptionsExtension(jt drmaa2interface.JobTemplate) (string, bool)
- func GetMachineEpilogExtension(jt drmaa2interface.JobTemplate) (string, bool)
- func GetMachinePrologExtension(jt drmaa2interface.JobTemplate) (string, bool)
- func GetSpotExtension(jt drmaa2interface.JobTemplate) (bool, bool)
- func GetStorageClient() (*storage.Client, error)
- func GetTasksPerNodeExtension(jt drmaa2interface.JobTemplate) (int64, bool)
- func IsInDRMAA2Session(client *batch.Client, session string, jobID string) bool
- func IsInJobSession(session string, job *batchpb.Job) bool
- func MountBucket(jobRequest *batchpb.CreateJobRequest, execPosition int, ...) *batchpb.CreateJobRequest
- func NewAllocator() *allocator
- func SetAcceleratorsExtension(jt drmaa2interface.JobTemplate, count int64, accelerator string) drmaa2interface.JobTemplate
- func SetDockerOptionsExtension(jt drmaa2interface.JobTemplate, dockerOptions string) drmaa2interface.JobTemplate
- func SetMachineEpilogExtension(jt drmaa2interface.JobTemplate, epilog string) drmaa2interface.JobTemplate
- func SetMachinePrologExtension(jt drmaa2interface.JobTemplate, prolog string) drmaa2interface.JobTemplate
- func SetSpotExtension(jt drmaa2interface.JobTemplate, isSpot bool) drmaa2interface.JobTemplate
- func SetTasksPerNodeExtension(jt drmaa2interface.JobTemplate, count int64) drmaa2interface.JobTemplate
- func ValidateJobTemplate(jt drmaa2interface.JobTemplate) (drmaa2interface.JobTemplate, error)
- type GCPBatchTracker
- func (t *GCPBatchTracker) AddArrayJob(jt drmaa2interface.JobTemplate, begin int, end int, step int, maxParallel int) (string, error)
- func (t *GCPBatchTracker) AddJob(jt drmaa2interface.JobTemplate) (string, error)
- func (t *GCPBatchTracker) CloseMonitoringSession(name string) error
- func (t *GCPBatchTracker) DeleteJob(jobID string) error
- func (t *GCPBatchTracker) GetAllJobIDs(filter *drmaa2interface.JobInfo) ([]string, error)
- func (t *GCPBatchTracker) GetAllMachines(filter []string) ([]drmaa2interface.Machine, error)
- func (t *GCPBatchTracker) GetAllQueueNames(filter []string) ([]string, error)
- func (t *GCPBatchTracker) JobControl(jobID string, action string) error
- func (t *GCPBatchTracker) JobInfo(jobID string) (drmaa2interface.JobInfo, error)
- func (t *GCPBatchTracker) JobInfoFromMonitor(jobID string) (drmaa2interface.JobInfo, error)
- func (t *GCPBatchTracker) JobState(jobID string) (drmaa2interface.JobState, string, error)
- func (t *GCPBatchTracker) ListArrayJobs(arrayjobID string) ([]string, error)
- func (t *GCPBatchTracker) ListJobCategories() ([]string, error)
- func (t *GCPBatchTracker) ListJobs() ([]string, error)
- func (t *GCPBatchTracker) OpenMonitoringSession(name string) error
- func (t *GCPBatchTracker) Wait(jobID string, timeout time.Duration, state ...drmaa2interface.JobState) error
- type GoogleBatchTrackerParams
Constants ¶
const ( // job categories (otherwise it is a container image) JobCategoryScriptPath = "$scriptpath$" // treats RemoteCommand as path to script and ignores args JobCategoryScript = "$script$" // treats RemoteCommand as script and ignores args )
const ( ExtensionProlog = "prolog" ExtensionEpilog = "epilog" ExtensionSpot = "spot" ExtensionAccelerators = "accelerators" ExtensionTasksPerNode = "tasks_per_node" ExtensionDockerOptions = "docker_options" )
Variables ¶
This section is empty.
Functions ¶
func BatchJobToJobInfo ¶
func BatchJobToJobInfo(job *batchpb.Job) (drmaa2interface.JobInfo, error)
func ConvertJobState ¶
func ConvertJobTemplateToJobRequest ¶
func ConvertJobTemplateToJobRequest(session, project, location string, jt drmaa2interface.JobTemplate) (batchpb.CreateJobRequest, error)
func GetAcceleratorsExtension ¶
func GetAcceleratorsExtension(jt drmaa2interface.JobTemplate) (string, int64, bool)
func GetDockerOptionsExtension ¶
func GetDockerOptionsExtension(jt drmaa2interface.JobTemplate) (string, bool)
func GetMachineEpilogExtension ¶
func GetMachineEpilogExtension(jt drmaa2interface.JobTemplate) (string, bool)
func GetMachinePrologExtension ¶
func GetMachinePrologExtension(jt drmaa2interface.JobTemplate) (string, bool)
func GetSpotExtension ¶
func GetSpotExtension(jt drmaa2interface.JobTemplate) (bool, bool)
func GetStorageClient ¶
func GetTasksPerNodeExtension ¶
func GetTasksPerNodeExtension(jt drmaa2interface.JobTemplate) (int64, bool)
func IsInDRMAA2Session ¶
func MountBucket ¶
func MountBucket(jobRequest *batchpb.CreateJobRequest, execPosition int, destination, source string) *batchpb.CreateJobRequest
func NewAllocator ¶
func NewAllocator() *allocator
func SetAcceleratorsExtension ¶
func SetAcceleratorsExtension(jt drmaa2interface.JobTemplate, count int64, accelerator string) drmaa2interface.JobTemplate
func SetDockerOptionsExtension ¶
func SetDockerOptionsExtension(jt drmaa2interface.JobTemplate, dockerOptions string) drmaa2interface.JobTemplate
func SetMachineEpilogExtension ¶
func SetMachineEpilogExtension(jt drmaa2interface.JobTemplate, epilog string) drmaa2interface.JobTemplate
func SetMachinePrologExtension ¶
func SetMachinePrologExtension(jt drmaa2interface.JobTemplate, prolog string) drmaa2interface.JobTemplate
func SetSpotExtension ¶
func SetSpotExtension(jt drmaa2interface.JobTemplate, isSpot bool) drmaa2interface.JobTemplate
func SetTasksPerNodeExtension ¶
func SetTasksPerNodeExtension(jt drmaa2interface.JobTemplate, count int64) drmaa2interface.JobTemplate
func ValidateJobTemplate ¶
func ValidateJobTemplate(jt drmaa2interface.JobTemplate) (drmaa2interface.JobTemplate, error)
Types ¶
type GCPBatchTracker ¶
type GCPBatchTracker struct {
// contains filtered or unexported fields
}
GCPBatchTracker implements the JobTracker interface so that it can be used as backend in drmaa2os project.
func NewGCPBatchTracker ¶
func NewGCPBatchTracker(drmaa2session string, project, location string) (*GCPBatchTracker, error)
func (*GCPBatchTracker) AddArrayJob ¶
func (t *GCPBatchTracker) AddArrayJob(jt drmaa2interface.JobTemplate, begin int, end int, step int, maxParallel int) (string, error)
AddArrayJob makes a mass submission of jobs defined by the same job template. Many HPC workload manager support job arrays for submitting 10s of thousands of similar jobs by one call. The additional parameters define how many jobs are submitted by defining a TASK_ID range. Begin is the first task ID (like 1), end is the last task ID (like 10), step is a positive integeger which defines the increments from one task ID to the next task ID (like 1). maxParallel is an arguments representating an optional functionality which instructs the backend to limit maxParallel tasks of this job arary to run in parallel. Note, that jobs use the TASK_ID environment variable to identifiy which task they are and determine that way what to do (like which data set is accessed).
func (*GCPBatchTracker) AddJob ¶
func (t *GCPBatchTracker) AddJob(jt drmaa2interface.JobTemplate) (string, error)
AddJob typically submits or starts a new job at the backend. The function returns the unique job ID or an error if job submission (or starting of the job in case there is no queueing system) has failed.
func (*GCPBatchTracker) CloseMonitoringSession ¶
func (t *GCPBatchTracker) CloseMonitoringSession(name string) error
func (*GCPBatchTracker) DeleteJob ¶
func (t *GCPBatchTracker) DeleteJob(jobID string) error
DeleteJob removes a job from a potential internal database. It does not stop a job. A job must be in an endstate (terminated, failed) in order to call DeleteJob. In case of an error or the job is not in an end state error must be returned. If the backend does not support cleaning up resources for a finished job nil should be returned.
func (*GCPBatchTracker) GetAllJobIDs ¶
func (t *GCPBatchTracker) GetAllJobIDs(filter *drmaa2interface.JobInfo) ([]string, error)
func (*GCPBatchTracker) GetAllMachines ¶
func (t *GCPBatchTracker) GetAllMachines(filter []string) ([]drmaa2interface.Machine, error)
func (*GCPBatchTracker) GetAllQueueNames ¶
func (t *GCPBatchTracker) GetAllQueueNames(filter []string) ([]string, error)
func (*GCPBatchTracker) JobControl ¶
func (t *GCPBatchTracker) JobControl(jobID string, action string) error
JobControl sends a request to the backend to either "terminate", "suspend", "resume", "hold", or "release" a job. The strings are fixed and are defined by the JobControl constants. This could change in the future to be limited only to constants representing the actions. When the request is not accepted by the system the function must return an error.
func (*GCPBatchTracker) JobInfo ¶
func (t *GCPBatchTracker) JobInfo(jobID string) (drmaa2interface.JobInfo, error)
JobInfo returns the job status of a job in form of a JobInfo struct or an error.
func (*GCPBatchTracker) JobInfoFromMonitor ¶
func (t *GCPBatchTracker) JobInfoFromMonitor(jobID string) (drmaa2interface.JobInfo, error)
JobInfoFromMonitor might collect job state and job info in a different way as a JobSession with persistent storage does
func (*GCPBatchTracker) JobState ¶
func (t *GCPBatchTracker) JobState(jobID string) (drmaa2interface.JobState, string, error)
JobState returns the DRMAA2 state and substate (free form string) of the job.
func (*GCPBatchTracker) ListArrayJobs ¶
func (t *GCPBatchTracker) ListArrayJobs(arrayjobID string) ([]string, error)
ListArrayJobs returns all job IDs an job array ID (or array job ID) represents or an error.
func (*GCPBatchTracker) ListJobCategories ¶
func (t *GCPBatchTracker) ListJobCategories() ([]string, error)
ListJobCategories returns a list of job categories which can be used in the JobCategory field of the job template. The list is informational. An example is returning a list of supported container images. AddJob() and AddArrayJob() processes a JobTemplate and hence also the JobCategory field.
func (*GCPBatchTracker) ListJobs ¶
func (t *GCPBatchTracker) ListJobs() ([]string, error)
ListJobs returns all visible job IDs or an error.
func (*GCPBatchTracker) OpenMonitoringSession ¶
func (t *GCPBatchTracker) OpenMonitoringSession(name string) error
func (*GCPBatchTracker) Wait ¶
func (t *GCPBatchTracker) Wait(jobID string, timeout time.Duration, state ...drmaa2interface.JobState) error
Wait blocks until the job is either in one of the given states, the max. waiting time (specified by timeout) is reached or an other internal error occured (like job was not found). In case of a timeout also an error must be returned.
type GoogleBatchTrackerParams ¶
GoogleBatchTrackerParams provide parameters which can be passed to the SessionManager in order to pass things like Google project or region into the job tracker. It needs to be that complicated in order to be used but not tightly integrated with the SessionManager of the DRMAA2OS project, so that not all depenedencies have to be compiled in.