api

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]PartitionResources

Config is a red-box configuration for each partition available.

type Feature

type Feature struct {
	Name     string `yaml:"name"`
	Version  string `yaml:"version"`
	Quantity int64  `yaml:"quantity"`
}

Feature represents slurm partition feature.

type PartitionResources

type PartitionResources struct {
	AutoNodes      bool `yaml:"auto_nodes"`
	AutoCPUPerNode bool `yaml:"auto_cpu_per_node"`
	AutoMemPerNode bool `yaml:"auto_mem_per_node"`
	AutoWallTime   bool `yaml:"auto_wall_time"`

	Nodes      int64         `yaml:"nodes"`
	CPUPerNode int64         `yaml:"cpu_per_node"`
	MemPerNode int64         `yaml:"mem_per_node"`
	WallTime   time.Duration `yaml:"wall_time"`

	AdditionalFeatures []Feature `yaml:"additional_features"`
}

PartitionResources configure how red-box will see slurm partition resources. In auto mode red-box will attempt to query partition resources from slurm, but administrator can set up them manually.

type Slurm

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

Slurm implements WorkloadManagerServer.

func NewSlurm

func NewSlurm(c *slurm.Client, cfg Config) *Slurm

NewSlurm creates a new instance of Slurm.

func (*Slurm) CancelJob

func (s *Slurm) CancelJob(ctx context.Context, req *api.CancelJobRequest) (*api.CancelJobResponse, error)

CancelJob cancels job.

func (*Slurm) JobInfo

func (s *Slurm) JobInfo(ctx context.Context, req *api.JobInfoRequest) (*api.JobInfoResponse, error)

JobInfo returns information about a job from 'scontrol show jobid'. Safe to call before job finished. After it could return an error.

func (*Slurm) JobSteps

func (s *Slurm) JobSteps(ctx context.Context, req *api.JobStepsRequest) (*api.JobStepsResponse, error)

JobSteps returns information about job steps from 'sacct'. Safe to call after job started. Before it could return an error.

func (*Slurm) OpenFile

OpenFile opens requested file and return chunks with bytes.

func (*Slurm) Partitions

Partitions returns partition names.

func (*Slurm) Resources

func (s *Slurm) Resources(_ context.Context, req *api.ResourcesRequest) (*api.ResourcesResponse, error)

Resources return available resources on slurm cluster in a requested partition.

func (*Slurm) SubmitJob

func (s *Slurm) SubmitJob(ctx context.Context, req *api.SubmitJobRequest) (*api.SubmitJobResponse, error)

SubmitJob submits job and returns id of it in case of success.

func (*Slurm) TailFile

func (s *Slurm) TailFile(req api.WorkloadManager_TailFileServer) error

TailFile tails a file till close requested. To start receiving file bytes client should send a request with file path and action start, to stop client should send a request with action readToEndAndClose (file path is not required) and after reaching end method will send EOF error.

Jump to

Keyboard shortcuts

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