Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): Fix "Unknown execution spec" error. Fixes #8256 #8287

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/apiserver/resource/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ func (r *ResourceManager) ReadArtifact(runID string, nodeID string, artifactName
if run.WorkflowRuntimeManifest == "" {
return nil, util.NewInvalidInputError("read artifact from run with v2 IR spec is not supported")
}
execSpec, err := util.NewExecutionSpec([]byte(run.WorkflowRuntimeManifest))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch and this is the only place that calls NewExecutionSpec() which assumes the content is YAML. The content is in JSON format. sorry that I didn't catch the bug when doing the abstraction interface.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a TestReadArtifact_Succeed test case and it doesn't fail. I guess the testing data can pass the yaml.Unmarshal magically. thinking if we can update the test case to catch up with this kind of error. I can work on that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which assumes the content is YAML. The content is in JSON format

I had the impression that because YAML is a superset of JSON, normally YAML serialization/deserialization libraries can handle both YAML and JSON (Didn't check if that's the case here, I probably got this impression from some Python library)

there is a TestReadArtifact_Succeed test case and it doesn't fail.

I noticed the test as well. I think in my debugging of KFP runtime, run.WorkflowRuntimeManifest at this point doesn't carry the TypeMeta part. It was unclear to me that if it should at this point, or maybe the type needs to be told (by passing util.ArgoWorkflow) like the rest NewExeuctionSpec* calls. The latter seems making sense to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, I would say it should carry TypeMeta and also specify util.ArgoWorkflow. at least so far we haven't supported dynamically switching orchestration engine yet :-p

execSpec, err := util.NewExecutionSpecJSON(util.ArgoWorkflow, []byte(run.WorkflowRuntimeManifest))
if err != nil {
// This should never happen.
return nil, util.NewInternalServerError(
Expand Down