Hello I'm a kfp beginner. I tried to run a hello pipeline like this.
pip install kfp
from kfp import dsl
@dsl.component
def say_hello(name: str) -> str:
hello_text = f'Hello, {name}!'
print(hello_text)
return hello_text
@dsl.pipeline
def hello_pipeline(recipient: str) -> str:
hello_task = say_hello(name=recipient)
return hello_task.output
from kfp import compiler
compiler.Compiler().compile(hello_pipeline, 'pipeline.yaml')
Then I upload the pipeline before get the error message:
{"error_message":"Error creating pipeline: Create pipeline failed: templates.pipeline templates.pipeline must have at least one task","error_details":"templates.pipeline templates.pipeline must have at least one task\nCreate pipeline failed\ngithub.com/kubeflow/pipelines/backend/src/common/util.Wrap\n\t/go/src/github.com/kubeflow/pipelines/backend/src/common/util/error.go:287\ngithub.com/kubeflow/pipelines/backend/src/apiserver/resource.(*ResourceManager).CreatePipeline\n\t/go/src/github.com/kubeflow/pipelines/backend/src/apiserver/resource/resource_manager.go:263\ngithub.com/kubeflow/pipelines/backend/src/apiserver/server.(*PipelineUploadServer).UploadPipeline\n\t/go/src/github.com/kubeflow/pipelines/backend/src/apiserver/server/pipeline_upload_server.go:119\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2047\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2879\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1930\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581\nError creating pipeline\ngithub.com/kubeflow/pipelines/backend/src/common/util.Wrap\n\t/go/src/github.com/kubeflow/pipelines/backend/src/common/util/error.go:287\ngithub.com/kubeflow/pipelines/backend/src/apiserver/server.(*PipelineUploadServer).UploadPipeline\n\t/go/src/github.com/kubeflow/pipelines/backend/src/apiserver/server/pipeline_upload_server.go:121\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2047\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2879\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1930\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1581"}
But it can worked when I change to func_to_container_op
this method.
Does the hello_task = say_hello(name=recipient)
not a "task" it need?