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 exec node resource calculation on non-isolated CRI-powered job environment #277

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

kruftik
Copy link
Collaborator

@kruftik kruftik commented Jun 10, 2024

No description provided.

@@ -146,7 +146,7 @@ func (n *baseExecNode) doBuildCRISidecar(envSpec *ytv1.JobEnvironmentSpec, podSp
}

if n.spec.JobResources != nil {
jobsContainer.Resources = *n.spec.JobResources
jobsContainer.Resources = *n.spec.JobResources.DeepCopy()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't found where the value was overriden in code though.

But we shooting ourselves in a leg using mutable instanceSpec object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right, this specific field isn't changed anywhere in the code. I just 'fixed' it to be the same looking as the node resources where the bug has appeared.

@l0kix2 l0kix2 merged commit b2fdf69 into ytsaurus:main Jun 11, 2024
6 checks passed
}
}

func getYtsaurus() *ytv1.Ytsaurus {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please DO NOT COPY-PASTE such test assets. It will be impossible to maintain.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Kruft can you please fix this tests with reusing CRD building from another package?

}
}

func getYtsaurus() *ytv1.Ytsaurus {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Kruft can you please fix this tests with reusing CRD building from another package?

cfgen: g,
spec: &execNodeSpec,
sidecarConfig: nil,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also this test looks rather fragile since it tests low-level implementation of the component and will often broke on refactorings. Does it really test something that couldn't be tested in ytconfig tests?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've reverted this particular test file #281
Could you please send another PR with test if you feel it is needed (I expect them to be among ytconfig tests and without manipulating base struct)?

leo-astorsky pushed a commit to leo-astorsky/yt-k8s-operator that referenced this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants