resource

package
v1.7.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddRuntimeMetadata

func AddRuntimeMetadata(wf *v1alpha1.Workflow)

func AddWorkflowLabel

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

AddWorkflowLabel add label for a workflow

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(ctx context.Context, 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
	TaskStore() storage.TaskStoreInterface
	ResourceReferenceStore() storage.ResourceReferenceStoreInterface
	DBStatusStore() storage.DBStatusStoreInterface
	DefaultExperimentStore() storage.DefaultExperimentStoreInterface
	ObjectStore() storage.ObjectStoreInterface
	ArgoClient() client.ArgoClientInterface
	SwfClient() client.SwfClientInterface
	KubernetesCoreClient() client.KubernetesCoreInterface
	SubjectAccessReviewClient() client.SubjectAccessReviewInterface
	TokenReviewClient() client.TokenReviewInterface
	LogArchive() archive.LogArchiveInterface
	Time() util.TimeInterface
	UUID() util.UUIDGeneratorInterface
	Authenticators() []kfpauth.Authenticator
}

type FakeClientManager

type FakeClientManager struct {
	ArgoClientFake *client.FakeArgoClient

	SubjectAccessReviewClientFake client.SubjectAccessReviewInterface

	AuthenticatorsFake []auth.Authenticator
	// contains filtered or unexported fields
}

func NewFakeClientManagerOrFatal

func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager

func (*FakeClientManager) ArgoClient

func (*FakeClientManager) Authenticators

func (f *FakeClientManager) Authenticators() []auth.Authenticator

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) KubernetesCoreClient

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

func (*FakeClientManager) LogArchive

func (*FakeClientManager) ObjectStore

func (*FakeClientManager) PipelineStore

func (*FakeClientManager) ResourceReferenceStore

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

func (*FakeClientManager) RunStore

func (*FakeClientManager) SubjectAccessReviewClient

func (f *FakeClientManager) SubjectAccessReviewClient() client.SubjectAccessReviewInterface

func (*FakeClientManager) SwfClient

func (*FakeClientManager) TaskStore

func (*FakeClientManager) Time

func (*FakeClientManager) TokenReviewClient

func (f *FakeClientManager) TokenReviewClient() client.TokenReviewInterface

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(ctx context.Context, experimentId string) error

func (*ResourceManager) ArchiveRun

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

func (*ResourceManager) AuthenticateRequest

func (r *ResourceManager) AuthenticateRequest(ctx context.Context) (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(ctx context.Context, apiJob *api.Job) (*model.Job, error)

func (*ResourceManager) CreatePipeline

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

func (*ResourceManager) CreatePipelineVersion

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

func (*ResourceManager) CreateRun

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

func (*ResourceManager) CreateTask

func (r *ResourceManager) CreateTask(ctx context.Context, apiTask *api.Task) (*model.Task, error)

func (*ResourceManager) DeleteExperiment

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

func (*ResourceManager) DeleteJob

func (r *ResourceManager) DeleteJob(ctx context.Context, 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(ctx context.Context, runID string) error

func (*ResourceManager) EnableJob

func (r *ResourceManager) EnableJob(ctx context.Context, 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) GetNamespaceFromPipelineID

func (r *ResourceManager) GetNamespaceFromPipelineID(pipelineId string) (string, error)

func (*ResourceManager) GetNamespaceFromPipelineVersion

func (r *ResourceManager) GetNamespaceFromPipelineVersion(versionId 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(ctx context.Context, userIdentity string, resourceAttributes *authorizationv1.ResourceAttributes) 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(filterContext *common.FilterContext, 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) ListTasks

func (r *ResourceManager) ListTasks(filterContext *common.FilterContext,
	opts *list.Options) (tasks []*model.Task, 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) ReadLog

func (r *ResourceManager) ReadLog(ctx context.Context, runId string, nodeId string, follow bool, dst io.Writer) error

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(ctx context.Context, workflow *util.Workflow) error

func (*ResourceManager) RetryRun

func (r *ResourceManager) RetryRun(ctx context.Context, runId string) error

func (*ResourceManager) SetDefaultExperimentId

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

func (*ResourceManager) TerminateRun

func (r *ResourceManager) TerminateRun(ctx context.Context, 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) UpdatePipelineDefaultVersion

func (r *ResourceManager) UpdatePipelineDefaultVersion(pipelineId string, versionId 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