model

package
v1.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package model holds the process entities: a process, the batch-job specifics some processes carry, its status history and its tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchJobProcess

type BatchJobProcess struct {
	ID string `gorm:"column:batch_process_id;primaryKey;type:varchar(36)" json:"batchProcessId"`

	// Owned by Process.BatchProcess, which declares the cascade; only the key is held
	// here. Unique because a process has at most one batch process.
	ProcessID *string `gorm:"column:parent_process_id;type:varchar(36);uniqueIndex" json:"parentProcessId,omitempty"`

	DeploymentID *string                           `gorm:"column:deployment_id;type:varchar(36);index" json:"deploymentId,omitempty"`
	Deployment   *applicationmodel.BatchDeployment `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`

	// The cluster login config this batch job submits under: the account, the key and
	// the work root it runs as. RESTRICT, so a config cannot be deleted out from under
	// a run that submitted through it.
	SlurmClusterConfigID string                           `gorm:"column:slurm_cluster_config_id;type:varchar(36);not null;index" json:"slurmClusterConfigId"`
	SlurmClusterConfig   *computemodel.SlurmClusterConfig `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`

	// Owned one-to-one, as on BatchDeployment: unique foreign key on this side, with
	// the orphan removed by AfterDelete since the database cannot cascade outward.
	BatchJobConfigID string                           `gorm:"column:batch_job_config_id;type:varchar(36);not null;uniqueIndex" json:"batchJobConfigId"`
	BatchJobConfig   *applicationmodel.BatchJobConfig `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"batchJobConfig,omitempty"`

	JobID *string `gorm:"column:job_id;type:varchar(255)" json:"jobId,omitempty"`

	// The values this run supplies for the deployment template's declared inputs and
	// outputs. They hang off the batch process rather than off the process because the
	// declarations they name belong to the deployment, which only a BATCH_JOB has.
	InputMappings  []*TemplateInputMapping  `gorm:"foreignKey:BatchProcessID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"inputMappings,omitempty"`
	OutputMappings []*TemplateOutputMapping `gorm:"foreignKey:BatchProcessID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"outputMappings,omitempty"`

	BaseWorkDir *string `gorm:"column:base_work_dir;type:varchar(1024)" json:"baseWorkDir,omitempty"`

	BatchJobStatuses []*BatchJobStatus `gorm:"foreignKey:BatchProcessID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"batchJobStatuses,omitempty"`
}

BatchJobProcess carries what a BATCH_JOB process needs beyond a Process: the deployment being run, the resources this run asked for, and the scheduler's identifiers for the job once it has one.

It is not a resource of its own. A caller creates it as the batchProcess section of a process, reads it back nested in that process, and deletes it by deleting the process — which is why the row is keyed by its own id but reached only through parent_process_id, unique because a process has at most one of them.

func (*BatchJobProcess) AfterDelete

func (p *BatchJobProcess) AfterDelete(tx *gorm.DB) error

AfterDelete removes the owned BatchJobConfig, standing in for JPA's orphanRemoval.

It fires only when the row is deleted through GORM, which is why Process.BeforeDelete deletes it explicitly rather than letting the database cascade do it.

func (*BatchJobProcess) BeforeCreate

func (p *BatchJobProcess) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (BatchJobProcess) TableName

func (BatchJobProcess) TableName() string

TableName returns the table backing BatchJobProcess.

type BatchJobStatus

type BatchJobStatus struct {
	ID             string             `gorm:"column:batch_process_status_id;primaryKey;type:varchar(36)" json:"batchProcessStatusId"`
	BatchProcessID string             `gorm:"column:batch_process_id;type:varchar(36);not null;index" json:"batchProcessId"`
	Status         BatchJobStatusType `gorm:"column:status;type:varchar(255);not null" json:"status"`
	UpdatedAt      time.Time          `gorm:"column:updated_at;type:timestamp;not null;autoUpdateTime" json:"updatedAt"`
}

func (*BatchJobStatus) BeforeCreate

func (s *BatchJobStatus) BeforeCreate(*gorm.DB) error

func (BatchJobStatus) TableName

func (BatchJobStatus) TableName() string

type BatchJobStatusType

type BatchJobStatusType string
const (
	// Airavata specific status codes
	BatchJobStatusSubmitted        BatchJobStatusType = "SUBMITTED"
	BatchJobStatusSubmissionFailed BatchJobStatusType = "SUBMISSION_FAILED"
	BatchJobStatusCancelling       BatchJobStatusType = "CANCELLING"
	BatchJobStatusCancelled        BatchJobStatusType = "CANCELLED"

	// SLURM specific status codes
	BatchJobStatusBegin         BatchJobStatusType = "BEGIN"
	BatchJobStatusRequeued      BatchJobStatusType = "REQUEUE"
	BatchJobStatusInvalidDepend BatchJobStatusType = "INVALID_DEPEND"
	BatchJobStatusStageOut      BatchJobStatusType = "STAGE_OUT"
	BatchJobStatusTimeLimit     BatchJobStatusType = "TIME_LIMIT"
	BatchJobStatusTimeLimit90   BatchJobStatusType = "TIME_LIMIT_90"
	BatchJobStatusTimeLimit80   BatchJobStatusType = "TIME_LIMIT_80"
	BatchJobStatusTimeLimit50   BatchJobStatusType = "TIME_LIMIT_50"
	BatchJobStatusFailed        BatchJobStatusType = "FAIL"
	BatchJobStatusEnded         BatchJobStatusType = "END"
)

type DataStagingTask

type DataStagingTask struct {
	ID string `gorm:"column:task_id;primaryKey;type:varchar(36)" json:"taskId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"process,omitempty"`

	// Each end is addressed by data-storage id alone: a storage carries the host, the
	// login user and the key it is reached under, so there is no separate credential to
	// name here.
	SourceDataStorageID   *string               `gorm:"column:source_data_storage_id;type:varchar(36);index" json:"sourceDataStorageId,omitempty"`
	SourceDataStorageType *data.DataStorageType `gorm:"column:source_data_storage_type;type:varchar(32)" json:"sourceDataStorageType,omitempty"`

	DestinationDataStorageID   *string               `gorm:"column:destination_data_storage_id;type:varchar(36);index" json:"destinationDataStorageId,omitempty"`
	DestinationDataStorageType *data.DataStorageType `gorm:"column:destination_data_storage_type;type:varchar(32)" json:"destinationDataStorageType,omitempty"`

	// This could be a json array of file paths, or a single file path
	SourcePath *string `gorm:"column:source_path;type:text" json:"sourcePath,omitempty"`

	// This could be a json array of file paths, or a single file path
	DestinationPath *string `gorm:"column:destination_path;type:text" json:"destinationPath,omitempty"`

	// The action to take if the task fails. This is a string that can be used to determine what to do next.
	OnFailure  *OnFailureAction `gorm:"column:on_failure;type:varchar(32)" json:"onFailure,omitempty"`
	RetryCount *int             `gorm:"column:retry_count;type:int" json:"retryCount,omitempty"`

	// Determines the order of execution of tasks within a process. Lower numbers are executed first. Tasks with the same order number are executed in parallel.
	TaskOrder *int `gorm:"column:task_order;type:int" json:"taskOrder,omitempty"`
}

func (*DataStagingTask) AfterDelete

func (t *DataStagingTask) AfterDelete(tx *gorm.DB) error

AfterDelete removes the task's status history.

func (*DataStagingTask) BeforeCreate

func (t *DataStagingTask) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (*DataStagingTask) BelongsTo

func (t *DataStagingTask) BelongsTo(processID string) bool

BelongsTo reports whether this task is part of processID. The scoping is what stops a task id from one process being reached through another process's path.

func (DataStagingTask) TableName

func (DataStagingTask) TableName() string

TableName returns the table backing DataStagingTask.

type InteractiveCommandTask

type InteractiveCommandTask struct {
	ID string `gorm:"column:task_id;primaryKey;type:varchar(36)" json:"taskId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"process,omitempty"`

	Command    *string          `gorm:"column:command;type:text" json:"command,omitempty"`
	Output     *string          `gorm:"column:output;type:text" json:"output,omitempty"`
	OnFailure  *OnFailureAction `gorm:"column:on_failure;type:varchar(32)" json:"onFailure,omitempty"`
	RetryCount *int             `gorm:"column:retry_count;type:int" json:"retryCount,omitempty"`

	TaskOrder *int `gorm:"column:task_order;type:int" json:"taskOrder,omitempty"`
}

Runs an interactive command on the remote cluster. Use this to fiter output of the running job

func (*InteractiveCommandTask) AfterDelete

func (t *InteractiveCommandTask) AfterDelete(tx *gorm.DB) error

AfterDelete removes the task's status history.

func (*InteractiveCommandTask) BeforeCreate

func (t *InteractiveCommandTask) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (*InteractiveCommandTask) BelongsTo

func (t *InteractiveCommandTask) BelongsTo(processID string) bool

BelongsTo reports whether this task is part of processID. The scoping is what stops a task id from one process being reached through another process's path.

func (InteractiveCommandTask) TableName

func (InteractiveCommandTask) TableName() string

TableName returns the table backing InteractiveCommandTask.

type JobMonitoringTask

type JobMonitoringTask struct {
	ID string `gorm:"column:task_id;primaryKey;type:varchar(36)" json:"taskId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"process,omitempty"`

	JobId      *string          `gorm:"column:job_id;type:varchar(255)" json:"jobId,omitempty"`
	OnFailure  *OnFailureAction `gorm:"column:on_failure;type:varchar(32)" json:"onFailure,omitempty"`
	RetryCount *int             `gorm:"column:retry_count;type:int" json:"retryCount,omitempty"`

	TaskOrder *int `gorm:"column:task_order;type:int" json:"taskOrder,omitempty"`
}

func (*JobMonitoringTask) AfterDelete

func (t *JobMonitoringTask) AfterDelete(tx *gorm.DB) error

AfterDelete removes the task's status history.

func (*JobMonitoringTask) BeforeCreate

func (t *JobMonitoringTask) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (*JobMonitoringTask) BelongsTo

func (t *JobMonitoringTask) BelongsTo(processID string) bool

BelongsTo reports whether this task is part of processID. The scoping is what stops a task id from one process being reached through another process's path.

func (JobMonitoringTask) TableName

func (JobMonitoringTask) TableName() string

TableName returns the table backing JobMonitoringTask.

type JobSubmissionTask

type JobSubmissionTask struct {
	ID string `gorm:"column:task_id;primaryKey;type:varchar(36)" json:"taskId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"process,omitempty"`

	JobId *string `gorm:"column:job_id;type:varchar(255)" json:"jobId,omitempty"`

	WorkingDir *string `gorm:"column:working_dir;type:varchar(1024)" json:"workingDir,omitempty"`

	// Script is the batch script the task last built and submitted, recorded by the
	// server so a run can be inspected afterwards.
	Script *string `gorm:"column:script;type:text" json:"script,omitempty"`

	OnFailure  *OnFailureAction `gorm:"column:on_failure;type:varchar(32)" json:"onFailure,omitempty"`
	RetryCount *int             `gorm:"column:retry_count;type:int" json:"retryCount,omitempty"`

	TaskOrder *int `gorm:"column:task_order;type:int" json:"taskOrder,omitempty"`
}

func (*JobSubmissionTask) AfterDelete

func (t *JobSubmissionTask) AfterDelete(tx *gorm.DB) error

AfterDelete removes the task's status history.

func (*JobSubmissionTask) BeforeCreate

func (t *JobSubmissionTask) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (*JobSubmissionTask) BelongsTo

func (t *JobSubmissionTask) BelongsTo(processID string) bool

BelongsTo reports whether this task is part of processID. The scoping is what stops a task id from one process being reached through another process's path.

func (JobSubmissionTask) TableName

func (JobSubmissionTask) TableName() string

TableName returns the table backing JobSubmissionTask.

type OnFailureAction

type OnFailureAction string
const (
	OnFailureActionRetry OnFailureAction = "RETRY"
	OnFailureActionSkip  OnFailureAction = "SKIP"
	OnFailureActionExit  OnFailureAction = "EXIT"
)

func (OnFailureAction) Valid

func (a OnFailureAction) Valid() bool

Valid reports whether a is a recognised action.

type Process

type Process struct {
	ID string `gorm:"column:process_id;primaryKey;type:varchar(36)" json:"processId"`

	OwnerID *string        `gorm:"column:user_id;type:varchar(255);index" json:"userId,omitempty"`
	Owner   *iammodel.User `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`

	// The process type, e.g. "BATCH_JOB". This is a plain string rather than an enum
	// because the set of process kinds is expected to grow.
	ProcessType *ProcessType `gorm:"column:process_type;type:varchar(32)" json:"processType,omitempty"`

	// The last status recorded for this process, if any.
	//
	// It carries no foreign key, deliberately. A status already points at its process,
	// and a constraint in this direction as well would make the two tables mutually
	// dependent — a cycle PostgreSQL cannot create, since it validates a referenced
	// table exists when the referencing table is declared. This column is a cache of
	// the newest status row, maintained by ProcessStatus.AfterCreate.
	LastStatusID *string `gorm:"column:last_status_id;type:varchar(36);index" json:"lastStatusId,omitempty"`

	// The last workflow recorded for this process, if any. Like LastStatusID it
	// carries no foreign key, for the same reason, and is maintained by
	// ProcessWorkflow.AfterCreate.
	LastWorkflowID *string `gorm:"column:last_workflow_id;type:varchar(36);index" json:"lastWorkflowId,omitempty"`

	// BatchProcess is present exactly when ProcessType is BATCH_JOB. It is owned by
	// the process, not shared with it: deleting the process deletes it too.
	BatchProcess *BatchJobProcess `gorm:"foreignKey:ProcessID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"batchProcess,omitempty"`
}

Process is one run: the single entity every other row in this package hangs off.

What a run needs beyond an owner and a type depends on the kind of run it is, and that lives in a per-kind child rather than in columns here — BatchProcess for a BATCH_JOB, and whatever a later kind requires. The children are not resources of their own: a caller creates, reads and deletes them through the process.

func (*Process) BeforeCreate

func (p *Process) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (*Process) BeforeDelete

func (p *Process) BeforeDelete(tx *gorm.DB) error

BeforeDelete removes what the database will not.

The statuses and workflows have to go first: their own ProcessID foreign keys are RESTRICT, so the server would refuse to delete a process any of them still points at. LastStatusID and LastWorkflowID need no clearing — they hold no constraint — and the row carrying them is about to be deleted in this same transaction.

The batch process is deleted through GORM rather than left to its ON DELETE CASCADE so that its own AfterDelete fires and takes the owned BatchJobConfig with it. A cascade in the database removes the row without ever calling into Go, which would leave the config orphaned. Deleting it also takes the template mappings, which hang off the batch process and cascade with it.

The tasks need neither: their foreign key cascades and they own nothing outside themselves.

func (*Process) OwnedBy

func (p *Process) OwnedBy(userID string) bool

OwnedBy reports whether userID launched this process. A process with no owner is owned by nobody, not by the empty principal.

func (Process) TableName

func (Process) TableName() string

TableName returns the table backing Process.

type ProcessLink struct {
	ProcessID string   `gorm:"column:process_id;primaryKey;type:varchar(36)" json:"-"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"-"`

	// LinkTokenHash is the hex SHA-256 of the link token.
	LinkTokenHash string `gorm:"column:link_token_hash;type:varchar(64);not null" json:"-"`
	JupyterToken  string `gorm:"column:jupyter_token;type:varchar(64);not null" json:"-"`

	// The loopback ports, on the job's node, of Linkspan's control API and of the
	// Jupyter Server the job starts. Chosen by Airavata so it knows where to dial.
	ControlPort int32 `gorm:"column:control_port;not null" json:"-"`
	JupyterPort int32 `gorm:"column:jupyter_port;not null" json:"-"`

	// When the tokens were issued, in milliseconds since the epoch.
	IssuedAt int64 `gorm:"column:issued_at;not null" json:"-"`
}

ProcessLink is what lets a process's Linkspan link back to Airavata: the secrets its job is handed at submission and the loopback ports its servers listen on.

Linkspan, running as the job, dials /api/v1/processes/{id}/link and offers the link token; Airavata then reaches the job's servers over that one WebSocket. Only the token's digest is kept, since Airavata only ever compares it. The Jupyter token is kept as issued: it is handed to the process owner so the dashboard can open the job's Jupyter Server through Airavata.

A process has at most one row, replaced on each submission, so a resubmitted job's predecessor can no longer link. Nothing here is serialised: the row never leaves the server except as the owner's Jupyter access.

func (ProcessLink) TableName

func (ProcessLink) TableName() string

TableName returns the table backing ProcessLink.

type ProcessStatus

type ProcessStatus struct {
	ID string `gorm:"column:process_status_id;primaryKey;type:varchar(36)" json:"processStatusId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`

	Status *ProcessStatusType `gorm:"column:status;type:varchar(255)" json:"status,omitempty"`
	Log    *string            `gorm:"column:log;type:text" json:"log,omitempty"`

	// The time the status was recorded, in milliseconds since the epoch.
	Timestamp *int64 `gorm:"column:timestamp" json:"timestamp,omitempty"`
}

func (*ProcessStatus) AfterCreate

func (s *ProcessStatus) AfterCreate(tx *gorm.DB) error

func (*ProcessStatus) BeforeCreate

func (s *ProcessStatus) BeforeCreate(*gorm.DB) error

func (ProcessStatus) TableName

func (ProcessStatus) TableName() string

TableName returns the table backing ProcessStatus.

type ProcessStatusType

type ProcessStatusType string
const (
	ProcessStatusTypeCreated   ProcessStatusType = "CREATED"
	ProcessStatusTypeSubmitted ProcessStatusType = "SUBMITTED"
	ProcessStatusTypeRunning   ProcessStatusType = "RUNNING"
	ProcessStatusTypeCompleted ProcessStatusType = "COMPLETED"
	ProcessStatusTypeFailed    ProcessStatusType = "FAILED"
)

type ProcessType

type ProcessType string
const (
	ProcessTypeBatchJob ProcessType = "BATCH_JOB"
	ProcessTypeTask     ProcessType = "CLOUD_JOB"
)

func (ProcessType) Valid

func (t ProcessType) Valid() bool

Valid reports whether t is a recognised process type.

type ProcessWorkflow

type ProcessWorkflow struct {
	ID string `gorm:"column:process_workflow_id;primaryKey;type:varchar(36)" json:"processWorkflowId"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`
	// Workflow id or monitoring task id
	WorkflowID   string               `gorm:"column:workflow_id;type:varchar(36)" json:"workflowId"`
	WorkflowType *ProcessWorkflowType `gorm:"column:workflow_type;type:varchar(255)" json:"workflowType,omitempty"`

	// Where the run stands: RUNNING once started, then SUCCEEDED or FAILED.
	Status *ProcessWorkflowStatusType `gorm:"column:status;type:varchar(255)" json:"status,omitempty"`

	// The time the workflow was recorded, in milliseconds since the epoch.
	Timestamp *int64 `gorm:"column:timestamp" json:"timestamp,omitempty"`
}

ProcessWorkflow records one workflow run started on behalf of a process — the job submission, monitoring or completion workflow — by the id the workflow engine knows it by.

func (*ProcessWorkflow) AfterCreate

func (p *ProcessWorkflow) AfterCreate(tx *gorm.DB) error

func (*ProcessWorkflow) BeforeCreate

func (p *ProcessWorkflow) BeforeCreate(*gorm.DB) error

func (ProcessWorkflow) TableName

func (ProcessWorkflow) TableName() string

TableName returns the table backing ProcessWorkflow.

type ProcessWorkflowStatusType

type ProcessWorkflowStatusType string
const (
	ProcessWorkflowStatusTypeRunning   ProcessWorkflowStatusType = "RUNNING"
	ProcessWorkflowStatusTypeSucceeded ProcessWorkflowStatusType = "SUCCEEDED"
	ProcessWorkflowStatusTypeFailed    ProcessWorkflowStatusType = "FAILED"
)

type ProcessWorkflowType

type ProcessWorkflowType string
const (
	ProcessWorkflowTypeBatchJobSubmission ProcessWorkflowType = "BATCH_JOB_SUBMISSION"
	ProcessWorkflowTypeJobMonitoring      ProcessWorkflowType = "JOB_MONITORING"
	ProcessWorkflowTypeJobCompletion      ProcessWorkflowType = "BATCH_JOB_COMPLETION"
)

type TaskStatus

type TaskStatus struct {
	ID string `gorm:"column:task_status_id;primaryKey;type:varchar(36)" json:"taskStatusId"`

	TaskID   string   `gorm:"column:task_id;type:varchar(36);not null;index" json:"taskId"`
	TaskType TaskType `gorm:"column:task_type;type:varchar(32);not null" json:"taskType"`

	ProcessID *string  `gorm:"column:process_id;type:varchar(36);index" json:"processId,omitempty"`
	Process   *Process `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"-"`

	Status *TaskStatusType `gorm:"column:status;type:varchar(255)" json:"status,omitempty"`
	Log    *string         `gorm:"column:log;type:text" json:"log,omitempty"`

	// The time the status was recorded, in milliseconds since the epoch.
	Timestamp *int64 `gorm:"column:timestamp" json:"timestamp,omitempty"`
}

TaskStatus is one entry in a task's status history.

The four task kinds live in four tables, so TaskID cannot carry a foreign key; TaskType says which table it names. Cleanup is split accordingly: deleting a process cascades through ProcessID, and deleting a single task removes its history in the task's AfterDelete.

func (*TaskStatus) BeforeCreate

func (s *TaskStatus) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (TaskStatus) TableName

func (TaskStatus) TableName() string

TableName returns the table backing TaskStatus.

type TaskStatusType

type TaskStatusType string
const (
	TaskStatusTypeCreated   TaskStatusType = "CREATED"
	TaskStatusTypeExecuting TaskStatusType = "EXECUTING"
	// The task is blocked on something outside the workflow, such as an interactive
	// authentication, and resumes once it arrives.
	TaskStatusTypePaused    TaskStatusType = "PAUSED"
	TaskStatusTypeCompleted TaskStatusType = "COMPLETED"
	TaskStatusTypeFailed    TaskStatusType = "FAILED"
	TaskStatusTypeCanceled  TaskStatusType = "CANCELED"
)

func (TaskStatusType) Valid

func (s TaskStatusType) Valid() bool

Valid reports whether s is a recognised task status.

type TaskType

type TaskType string

TaskType names which of the four task tables a TaskStatus points into.

const (
	TaskTypeDataStaging        TaskType = "DATA_STAGING"
	TaskTypeJobSubmission      TaskType = "JOB_SUBMISSION"
	TaskTypeJobMonitoring      TaskType = "JOB_MONITORING"
	TaskTypeInteractiveCommand TaskType = "INTERACTIVE_COMMAND"
)

func (TaskType) Valid

func (t TaskType) Valid() bool

Valid reports whether t is a recognised task type.

type TemplateInputMapping

type TemplateInputMapping struct {
	TemplateInputMappingID string `gorm:"column:template_input_mapping_id;primaryKey;type:varchar(36)" json:"templateInputMappingId"`

	// The template this mapping belongs to.
	TemplateInputID *string                    `gorm:"column:template_input_id;type:varchar(36);index" json:"templateInputId,omitempty"`
	TemplateInput   *application.TemplateInput `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"templateInput,omitempty"`

	// Owned by BatchJobProcess.InputMappings, which declares the cascade; only the
	// key is held here.
	BatchProcessID *string `gorm:"column:batch_process_id;type:varchar(36);index" json:"batchProcessId,omitempty"`

	// Value is a JSON document, either {"value": "..."} for a single value or
	// {"values": [...]} for a list.
	Value *string `gorm:"column:value;type:text" json:"value,omitempty"`
}

func (*TemplateInputMapping) BeforeCreate

func (m *TemplateInputMapping) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (TemplateInputMapping) TableName

func (TemplateInputMapping) TableName() string

TableName returns the table backing TemplateInputMapping.

type TemplateOutputMapping

type TemplateOutputMapping struct {
	TemplateOutputMappingID string `gorm:"column:template_output_mapping_id;primaryKey;type:varchar(36)" json:"templateOutputMappingId"`

	// The template this mapping belongs to.
	TemplateOutputID *string                     `gorm:"column:template_output_id;type:varchar(36);index" json:"templateOutputId,omitempty"`
	TemplateOutput   *application.TemplateOutput `gorm:"references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"templateOutput,omitempty"`

	// Owned by BatchJobProcess.OutputMappings, which declares the cascade; only the
	// key is held here.
	BatchProcessID *string `gorm:"column:batch_process_id;type:varchar(36);index" json:"batchProcessId,omitempty"`

	// Value is a JSON document, either {"value": "..."} for a single value or
	// {"values": [...]} for a list.
	Value *string `gorm:"column:value;type:text" json:"value,omitempty"`
}

func (*TemplateOutputMapping) BeforeCreate

func (m *TemplateOutputMapping) BeforeCreate(*gorm.DB) error

BeforeCreate assigns a UUID when none was supplied.

func (TemplateOutputMapping) TableName

func (TemplateOutputMapping) TableName() string

TableName returns the table backing TemplateOutputMapping.

Jump to

Keyboard shortcuts

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