예제 #1
0
func (a *apiServer) StartPipelineRun(ctx context.Context, startPipelineRunRequest *pps.StartPipelineRunRequest) (*pps.StartPipelineRunResponse, error) {
	dockerHost := os.Getenv("DOCKER_HOST")
	if dockerHost == "" {
		dockerHost = "unix:///var/run/docker.sock"
	}
	containerClient, err := container.NewDockerClient(
		container.DockerClientOptions{
			Host: dockerHost,
		},
	)
	if err != nil {
		return nil, err
	}
	runner := run.NewRunner(
		source.NewSourcer(),
		graph.NewGrapher(),
		containerClient,
		a.storeClient,
		a.timer,
	)
	runID, err := runner.Start(startPipelineRunRequest.PipelineSource)
	if err != nil {
		return nil, err
	}
	return &pps.StartPipelineRunResponse{
		PipelineRunId: runID,
	}, nil
}
예제 #2
0
파일: api_server.go 프로젝트: sr/pachyderm
func (a *apiServer) StartPipelineRun(ctx context.Context, request *pps.StartPipelineRunRequest) (*google_protobuf.Empty, error) {
	runner := run.NewRunner(
		graph.NewGrapher(),
		a.containerClient,
		a.storeClient,
		a.timer,
	)
	if err := runner.Start(request.PipelineRunId); err != nil {
		return nil, err
	}
	return emptyInstance, nil
}
예제 #3
0
func (a *apiServer) StartPipelineRun(ctx context.Context, startPipelineRunRequest *pps.StartPipelineRunRequest) (*pps.StartPipelineRunResponse, error) {
	runner := run.NewRunner(
		source.NewSourcer(),
		graph.NewGrapher(),
		a.containerClient,
		a.storeClient,
		a.timer,
	)
	runID, err := runner.Start(startPipelineRunRequest.PipelineSource)
	if err != nil {
		return nil, err
	}
	return &pps.StartPipelineRunResponse{
		PipelineRunId: runID,
	}, nil
}