server

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: 42 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FormFileKey               = "uploadfile"
	NameQueryStringKey        = "name"
	DescriptionQueryStringKey = "description"
	NamespaceStringQuery      = "namespace"
	// Pipeline Id in the query string specifies a pipeline when creating versions.
	PipelineKey = "pipelineid"
)

These are valid conditions of a ScheduledWorkflow.

View Source
const (
	RunKey  = "run_id"
	NodeKey = "node_id"
	Follow  = "follow"
)

These are valid conditions of a ScheduledWorkflow.

View Source
const (
	MaxFileNameLength = 100
	MaxFileLength     = 32 << 20 // 32Mb
)

These are valid conditions of a ScheduledWorkflow.

Variables

This section is empty.

Functions

func AssertUserError

func AssertUserError(t *testing.T, err error, expectedCode codes.Code)

func DecompressPipelineTarball

func DecompressPipelineTarball(compressedFile []byte) ([]byte, error)

func DecompressPipelineZip

func DecompressPipelineZip(compressedFile []byte) ([]byte, error)

func GetPipelineName

func GetPipelineName(queryString string, fileName string) (string, error)

This method extract the common logic of naming the pipeline. API caller can either explicitly name the pipeline through query string ?name=foobar or API server can use the file name by default.

func GetPipelineNamespace

func GetPipelineNamespace(queryString string) (string, error)

func NewReportRunMetricResult

func NewReportRunMetricResult(
	metricName string, nodeID string, err error) *api.ReportRunMetricsResponse_ReportRunMetricResult

NewReportRunMetricResult turns error into a ReportRunMetricResult.

func ReadPipelineFile

func ReadPipelineFile(fileName string, fileReader io.Reader, maxFileLength int) ([]byte, error)

func ToApiExperiment

func ToApiExperiment(experiment *model.Experiment) *api.Experiment

func ToApiExperiments

func ToApiExperiments(experiments []*model.Experiment) []*api.Experiment

func ToApiJob

func ToApiJob(job *model.Job) *api.Job

func ToApiJobs

func ToApiJobs(jobs []*model.Job) []*api.Job

func ToApiPipeline

func ToApiPipeline(pipeline *model.Pipeline) *api.Pipeline

func ToApiPipelineVersion

func ToApiPipelineVersion(version *model.PipelineVersion) (*api.PipelineVersion, error)

func ToApiPipelineVersions

func ToApiPipelineVersions(versions []*model.PipelineVersion) ([]*api.PipelineVersion, error)

func ToApiPipelines

func ToApiPipelines(pipelines []*model.Pipeline) []*api.Pipeline

func ToApiRunDetail

func ToApiRunDetail(run *model.RunDetail) *api.RunDetail

func ToApiRunMetric

func ToApiRunMetric(metric *model.RunMetric) *api.RunMetric

func ToApiRuns

func ToApiRuns(runs []*model.Run) []*api.Run

func ToApiTask

func ToApiTask(task *model.Task) *api.Task

func ToApiTasks

func ToApiTasks(tasks []*model.Task) []*api.Task

func ValidateAuthorizeRequest

func ValidateAuthorizeRequest(request *api.AuthorizeRequest) error

func ValidateCreateExperimentRequest

func ValidateCreateExperimentRequest(request *api.CreateExperimentRequest) error

func ValidateCreatePipelineRequest

func ValidateCreatePipelineRequest(request *api.CreatePipelineRequest) error

func ValidateExperimentResourceReference

func ValidateExperimentResourceReference(resourceManager *resource.ResourceManager, references []*api.ResourceReference) error

Verify the input resource references has one and only reference which is owner experiment.

func ValidateFilter

func ValidateFilter(referenceKey *api.ResourceKey) (*common.FilterContext, error)

func ValidatePagination

func ValidatePagination(pageToken string, pageSize int, keyFieldName string, queryString string,
	modelFieldByApiFieldMapping map[string]string) (*common.PaginationContext, error)

func ValidatePipelineSpecAndResourceReferences

func ValidatePipelineSpecAndResourceReferences(resourceManager *resource.ResourceManager, spec *api.PipelineSpec, resourceReferences []*api.ResourceReference) error

func ValidateReportScheduledWorkflowRequest

func ValidateReportScheduledWorkflowRequest(request *api.ReportScheduledWorkflowRequest) (*util.ScheduledWorkflow, error)

func ValidateReportWorkflowRequest

func ValidateReportWorkflowRequest(request *api.ReportWorkflowRequest) (*util.Workflow, error)

func ValidateRunMetric

func ValidateRunMetric(metric *api.RunMetric) error

ValidateRunMetric validates RunMetric fields from request.

Types

type AuthServer

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

func NewAuthServer

func NewAuthServer(resourceManager *resource.ResourceManager) *AuthServer

func (*AuthServer) Authorize

func (s *AuthServer) Authorize(ctx context.Context, request *api.AuthorizeRequest) (
	*empty.Empty, error)

type ExperimentServer

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

func NewExperimentServer

func NewExperimentServer(resourceManager *resource.ResourceManager, options *ExperimentServerOptions) *ExperimentServer

func (*ExperimentServer) ArchiveExperiment

func (s *ExperimentServer) ArchiveExperiment(ctx context.Context, request *api.ArchiveExperimentRequest) (*empty.Empty, error)

func (*ExperimentServer) CreateExperiment

func (s *ExperimentServer) CreateExperiment(ctx context.Context, request *api.CreateExperimentRequest) (
	*api.Experiment, error)

func (*ExperimentServer) DeleteExperiment

func (s *ExperimentServer) DeleteExperiment(ctx context.Context, request *api.DeleteExperimentRequest) (*empty.Empty, error)

func (*ExperimentServer) GetExperiment

func (s *ExperimentServer) GetExperiment(ctx context.Context, request *api.GetExperimentRequest) (
	*api.Experiment, error)

func (*ExperimentServer) ListExperiment

func (*ExperimentServer) UnarchiveExperiment

func (s *ExperimentServer) UnarchiveExperiment(ctx context.Context, request *api.UnarchiveExperimentRequest) (*empty.Empty, error)

type ExperimentServerOptions

type ExperimentServerOptions struct {
	CollectMetrics bool
}

type JobServer

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

func NewJobServer

func NewJobServer(resourceManager *resource.ResourceManager, options *JobServerOptions) *JobServer

func (*JobServer) CreateJob

func (s *JobServer) CreateJob(ctx context.Context, request *api.CreateJobRequest) (*api.Job, error)

func (*JobServer) DeleteJob

func (s *JobServer) DeleteJob(ctx context.Context, request *api.DeleteJobRequest) (*empty.Empty, error)

func (*JobServer) DisableJob

func (s *JobServer) DisableJob(ctx context.Context, request *api.DisableJobRequest) (*empty.Empty, error)

func (*JobServer) EnableJob

func (s *JobServer) EnableJob(ctx context.Context, request *api.EnableJobRequest) (*empty.Empty, error)

func (*JobServer) GetJob

func (s *JobServer) GetJob(ctx context.Context, request *api.GetJobRequest) (*api.Job, error)

func (*JobServer) ListJobs

func (s *JobServer) ListJobs(ctx context.Context, request *api.ListJobsRequest) (*api.ListJobsResponse, error)

type JobServerOptions

type JobServerOptions struct {
	CollectMetrics bool
}

type PipelineServer

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

func NewPipelineServer

func NewPipelineServer(resourceManager *resource.ResourceManager, options *PipelineServerOptions) *PipelineServer

func (*PipelineServer) CanAccessPipeline

func (s *PipelineServer) CanAccessPipeline(ctx context.Context, pipelineId string, resourceAttributes *authorizationv1.ResourceAttributes) error

func (*PipelineServer) CanAccessPipelineVersion

func (s *PipelineServer) CanAccessPipelineVersion(ctx context.Context, versionId string, resourceAttributes *authorizationv1.ResourceAttributes) error

func (*PipelineServer) CreatePipeline

func (s *PipelineServer) CreatePipeline(ctx context.Context, request *api.CreatePipelineRequest) (*api.Pipeline, error)

func (*PipelineServer) CreatePipelineVersion

func (s *PipelineServer) CreatePipelineVersion(ctx context.Context, request *api.CreatePipelineVersionRequest) (*api.PipelineVersion, error)

func (*PipelineServer) DeletePipeline

func (s *PipelineServer) DeletePipeline(ctx context.Context, request *api.DeletePipelineRequest) (*empty.Empty, error)

func (*PipelineServer) DeletePipelineVersion

func (s *PipelineServer) DeletePipelineVersion(ctx context.Context, request *api.DeletePipelineVersionRequest) (*empty.Empty, error)

func (*PipelineServer) GetPipeline

func (s *PipelineServer) GetPipeline(ctx context.Context, request *api.GetPipelineRequest) (*api.Pipeline, error)

func (*PipelineServer) GetPipelineVersion

func (s *PipelineServer) GetPipelineVersion(ctx context.Context, request *api.GetPipelineVersionRequest) (*api.PipelineVersion, error)

func (*PipelineServer) GetPipelineVersionTemplate

func (s *PipelineServer) GetPipelineVersionTemplate(ctx context.Context, request *api.GetPipelineVersionTemplateRequest) (*api.GetTemplateResponse, error)

func (*PipelineServer) GetTemplate

func (*PipelineServer) ListPipelineVersions

func (*PipelineServer) ListPipelines

func (*PipelineServer) UpdatePipelineDefaultVersion

func (s *PipelineServer) UpdatePipelineDefaultVersion(ctx context.Context, request *api.UpdatePipelineDefaultVersionRequest) (*empty.Empty, error)

type PipelineServerOptions

type PipelineServerOptions struct {
	CollectMetrics bool
}

type PipelineUploadServer

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

func NewPipelineUploadServer

func NewPipelineUploadServer(resourceManager *resource.ResourceManager, options *PipelineUploadServerOptions) *PipelineUploadServer

func (*PipelineUploadServer) UploadPipeline

func (s *PipelineUploadServer) UploadPipeline(w http.ResponseWriter, r *http.Request)

HTTP multipart endpoint for uploading pipeline file. https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html This endpoint is not exposed through grpc endpoint, since grpc-gateway can't convert the gRPC endpoint to the HTTP endpoint. See https://github.com/grpc-ecosystem/grpc-gateway/issues/500 Thus we create the HTTP endpoint directly and using swagger to auto generate the HTTP client.

func (*PipelineUploadServer) UploadPipelineVersion

func (s *PipelineUploadServer) UploadPipelineVersion(w http.ResponseWriter, r *http.Request)

HTTP multipart endpoint for uploading pipeline version file. https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html This endpoint is not exposed through grpc endpoint, since grpc-gateway can't convert the gRPC endpoint to the HTTP endpoint. See https://github.com/grpc-ecosystem/grpc-gateway/issues/500 Thus we create the HTTP endpoint directly and using swagger to auto generate the HTTP client.

type PipelineUploadServerOptions

type PipelineUploadServerOptions struct {
	CollectMetrics bool
}

type ReportServer

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

func NewReportServer

func NewReportServer(resourceManager *resource.ResourceManager) *ReportServer

func (*ReportServer) ReportScheduledWorkflow

func (s *ReportServer) ReportScheduledWorkflow(ctx context.Context,
	request *api.ReportScheduledWorkflowRequest) (*empty.Empty, error)

func (*ReportServer) ReportWorkflow

func (s *ReportServer) ReportWorkflow(ctx context.Context,
	request *api.ReportWorkflowRequest) (*empty.Empty, error)

type RunLogServer

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

func NewRunLogServer

func NewRunLogServer(resourceManager *resource.ResourceManager) *RunLogServer

func (*RunLogServer) ReadRunLog

func (s *RunLogServer) ReadRunLog(w http.ResponseWriter, r *http.Request)

Log streaming endpoint This endpoint is not exposed through grpc endpoint, since grpc-gateway cannot handle native HTTP content streaming.

type RunServer

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

func NewRunServer

func NewRunServer(resourceManager *resource.ResourceManager, options *RunServerOptions) *RunServer

func (*RunServer) ArchiveRun

func (s *RunServer) ArchiveRun(ctx context.Context, request *api.ArchiveRunRequest) (*empty.Empty, error)

func (*RunServer) CreateRun

func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest) (*api.RunDetail, error)

func (*RunServer) DeleteRun

func (s *RunServer) DeleteRun(ctx context.Context, request *api.DeleteRunRequest) (*empty.Empty, error)

func (*RunServer) GetRun

func (s *RunServer) GetRun(ctx context.Context, request *api.GetRunRequest) (*api.RunDetail, error)

func (*RunServer) ListRuns

func (s *RunServer) ListRuns(ctx context.Context, request *api.ListRunsRequest) (*api.ListRunsResponse, error)

func (*RunServer) ReadArtifact

func (s *RunServer) ReadArtifact(ctx context.Context, request *api.ReadArtifactRequest) (*api.ReadArtifactResponse, error)

func (*RunServer) ReportRunMetrics

func (s *RunServer) ReportRunMetrics(ctx context.Context, request *api.ReportRunMetricsRequest) (*api.ReportRunMetricsResponse, error)

func (*RunServer) RetryRun

func (s *RunServer) RetryRun(ctx context.Context, request *api.RetryRunRequest) (*empty.Empty, error)

func (*RunServer) TerminateRun

func (s *RunServer) TerminateRun(ctx context.Context, request *api.TerminateRunRequest) (*empty.Empty, error)

func (*RunServer) UnarchiveRun

func (s *RunServer) UnarchiveRun(ctx context.Context, request *api.UnarchiveRunRequest) (*empty.Empty, error)

type RunServerOptions

type RunServerOptions struct {
	CollectMetrics bool
}

type TaskServer

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

func NewTaskServer

func NewTaskServer(resourceManager *resource.ResourceManager) *TaskServer

func (*TaskServer) CreateTask

func (s *TaskServer) CreateTask(ctx context.Context, request *api.CreateTaskRequest) (*api.Task, error)

func (*TaskServer) ListTasks

func (s *TaskServer) ListTasks(ctx context.Context, request *api.ListTasksRequest) (
	*api.ListTasksResponse, error)

type VisualizationServer

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

func NewVisualizationServer

func NewVisualizationServer(resourceManager *resource.ResourceManager, serviceHost string, servicePort string) *VisualizationServer

func (*VisualizationServer) CreateVisualization

Jump to

Keyboard shortcuts

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