resource

package
v0.0.0-...-4f670de Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFakeUUID = "123e4567-e89b-12d3-a456-426655440000"
	FakeUUIDOne     = "123e4567-e89b-12d3-a456-426655440001"
)
View Source
const (
	HasDefaultBucketEnvVar  = "HAS_DEFAULT_BUCKET"
	ProjectIDEnvVar         = "PROJECT_ID"
	DefaultBucketNameEnvVar = "BUCKET_NAME"
)

Variables

This section is empty.

Functions

func AddWorkflowLabel

func AddWorkflowLabel(wfClient workflowclient.WorkflowInterface, name string, labelKey string, labelValue string) error

AddWorkflowLabel add label for a workflow

func ConvertPipelineIdToDefaultPipelineVersion

func ConvertPipelineIdToDefaultPipelineVersion(pipelineSpec *api.PipelineSpec, resourceReferences *[]*api.ResourceReference, r *ResourceManager) error

Convert PipelineId in PipelineSpec to the pipeline's default pipeline version. This is for legacy usage of pipeline id to create run. The standard way to create run is by specifying the pipeline version.

func OverrideParameterWithSystemDefault

func OverrideParameterWithSystemDefault(workflow util.Workflow, apiRun *api.Run) error

Patch the system-specified default parameters if available.

func PatchPipelineDefaultParameter

func PatchPipelineDefaultParameter(text string) (string, error)

Mutate default values of specified pipeline spec. Args:

text: (part of) pipeline file in string.

func TerminateWorkflow

func TerminateWorkflow(wfClient workflowclient.WorkflowInterface, name string) error

TerminateWorkflow terminates a workflow by setting its activeDeadlineSeconds to 0

Types

type ClientManagerInterface

type ClientManagerInterface interface {
	ExperimentStore() storage.ExperimentStoreInterface
	PipelineStore() storage.PipelineStoreInterface
	JobStore() storage.JobStoreInterface
	RunStore() storage.RunStoreInterface
	ResourceReferenceStore() storage.ResourceReferenceStoreInterface
	DBStatusStore() storage.DBStatusStoreInterface
	DefaultExperimentStore() storage.DefaultExperimentStoreInterface
	ObjectStore() storage.ObjectStoreInterface
	ArgoClient() client.ArgoClientInterface
	SwfClient() client.SwfClientInterface
	KubernetesCoreClient() client.KubernetesCoreInterface
	KFAMClient() client.KFAMClientInterface
	Time() util.TimeInterface
	UUID() util.UUIDGeneratorInterface
}

type FakeClientManager

type FakeClientManager struct {
	ArgoClientFake *client.FakeArgoClient

	KfamClientFake client.KFAMClientInterface
	// contains filtered or unexported fields
}

func NewFakeClientManagerOrFatal

func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager

func (*FakeClientManager) ArgoClient

func (*FakeClientManager) Close

func (f *FakeClientManager) Close() error

func (*FakeClientManager) DB

func (f *FakeClientManager) DB() *storage.DB

func (*FakeClientManager) DBStatusStore

func (*FakeClientManager) DefaultExperimentStore

func (f *FakeClientManager) DefaultExperimentStore() storage.DefaultExperimentStoreInterface

func (*FakeClientManager) ExperimentStore

func (f *FakeClientManager) ExperimentStore() storage.ExperimentStoreInterface

func (*FakeClientManager) JobStore

func (*FakeClientManager) KFAMClient

func (*FakeClientManager) KubernetesCoreClient

func (f *FakeClientManager) KubernetesCoreClient() client.KubernetesCoreInterface

func (*FakeClientManager) ObjectStore

func (*FakeClientManager) PipelineStore

func (*FakeClientManager) ResourceReferenceStore

func (f *FakeClientManager) ResourceReferenceStore() storage.ResourceReferenceStoreInterface

func (*FakeClientManager) RunStore

func (*FakeClientManager) SwfClient

func (*FakeClientManager) Time

func (*FakeClientManager) UUID

func (*FakeClientManager) UpdateUUID

func (f *FakeClientManager) UpdateUUID(uuid util.UUIDGeneratorInterface)

Update the uuid used in this fake client manager

type ResourceManager

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

func NewResourceManager

func NewResourceManager(clientManager ClientManagerInterface) *ResourceManager

func (*ResourceManager) ArchiveExperiment

func (r *ResourceManager) ArchiveExperiment(experimentId string) error

func (*ResourceManager) ArchiveRun

func (r *ResourceManager) ArchiveRun(runId string) error

func (*ResourceManager) CreateDefaultExperiment

func (r *ResourceManager) CreateDefaultExperiment() (string, error)

Used to initialize the Experiment database with a default to be used for runs

func (*ResourceManager) CreateExperiment

func (r *ResourceManager) CreateExperiment(apiExperiment *api.Experiment) (*model.Experiment, error)

func (*ResourceManager) CreateJob

func (r *ResourceManager) CreateJob(apiJob *api.Job) (*model.Job, error)

func (*ResourceManager) CreatePipeline

func (r *ResourceManager) CreatePipeline(name string, description string, pipelineFile []byte) (*model.Pipeline, error)

func (*ResourceManager) CreatePipelineVersion

func (r *ResourceManager) CreatePipelineVersion(apiVersion *api.PipelineVersion, pipelineFile []byte) (*model.PipelineVersion, error)

func (*ResourceManager) CreateRun

func (r *ResourceManager) CreateRun(apiRun *api.Run) (*model.RunDetail, error)

func (*ResourceManager) DeleteExperiment

func (r *ResourceManager) DeleteExperiment(experimentID string) error

func (*ResourceManager) DeleteJob

func (r *ResourceManager) DeleteJob(jobID string) error

func (*ResourceManager) DeletePipeline

func (r *ResourceManager) DeletePipeline(pipelineId string) error

func (*ResourceManager) DeletePipelineVersion

func (r *ResourceManager) DeletePipelineVersion(pipelineVersionId string) error

func (*ResourceManager) DeleteRun

func (r *ResourceManager) DeleteRun(runID string) error

func (*ResourceManager) EnableJob

func (r *ResourceManager) EnableJob(jobID string, enabled bool) error

func (*ResourceManager) GetDefaultExperimentId

func (r *ResourceManager) GetDefaultExperimentId() (string, error)

func (*ResourceManager) GetExperiment

func (r *ResourceManager) GetExperiment(experimentId string) (*model.Experiment, error)

func (*ResourceManager) GetJob

func (r *ResourceManager) GetJob(id string) (*model.Job, error)

func (*ResourceManager) GetNamespaceFromExperimentID

func (r *ResourceManager) GetNamespaceFromExperimentID(experimentID string) (string, error)

func (*ResourceManager) GetNamespaceFromJobID

func (r *ResourceManager) GetNamespaceFromJobID(jobId string) (string, error)

func (*ResourceManager) GetNamespaceFromRunID

func (r *ResourceManager) GetNamespaceFromRunID(runId string) (string, error)

func (*ResourceManager) GetPipeline

func (r *ResourceManager) GetPipeline(pipelineId string) (*model.Pipeline, error)

func (*ResourceManager) GetPipelineTemplate

func (r *ResourceManager) GetPipelineTemplate(pipelineId string) ([]byte, error)

func (*ResourceManager) GetPipelineVersion

func (r *ResourceManager) GetPipelineVersion(versionId string) (*model.PipelineVersion, error)

func (*ResourceManager) GetPipelineVersionTemplate

func (r *ResourceManager) GetPipelineVersionTemplate(versionId string) ([]byte, error)

func (*ResourceManager) GetRun

func (r *ResourceManager) GetRun(runId string) (*model.RunDetail, error)

func (*ResourceManager) GetTime

func (r *ResourceManager) GetTime() util.TimeInterface

func (*ResourceManager) HaveSamplesLoaded

func (r *ResourceManager) HaveSamplesLoaded() (bool, error)

func (*ResourceManager) IsRequestAuthorized

func (r *ResourceManager) IsRequestAuthorized(userIdentity string, namespace string) (bool, error)

func (*ResourceManager) ListExperiments

func (r *ResourceManager) ListExperiments(filterContext *common.FilterContext, opts *list.Options) (
	experiments []*model.Experiment, total_size int, nextPageToken string, err error)

func (*ResourceManager) ListJobs

func (r *ResourceManager) ListJobs(filterContext *common.FilterContext,
	opts *list.Options) (jobs []*model.Job, total_size int, nextPageToken string, err error)

func (*ResourceManager) ListPipelineVersions

func (r *ResourceManager) ListPipelineVersions(pipelineId string, opts *list.Options) (pipelines []*model.PipelineVersion, total_size int, nextPageToken string, err error)

func (*ResourceManager) ListPipelines

func (r *ResourceManager) ListPipelines(opts *list.Options) (
	pipelines []*model.Pipeline, total_size int, nextPageToken string, err error)

func (*ResourceManager) ListRuns

func (r *ResourceManager) ListRuns(filterContext *common.FilterContext,
	opts *list.Options) (runs []*model.Run, total_size int, nextPageToken string, err error)

func (*ResourceManager) MarkSampleLoaded

func (r *ResourceManager) MarkSampleLoaded() error

func (*ResourceManager) ReadArtifact

func (r *ResourceManager) ReadArtifact(runID string, nodeID string, artifactName string) ([]byte, error)

ReadArtifact parses run's workflow to find artifact file path and reads the content of the file from object store.

func (*ResourceManager) ReportMetric

func (r *ResourceManager) ReportMetric(metric *api.RunMetric, runUUID string) error

func (*ResourceManager) ReportScheduledWorkflowResource

func (r *ResourceManager) ReportScheduledWorkflowResource(swf *util.ScheduledWorkflow) error

func (*ResourceManager) ReportWorkflowResource

func (r *ResourceManager) ReportWorkflowResource(workflow *util.Workflow) error

func (*ResourceManager) RetryRun

func (r *ResourceManager) RetryRun(runId string) error

func (*ResourceManager) SetDefaultExperimentId

func (r *ResourceManager) SetDefaultExperimentId(id string) error

func (*ResourceManager) TerminateRun

func (r *ResourceManager) TerminateRun(runId string) error

func (*ResourceManager) ToModelExperiment

func (r *ResourceManager) ToModelExperiment(apiExperiment *api.Experiment) (*model.Experiment, error)

func (*ResourceManager) ToModelJob

func (r *ResourceManager) ToModelJob(job *api.Job, swf *util.ScheduledWorkflow, workflowSpecManifest string) (*model.Job, error)

func (*ResourceManager) ToModelPipelineVersion

func (r *ResourceManager) ToModelPipelineVersion(version *api.PipelineVersion) (*model.PipelineVersion, error)

func (*ResourceManager) ToModelRunDetail

func (r *ResourceManager) ToModelRunDetail(run *api.Run, runId string, workflow *util.Workflow, workflowSpecManifest string) (*model.RunDetail, error)

The input run might not contain workflowSpecManifest, but instead a pipeline ID. The caller would retrieve workflowSpecManifest and pass in.

func (*ResourceManager) ToModelRunMetric

func (r *ResourceManager) ToModelRunMetric(metric *api.RunMetric, runUUID string) *model.RunMetric

func (*ResourceManager) UnarchiveExperiment

func (r *ResourceManager) UnarchiveExperiment(experimentId string) error

func (*ResourceManager) UnarchiveRun

func (r *ResourceManager) UnarchiveRun(runId string) error

func (*ResourceManager) UpdatePipelineStatus

func (r *ResourceManager) UpdatePipelineStatus(pipelineId string, status model.PipelineStatus) error

func (*ResourceManager) UpdatePipelineVersionStatus

func (r *ResourceManager) UpdatePipelineVersionStatus(pipelineId string, status model.PipelineVersionStatus) error

Jump to

Keyboard shortcuts

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