models

package
v0.0.0-...-de2e23a Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Index       int           `json:"index" bson:"index"`
	InputPorts  []interface{} `json:"inputPorts" bson:"inputPorts"`
	OutputPorts []interface{} `json:"outputPorts" bson:"outputPorts"`
	Name        string        `json:"name" bson:"name"`
	X           float32       `json:"x" bson:"x"`
	Y           float32       `json:"y" bson:"y"`
	Payload     struct {
		Cwl              interface{}            `json:"cwl" bson:"cwl"`
		EndpointLocation string                 `json:"endpointLocation" bson:"endpointLocation"`
		ID               int                    `json:"id" bson:"id"`
		Kind             string                 `json:"kind" bson:"kind"`
		Parameters       map[string]interface{} `json:"parameters" bson:"parameters"`
		ProviderType     string                 `json:"providerType" bson:"providerType"`
		ComputeProvider  ComputerProvider       `json:"computeProvider" bson:"computeProvider"`
		S3Provider       ComputerProvider       `json:"s3Provider" bson:"s3Provider"`
		CostLimitBlock   float32                `json:"costLimitBlock" bson:"costLimitBlock"`
		ClusterName      string                 `json:"clusterName" bson:"clusterName"`
	} `json:"payload" bson:"payload"`
}

type ComputerProvider

type ComputerProvider struct {
	ProviderId        string      `json:"providerId" bson:"_id,omitempty"`
	ProviderType      string      `json:"providerType" bson:"providerType,omitempty"`
	Description       string      `json:"description"  bson:"description,omitempty"`
	OriginClusterName string      `json:"originClusterName"  bson:"originClusterName,omitempty"`
	EndpointLocation  string      `json:"endpointLocation"  bson:"endpointLocation,omitempty"`
	Name              string      `json:"name"  bson:"name,omitempty"`
	WorkflowStructure interface{} `json:"workflowStructure"  bson:"workflowStructure,omitempty"`
	IsLocal           bool        `json:"isLocal"  bson:"isLocal,omitempty"`
	Metadata          interface{} `json:"metadata" bson:"metadata"`
	CostLimitCluster  float32     `json:"costLimitCluster" bson:"costLimitCluster,omitempty"`
}

type Execution

type Execution struct {
	ID           primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Namespace    string             `json:"namespace" bson:"namespace"`
	ArgoName     string             `json:"argoName" bson:"argoName"`
	WorkflowName string             `json:"workflowName" bson:"workflowName"`
	Status       string             `json:"status" bson:"status"`
	WorkflowID   primitive.ObjectID `json:"workflowId" bson:"workflowId"`
	StartedAt    string             `json:"startedAt" bson:"startedAt"`
	FinishedAt   string             `json:"finishedAt" bson:"finishedAt"`
	Tasks        []Task             `json:"tasks" bson:"tasks"`
}

type ExecutionFilters

type ExecutionFilters struct {
	WorkflowID *primitive.ObjectID
	StartTime  *time.Time
}

type ExecutionStatusCount

type ExecutionStatusCount struct {
	Succeeded int64 `json:"succeeded"`
	Failed    int64 `json:"failed"`
	Running   int64 `json:"running"`
}
type Link struct {
	ToIndex       int    `json:"toIndex" bson:"toIndex"`
	PortFromIndex int    `json:"portFromIndex" bson:"portFromIndex"`
	PortToIndex   int    `json:"portToIndex" bson:"portToIndex"`
	FromIndex     int    `json:"fromIndex" bson:"fromIndex"`
	FromName      string `json:"fromName" bson:"fromName"`
	ToName        string `json:"toName" bson:"toName"`
}

type MetricPrometheusResponseStruct

type MetricPrometheusResponseStruct struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric struct {
				Pod string `json:"pod"`
			} `json:"metric"`
			Values [][]interface{} `json:"values"`
		} `json:"result"`
	} `json:"data"`
}

type RunConfigJSON

type RunConfigJSON struct {
	ComputerProvider ComputerProvider `json:"computeProvider"  bson:"computeProvider"`
}

type Task

type Task struct {
	Name            string              `json:"name" bson:"name"`
	BlockID         int                 `json:"blockId" bson:"blockId"`
	Status          string              `json:"status" bson:"status"`
	StartedAt       string              `json:"startedAt" bson:"startedAt"`
	FinishedAt      string              `json:"finishedAt" bson:"finishedAt"`
	NodeStatus      map[string]string   `json:"nodeStatus" bson:"nodeStatus"`
	Logs            map[string][]string `json:"logs" bson:"logs"`
	ComputeProvider ComputerProvider    `json:"computeProvider" bson:"computeProvider"`
	CostLimit       float32             `json:"costLimit" bson:"costLimit,omitempty"`
	PodName         string              `json:"podName" bson:"podName"`
}

type Workflow

type Workflow struct {
	Id        primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name      string             `json:"name" bson:"name,omitempty"`
	User      string             `json:"user" bson:"user,omitempty"`
	Blocks    []Block            `json:"blocks" bson:"blocks"`
	Links     []Link             `json:"links" bson:"links"`
	RunConfig RunConfigJSON      `json:"runConfig" bson:"runConfig,omitempty"`
	// Maybe we can improve this next structure...
	MetricResults map[string]map[string]MetricPrometheusResponseStruct `json:"metricsByType" bson:"metricsByType"`
	//MetricResults map[string]RemoteMetricResults `json:"metricsByType" bson:"metricsByType"`
	RemoteMetricsRates map[string]map[string]float64 `json:"remoteMetricsRates" bson:"remoteMetricsRates"`
}

func (*Workflow) ReindexBlocks

func (wf *Workflow) ReindexBlocks()

ReindexBlocks : modify the index of the blocks ensuring that for each block in the workflow wf.Block[i].Index == i

func (*Workflow) SortBlocks

func (wf *Workflow) SortBlocks() error

SortBlocks : Topological sort of the blocks list

Jump to

Keyboard shortcuts

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