request

package
v0.0.0-...-598a827 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSCredential

type AWSCredential struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_access_key"`
}

JWTCredential is used to carry a Java Web Token format streing to the runner which in turn will use the token to both read and write data to the specified S3 compliant storage platform defined in the artifact within which it is contained.

type Artifact

type Artifact struct {
	Bucket      string      `json:"bucket"`
	Key         string      `json:"key"`
	Hash        string      `json:"hash,omitempty"`
	Local       string      `json:"local,omitempty"`
	Mutable     bool        `json:"mutable"`
	Unpack      bool        `json:"unpack"`
	Qualified   string      `json:"qualified"`
	Credentials Credentials `json:"credentials"`
}

Artifact is a marshalled component of a StudioML experiment definition that is used to encapsulate files and other external data sources that the runner retrieve and/or upload as the experiment progresses

func (*Artifact) Clone

func (a *Artifact) Clone() (b *Artifact)

Clone is a full on duplication of the original artifact

type Config

type Config struct {
	Cloud                  interface{}       `json:"cloud"`
	Database               Database          `json:"database"`
	SaveWorkspaceFrequency string            `json:"saveWorkspaceFrequency"`
	Lifetime               string            `json:"experimentLifetime"`
	Verbose                string            `json:"verbose"`
	Env                    map[string]string `json:"env"`
	Pip                    []string          `json:"pip"`
	Runner                 RunnerCustom      `json:"runner"`
}

Config is a marshalled data structure used with studioml requests for defining the configuration of an environment used to run jobs

type Credentials

type Credentials struct {
	Plain *PlainCredential `json:"plain"`
	JWT   *JWTCredential   `json:"jwt"`
	AWS   *AWSCredential   `json:"aws"`
}

Credentials contains one of the supported credential types and is used to access the artifact storage platform.

type Database

type Database struct {
	ApiKey            string      `json:"apiKey"`
	AuthDomain        string      `json:"authDomain"`
	DatabaseURL       string      `json:"databaseURL"`
	MessagingSenderId int64       `json:"messagingSenderId"`
	ProjectId         string      `json:"projectId"`
	StorageBucket     string      `json:"storageBucket"`
	Type              string      `json:"type"`
	UseEmailAuth      bool        `json:"use_email_auth"`
	Credentials       Credentials `json:"credentials"`
}

Database marshalls the studioML database specification for experiment meta data

type Experiment

type Experiment struct {
	Args               []string            `json:"args"`
	Artifacts          map[string]Artifact `json:"artifacts"`
	Filename           string              `json:"filename"`
	Git                interface{}         `json:"git"`
	Info               Info                `json:"info"`
	Key                string              `json:"key"`
	Metric             interface{}         `json:"metric"`
	Project            interface{}         `json:"project"`
	Pythonenv          []string            `json:"pythonenv"`
	PythonVer          string              `json:"pythonver"`
	Resource           server.Resource     `json:"resources_needed"`
	Status             string              `json:"status"`
	TimeAdded          float64             `json:"time_added"`
	MaxDuration        string              `json:"max_duration"`
	TimeFinished       interface{}         `json:"time_finished"`
	TimeLastCheckpoint interface{}         `json:"time_last_checkpoint"`
	TimeStarted        interface{}         `json:"time_started"`
}

Experiment marshalls the studioML experiment meta data

type Info

type Info struct {
}

Info is a marshalled item from the studioML experiment definition that is ignored by the go runner and so is stubbed out

type JWTCredential

type JWTCredential struct {
	Token string `json:"token"`
}

JWTCredential is used to carry a Java Web Token format string to the runner which in turn will use the token to both read and write data to the specified storage platform defined in the artifact within which it is contained.

type PlainCredential

type PlainCredential struct {
	User     string `json:"user"`
	Password string `json:"password"`
}

PlainCredential is used to carry a plain text user and password combination to the runner which in turn will use the same to both read and write data to the specified storage platform defined in the artifact within which it is contained. FTP is an example where a user and password will be specified.

type Request

type Request struct {
	Config     Config     `json:"config"`
	Experiment Experiment `json:"experiment"`
}

Request marshalls the requests made by studioML under which all of the other meta data can be found

func UnmarshalRequest

func UnmarshalRequest(data []byte) (r *Request, err kv.Error)

UnmarshalRequest takes an encoded StudioML request and extracts it into go data structures used by the go runner

func (*Request) Marshal

func (r *Request) Marshal() (buffer []byte, err kv.Error)

Marshal takes the go data structure used to define a StudioML experiment request and serializes it as json to the byte array

type RunnerCustom

type RunnerCustom struct {
	SlackDest string `json:"slack_destination"`
}

RunnerCustom defines a custom type of resource used by the go runner to implement a slack notification mechanism

Jump to

Keyboard shortcuts

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