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

AppWrapper e2e: Remove creationTimestamp from marshalled template #630

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

sutaakar
Copy link
Contributor

Issue link

What changes have been made

Remove creationTimestamp from marshalled template for AppWrapper. This creationTimestamp is brought by marshaller (it is not omitted because it is defined as struct instead of pointer in k8s API). This field breaks Kueue reconciliation in AppWrapper for Kueue 0.8.3.

Verification steps

The change was verified in #628

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

@@ -145,6 +147,10 @@ func runMnistPyTorchAppWrapper(t *testing.T, accelerator string, numberOfGpus in
},
}

raw, _ := json.Marshal(job)
// Workaround to remove creationTimestamp which is brought by json marshaller, this field breaks Kueue reconciliation
patchedRaw := strings.ReplaceAll(string(raw), `"metadata":{"creationTimestamp":null},`, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be encapsulated into the Raw helper function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it belongs in Raw eventually.

A related point is the go dependencies in codeflare-common are very dated. Kueue, KubeRay, and AppWrapper are way behind what is current in codeflare-operator. Probably updating them is worth doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add it there as an option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the replace into dedicated helper function.
I didn't want to add it to the Raw as the manipulation of the content needs to be done on a struct pointer, so in the end I have manipulated with RawExtension anyway. In such case RawExtension can be modified outside of Raw.

@astefanutti
Copy link
Contributor

/lgtm

@sutaakar
Copy link
Contributor Author

/approve

Copy link

openshift-ci bot commented Nov 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sutaakar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit cb032ef into project-codeflare:main Nov 20, 2024
8 checks passed
@sutaakar sutaakar deleted the appwrapper-fix branch November 20, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants