Documentation ¶
Index ¶
- Constants
- func AddWorkflowLabel(wfClient workflowclient.WorkflowInterface, name string, labelKey string, ...) error
- func ConvertPipelineIdToDefaultPipelineVersion(pipelineSpec *api.PipelineSpec, resourceReferences *[]*api.ResourceReference, ...) error
- func OverrideParameterWithSystemDefault(workflow util.Workflow, apiRun *api.Run) error
- func PatchPipelineDefaultParameter(text string) (string, error)
- func TerminateWorkflow(wfClient workflowclient.WorkflowInterface, name string) error
- type ClientManagerInterface
- type FakeClientManager
- func (f *FakeClientManager) ArgoClient() client.ArgoClientInterface
- func (f *FakeClientManager) Close() error
- func (f *FakeClientManager) DB() *storage.DB
- func (f *FakeClientManager) DBStatusStore() storage.DBStatusStoreInterface
- func (f *FakeClientManager) DefaultExperimentStore() storage.DefaultExperimentStoreInterface
- func (f *FakeClientManager) ExperimentStore() storage.ExperimentStoreInterface
- func (f *FakeClientManager) JobStore() storage.JobStoreInterface
- func (f *FakeClientManager) KFAMClient() client.KFAMClientInterface
- func (f *FakeClientManager) KubernetesCoreClient() client.KubernetesCoreInterface
- func (f *FakeClientManager) ObjectStore() storage.ObjectStoreInterface
- func (f *FakeClientManager) PipelineStore() storage.PipelineStoreInterface
- func (f *FakeClientManager) ResourceReferenceStore() storage.ResourceReferenceStoreInterface
- func (f *FakeClientManager) RunStore() storage.RunStoreInterface
- func (f *FakeClientManager) SwfClient() client.SwfClientInterface
- func (f *FakeClientManager) Time() util.TimeInterface
- func (f *FakeClientManager) UUID() util.UUIDGeneratorInterface
- func (f *FakeClientManager) UpdateUUID(uuid util.UUIDGeneratorInterface)
- type ResourceManager
- func (r *ResourceManager) ArchiveExperiment(experimentId string) error
- func (r *ResourceManager) ArchiveRun(runId string) error
- func (r *ResourceManager) CreateDefaultExperiment() (string, error)
- func (r *ResourceManager) CreateExperiment(apiExperiment *api.Experiment) (*model.Experiment, error)
- func (r *ResourceManager) CreateJob(apiJob *api.Job) (*model.Job, error)
- func (r *ResourceManager) CreatePipeline(name string, description string, pipelineFile []byte) (*model.Pipeline, error)
- func (r *ResourceManager) CreatePipelineVersion(apiVersion *api.PipelineVersion, pipelineFile []byte) (*model.PipelineVersion, error)
- func (r *ResourceManager) CreateRun(apiRun *api.Run) (*model.RunDetail, error)
- func (r *ResourceManager) DeleteExperiment(experimentID string) error
- func (r *ResourceManager) DeleteJob(jobID string) error
- func (r *ResourceManager) DeletePipeline(pipelineId string) error
- func (r *ResourceManager) DeletePipelineVersion(pipelineVersionId string) error
- func (r *ResourceManager) DeleteRun(runID string) error
- func (r *ResourceManager) EnableJob(jobID string, enabled bool) error
- func (r *ResourceManager) GetDefaultExperimentId() (string, error)
- func (r *ResourceManager) GetExperiment(experimentId string) (*model.Experiment, error)
- func (r *ResourceManager) GetJob(id string) (*model.Job, error)
- func (r *ResourceManager) GetNamespaceFromExperimentID(experimentID string) (string, error)
- func (r *ResourceManager) GetNamespaceFromJobID(jobId string) (string, error)
- func (r *ResourceManager) GetNamespaceFromRunID(runId string) (string, error)
- func (r *ResourceManager) GetPipeline(pipelineId string) (*model.Pipeline, error)
- func (r *ResourceManager) GetPipelineTemplate(pipelineId string) ([]byte, error)
- func (r *ResourceManager) GetPipelineVersion(versionId string) (*model.PipelineVersion, error)
- func (r *ResourceManager) GetPipelineVersionTemplate(versionId string) ([]byte, error)
- func (r *ResourceManager) GetRun(runId string) (*model.RunDetail, error)
- func (r *ResourceManager) GetTime() util.TimeInterface
- func (r *ResourceManager) HaveSamplesLoaded() (bool, error)
- func (r *ResourceManager) IsRequestAuthorized(userIdentity string, namespace string) (bool, error)
- func (r *ResourceManager) ListExperiments(filterContext *common.FilterContext, opts *list.Options) (experiments []*model.Experiment, total_size int, nextPageToken string, ...)
- func (r *ResourceManager) ListJobs(filterContext *common.FilterContext, opts *list.Options) (jobs []*model.Job, total_size int, nextPageToken string, err error)
- func (r *ResourceManager) ListPipelineVersions(pipelineId string, opts *list.Options) (pipelines []*model.PipelineVersion, total_size int, nextPageToken string, ...)
- func (r *ResourceManager) ListPipelines(opts *list.Options) (pipelines []*model.Pipeline, total_size int, nextPageToken string, err error)
- func (r *ResourceManager) ListRuns(filterContext *common.FilterContext, opts *list.Options) (runs []*model.Run, total_size int, nextPageToken string, err error)
- func (r *ResourceManager) MarkSampleLoaded() error
- func (r *ResourceManager) ReadArtifact(runID string, nodeID string, artifactName string) ([]byte, error)
- func (r *ResourceManager) ReportMetric(metric *api.RunMetric, runUUID string) error
- func (r *ResourceManager) ReportScheduledWorkflowResource(swf *util.ScheduledWorkflow) error
- func (r *ResourceManager) ReportWorkflowResource(workflow *util.Workflow) error
- func (r *ResourceManager) RetryRun(runId string) error
- func (r *ResourceManager) SetDefaultExperimentId(id string) error
- func (r *ResourceManager) TerminateRun(runId string) error
- func (r *ResourceManager) ToModelExperiment(apiExperiment *api.Experiment) (*model.Experiment, error)
- func (r *ResourceManager) ToModelJob(job *api.Job, swf *util.ScheduledWorkflow, workflowSpecManifest string) (*model.Job, error)
- func (r *ResourceManager) ToModelPipelineVersion(version *api.PipelineVersion) (*model.PipelineVersion, error)
- func (r *ResourceManager) ToModelRunDetail(run *api.Run, runId string, workflow *util.Workflow, ...) (*model.RunDetail, error)
- func (r *ResourceManager) ToModelRunMetric(metric *api.RunMetric, runUUID string) *model.RunMetric
- func (r *ResourceManager) UnarchiveExperiment(experimentId string) error
- func (r *ResourceManager) UnarchiveRun(runId string) error
- func (r *ResourceManager) UpdatePipelineStatus(pipelineId string, status model.PipelineStatus) error
- func (r *ResourceManager) UpdatePipelineVersionStatus(pipelineId string, status model.PipelineVersionStatus) error
Constants ¶
const ( DefaultFakeUUID = "123e4567-e89b-12d3-a456-426655440000" FakeUUIDOne = "123e4567-e89b-12d3-a456-426655440001" )
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 ¶
Patch the system-specified default parameters if available.
func PatchPipelineDefaultParameter ¶
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 NewFakeClientManager ¶
func NewFakeClientManager(time util.TimeInterface, uuid util.UUIDGeneratorInterface) ( *FakeClientManager, error)
func NewFakeClientManagerOrFatal ¶
func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager
func (*FakeClientManager) ArgoClient ¶
func (f *FakeClientManager) ArgoClient() client.ArgoClientInterface
func (*FakeClientManager) Close ¶
func (f *FakeClientManager) Close() error
func (*FakeClientManager) DB ¶
func (f *FakeClientManager) DB() *storage.DB
func (*FakeClientManager) DBStatusStore ¶
func (f *FakeClientManager) DBStatusStore() storage.DBStatusStoreInterface
func (*FakeClientManager) DefaultExperimentStore ¶
func (f *FakeClientManager) DefaultExperimentStore() storage.DefaultExperimentStoreInterface
func (*FakeClientManager) ExperimentStore ¶
func (f *FakeClientManager) ExperimentStore() storage.ExperimentStoreInterface
func (*FakeClientManager) JobStore ¶
func (f *FakeClientManager) JobStore() storage.JobStoreInterface
func (*FakeClientManager) KFAMClient ¶
func (f *FakeClientManager) KFAMClient() client.KFAMClientInterface
func (*FakeClientManager) KubernetesCoreClient ¶
func (f *FakeClientManager) KubernetesCoreClient() client.KubernetesCoreInterface
func (*FakeClientManager) ObjectStore ¶
func (f *FakeClientManager) ObjectStore() storage.ObjectStoreInterface
func (*FakeClientManager) PipelineStore ¶
func (f *FakeClientManager) PipelineStore() storage.PipelineStoreInterface
func (*FakeClientManager) ResourceReferenceStore ¶
func (f *FakeClientManager) ResourceReferenceStore() storage.ResourceReferenceStoreInterface
func (*FakeClientManager) RunStore ¶
func (f *FakeClientManager) RunStore() storage.RunStoreInterface
func (*FakeClientManager) SwfClient ¶
func (f *FakeClientManager) SwfClient() client.SwfClientInterface
func (*FakeClientManager) Time ¶
func (f *FakeClientManager) Time() util.TimeInterface
func (*FakeClientManager) UUID ¶
func (f *FakeClientManager) UUID() util.UUIDGeneratorInterface
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) CreatePipeline ¶
func (*ResourceManager) CreatePipelineVersion ¶
func (r *ResourceManager) CreatePipelineVersion(apiVersion *api.PipelineVersion, pipelineFile []byte) (*model.PipelineVersion, 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) 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 (*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 (*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