rescale

package
v0.0.0-...-e371549 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationSingularity = "user_included_singularity_container"
)

Application codes

Variables

This section is empty.

Functions

func CreateJob

func CreateJob(ctx context.Context, token string, input JobInput) (*string, error)

CreateJob creates a new job

func Delete

func Delete(ctx context.Context, token, jobID string) error

Delete the specified job

func EnableCache

func EnableCache(enabled bool)

EnableCache sets cache availability

func SetEndpoint

func SetEndpoint(endpoint string)

SetEndpoint sets Rescale API endpoint

func Stop

func Stop(ctx context.Context, token, jobID string) error

Stop the specified job

func Submit

func Submit(ctx context.Context, token, jobID string) error

Submit submits a job

Types

type Application

type Application struct {
	Code                string               `json:"code"`
	Versions            []ApplicationVersion `json:"versions"`
	HasRescaleLicense   bool                 `json:"hasRescaleLicense"`
	HasOnDemandLicense  bool                 `json:"hasOnDemandLicense"`
	HasShortTermLicense bool                 `json:"hasShortTermLicense"`
	LicenseSettings     []ApplicationLicense `json:"licenseSettings"`
}

Application represents Rescale supported application

func Analyses

func Analyses(ctx context.Context, token, code string) (*Application, error)

nolint:misspell Analyses returns supported applications

type ApplicationLicense

type ApplicationLicense struct {
	Name                 string `json:"name"`
	Required             bool   `json:"required"`
	LicenseType          string `json:"licenseType"`
	Label                string `json:"label"`
	IsServer             bool   `json:"isServer"`
	CanCheckAvailability bool   `json:"canCheckAvailability"`
}

ApplicationLicense represents license settings of an application

type ApplicationVersion

type ApplicationVersion struct {
	ID              string   `json:"id"`
	Version         string   `json:"version"`
	VersionCode     string   `json:"versionCode"`
	Type            string   `json:"type"`
	OS              []string `json:"oses"`
	CoreTypes       []string `json:"allowedCoreTypes"`
	MustBeRequested bool     `json:"mustBeRequested"`
}

ApplicationVersion represents a version of an application

type Checksum

type Checksum struct {
	Func string `json:"hashFunction"`
	Hash string `json:"fileHash"`
}

Checksum defines checksum of a file

type CoreType

type CoreType struct {
	Code            string  `json:"code"`
	Name            string  `json:"name"`
	IsDefault       bool    `json:"isDefault"`
	MustBeRequested bool    `json:"mustBeRequested"`
	ProcessorInfo   string  `json:"processorInfo"`
	Cores           []int   `json:"cores"`
	GPUCounts       []int   `json:"gpuCounts"`
	Compute         *string `json:"compute"`
	BaseClockSpeed  *string `json:"baseClockSpeed"`
	IO              string  `json:"io"`
	Storage         int     `json:"storage"`
	Memory          int     `json:"memory"`
	DisplayOrder    int     `json:"displayOrder"`
}

CoreType represents Rescale Compute environments

func CoreTypes

func CoreTypes(ctx context.Context, token string, page, pageSize *int64) ([]*CoreType, error)

CoreTypes returns supported core types

type File

type File struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Path        string      `json:"path"`
	TypeID      int64       `json:"typeId"`
	Size        int64       `json:"decryptedSize"`
	Checksums   []*Checksum `json:"fileChecksums"`
	UploadedAt  *time.Time  `json:"dateUploaded"`
	DownloadURL string      `json:"downloadUrl"`
	Owner       string      `json:"owner"`
}

File defines the file information

type Files

type Files struct {
	Count   int     `json:"count"`
	Results []*File `json:"results"`
}

Files defines the files meta data

func OutputFiles

func OutputFiles(ctx context.Context, token, jobID string) (*Files, error)

outputFiles returns output files information

type Job

type Job struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	JobAnalyses      []JobInputAnalyse `json:"jobanalyses"`
	JobVariables     []string          `json:"jobvariables"`
	IsLowPriority    bool              `json:"isLowPriority"`
	IsTemplateDryRun bool              `json:"isTemplateDryRun"`
}

Job defines the fields of a Rescale job

type JobAnalyse

type JobAnalyse struct {
	Code    string `json:"code"`
	Version string `json:"version"`
}

JobAnalyse defines Rescale job software

type JobCoreType

type JobCoreType struct {
	Code string `json:"code"`
}

JobCoreType defines Rescale job core type

type JobHardware

type JobHardware struct {
	Type         string      `json:"type"`
	CoreType     JobCoreType `json:"coreType"`
	Slots        int         `json:"slots"`
	CoresPerSlot int         `json:"coresPerSlot"`
	WallTime     int         `json:"walltime"`
}

JobHardware defines Rescale job hardware

type JobInput

type JobInput struct {
	Name             string            `json:"name"`
	JobAnalyses      []JobInputAnalyse `json:"jobanalyses"`
	JobVariables     []string          `json:"jobvariables"`
	IsLowPriority    bool              `json:"isLowPriority"`
	IsTemplateDryRun bool              `json:"isTemplateDryRun"`
}

JobInput defines Rescale job conditions

type JobInputAnalyse

type JobInputAnalyse struct {
	Command    string         `json:"command"`
	InputFiles []JobInputFile `json:"inputFiles"`
	Analysis   JobAnalyse     `json:"analysis"`
	Hardware   JobHardware    `json:"hardware"`
}

JobInputAnalyse defines Rescale job infrastructure

type JobInputFile

type JobInputFile struct {
	ID         string `json:"id"`
	Decompress bool   `json:"decompress"`
}

JobInputFile defines files to be used in the job

type JobStatus

type JobStatus struct {
	ID           string         `json:"id"`
	JobID        string         `json:"jobId"`
	Status       JobStatusValue `json:"status"`
	StatusReason *string        `json:"statusReason"`
	StatusDate   *time.Time     `json:"statusDate"`
}

JobStatus defines the status of a Rescale job

func Status

func Status(ctx context.Context, token, jobID string) (*JobStatus, error)

Status retrieve the job status

type JobStatusValue

type JobStatusValue string

JobStatusValue represent job status

const (
	JobStatusUnknown   JobStatusValue = "Unknown"
	JobStatusPending   JobStatusValue = "Pending"
	JobStatusQueued    JobStatusValue = "Queued"
	JobStatusStarted   JobStatusValue = "Started"
	JobStatusValidated JobStatusValue = "Validated"
	JobStatusExecuting JobStatusValue = "Executing"
	JobStatusCompleted JobStatusValue = "Completed"
	JobStatusStopping  JobStatusValue = "Stopping"
	JobStatusWait4Cls  JobStatusValue = "Waiting for Cluster"
	JobStatusForceStop JobStatusValue = "Force Stop"
	JobStatusWaitQueue JobStatusValue = "Waiting for Queue"
)

type JobStatuses

type JobStatuses struct {
	Count   int          `json:"count"`
	Results []*JobStatus `json:"results"`
}

JobStatuses defines the status of a Rescale job

func (*JobStatuses) Sort

func (job *JobStatuses) Sort()

type Log

type Log struct {
	Time time.Time
	Log  string
}

Log the log structure

func Logs

func Logs(ctx context.Context, token, jobID string) ([]*Log, error)

Logs returns output of a job

type UploadedFile

type UploadedFile struct {
	ID          string              `json:"id"`
	Name        string              `json:"name"`
	FilePath    string              `json:"path"`
	DownloadURL string              `json:"downloadUrl"`
	MD5         string              `json:"md5"`
	Owner       string              `json:"owner"`
	Storage     UploadedFileStorage `json:"storage"`
}

UploadedFile represents an uploaded file

func Upload

func Upload(ctx context.Context, token, path string) (*UploadedFile, error)

Upload uploads specified files

type UploadedFileStorage

type UploadedFileStorage struct {
	ID string `json:"id"`
}

UploadedFileStorage represents a storage which contains the uploaded file

Jump to

Keyboard shortcuts

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