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

KS-198: Workflow Spec Approval #13181

Merged
merged 9 commits into from
May 21, 2024
Merged

KS-198: Workflow Spec Approval #13181

merged 9 commits into from
May 21, 2024

Conversation

krehermann
Copy link
Contributor

@krehermann krehermann commented May 10, 2024

Add minimal code path for wf spec auto approval via feeds manager

core/services/feeds/service.go Outdated Show resolved Hide resolved
@@ -1128,6 +1180,24 @@ func (s *service) generateJob(ctx context.Context, spec string) (*job.Job, error
js, err = ocrbootstrap.ValidatedBootstrapSpecToml(spec)
case job.FluxMonitor:
js, err = fluxmonitorv2.ValidatedFluxMonitorSpec(s.jobCfg, spec)
case job.Workflow:
// TODO what the right way to validate a workflow spec?
Copy link
Contributor

Choose a reason for hiding this comment

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

@HenryNguyen5 to confirm

Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be merged, handling it after CRIB #13125

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what is the eta for that? this feature is largely independent of validation details and needs to be merged for the CLO timeline of EOM. said differently, we can update the validation logic after this if we need to change it

core/services/feeds/service.go Show resolved Hide resolved
core/services/feeds/service.go Show resolved Hide resolved
core/services/feeds/service.go Outdated Show resolved Hide resolved
bolekk
bolekk previously approved these changes May 21, 2024
Copy link
Contributor

@bolekk bolekk left a comment

Choose a reason for hiding this comment

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

lint failing - unrelated to your changes but still :/

func isWFSpec(lggr logger.Logger, spec string) bool {
jobType, err := job.ValidateSpec(spec)
if err != nil {
// this should not happen in practice
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there's a lot of duplication around validating specs. I guess it's necessary for each function individually but it appears like it's getting called up to 4 times. Not a big deal but maybe we can refactor and consolidate a bit later

@@ -1058,6 +1106,11 @@ func (s *service) observeJobProposalCounts(ctx context.Context) error {
return nil
}

// TODO KS-205 implement this. Need to figure out how exactly how we want to handle this.
func findExistingWorkflowJob(ctx context.Context, wfSpec job.WorkflowSpec, tx job.ORM) (int32, error) {
return 0, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to highlight that without this being implemented, what this means is, if the job has always been managed through CLO then it won't be applicable, as the externalJobID should be able to find the existing job. However if the workflow was added outside CLO then that job needs to be manually removed first. If workflow specs are not being manually added by nops then technically the latter should also not be a problem. However, if we do hide the workflow job from the UI it would also mean that they can't remove the job either.

I don't think it's a problem for now but perhaps we should revisit so it's full proof. The query here is usually through a unique identifier that ties the job to the spec.

core/services/feeds/service.go Show resolved Hide resolved
@krehermann krehermann requested a review from bolekk May 21, 2024 18:23
@krehermann krehermann enabled auto-merge May 21, 2024 18:34
@krehermann krehermann added this pull request to the merge queue May 21, 2024
Merged via the queue into develop with commit c14576a May 21, 2024
107 checks passed
@krehermann krehermann deleted the ks-198/wf-spec-approval branch May 21, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants