-
Notifications
You must be signed in to change notification settings - Fork 45
RHOAI-4148: Re-adjust the statefulset, route, service based on generateName #539
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
RHOAI-4148: Re-adjust the statefulset, route, service based on generateName #539
Conversation
Skipping CI for Draft Pull Request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
==========================================
- Coverage 56.47% 55.28% -1.20%
==========================================
Files 10 10
Lines 2686 2780 +94
==========================================
+ Hits 1517 1537 +20
- Misses 1054 1120 +66
- Partials 115 123 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
04facee
to
32f2412
Compare
32f2412
to
fe7b9cb
Compare
This is good work, but I worry it's not really all that much helpful to fix https://issues.redhat.com/browse/RHOAIENG-4148 For odh/kubeflow, the thing to help with the customer issue, would be to reject Notebook CR creation immediately, instead of getting stuck creating route, or whatever, later. The largest weight lays on Dashboard which simply cannot put the username into the Notebook CR name, because the usernames can be long. It is a good change, but it will not resolve RHOAIENG-4148 alone. Also, it is getting us towards which is probably a good direction to move towards. |
fe7b9cb
to
c788a91
Compare
Ftr, there's a new feature in rhods operator to let admin change the Jupyterlab namespace, https://issues.redhat.com/browse/RHOAIENG-22096 Default still is
|
Great point, noticing that, I was trying to change the logic for making it more generic 👍 |
/lgtm I've been thinking about this and while I still believe what I said/thought before (the change does not really fix customer issue, change will move our logic further from upstream kubeflow notebooks, the branching logic for the route takes time to understand), I don't see anything wrong with this. In the interest of making further progress, I think we should merge this. It will fix some scenarios, upstream kubeflow is not really making any changes in the 1.x notebook controller codebase, and the logic is not too bad and worst case chatgpt can help explain if I ever stumble with it. Ship it! |
Signed-off-by: Harshad Reddy Nalla <[email protected]>
Signed-off-by: Harshad Reddy Nalla <[email protected]>
Signed-off-by: Harshad Reddy Nalla <[email protected]>
c788a91
to
c156792
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Do we want to do something with the failing CI code static analysis check?
AFAIK it's not failing in main? |
components/notebook-controller/controllers/notebook_controller.go
Outdated
Show resolved
Hide resolved
} | ||
if isGenerateName { | ||
ssObjectMeta = metav1.ObjectMeta{ | ||
GenerateName: "nb-", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this look like in the real world? isn't it too generic? I mean - would it make sense to have at least some portion of the actual original instance.Name
here so it's at least somehow traceable to the original user via oc get ...
command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this look like in the real world? isn't it too generic?
As this change would only happen if isGenerateName
is set, which depends on notebook name to be larger than 52 char. In ODH scenario, it is only possible via jupyter tile , as DS project has slices notebook name above 30 char.
In jupyter tile, user dont get to set the notebook name on the UI, so on console it would show up as nb-
user can query them via cli using:
oc get notebook --all-namespaces -l opendatahub.io/user={username}
or
oc get statefulset --all-namespaces -l statefulset={notebook.name}
`
we could have some part of instance.name, i wasn't sure, what slice should it be prefix or suffix end of instance.name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. My intention here was to make it easier to distinguish also on the pods level - when one lists the pods from rhods-notebooks namespace (Jupyter tile), then with this change it will not be possible to match relevant pods based on their name to the users anymore at all.
I don't insist. The solution using the label may be good enough. I was just trying to be sure that introducing this change we're not making this a bit more complex for eventual customer automation they could have.
But yeah, I don't really insist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, i do feel inline with you.
With this case being exclusive to jupyter tiles, keeping the name sequence could be a way. Perhaps we can do this in next iterations.
I understand and agree with @jiridanek's comments. Since some of these are mostly due to OCP's own limitations and requirements, this PR will be a great fix to these issues already. Tests are present, only some linter checks appearing on CI, but everything looks good! /lgtm |
Co-authored-by: Jan Stourac <[email protected]>
- ST1023: should omit type bool from declaration; it will be inferred from the right-hand side (staticcheck) - QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck) Signed-off-by: Harshad Reddy Nalla <[email protected]>
/lgtm |
/retest-required |
Thank you for all the reviews |
https://issues.redhat.com/browse/RHOAIENG-4148
Description
Re-adjust the statefulset, route, service based on generateName
The setup on Opendatahub allows spin-up of workbenches, via
Way of naming in the above methods:
jupyter-nb-<encoded-username>
Length issue on Jupyter Tile:
jupyter-nb-
that is 11 len, here.Explanation:
(<route-name>-<namespace>)
:<route-name>-<namespace>.<domain>
In ODH username above 36 chars were failing , fixing the Route name to generated using Kubernets generateName method, we can fix the route sub-domain issue.
Upon further exploring found that labels have length constraint of 63 chars.
The controllerRevision, adds a hash that is 8-10Chars, which adds 11 chars to a label of statefulset.
Given a workbench in jupyter-tile, that allows:
username: 63- (len of prefix jupyter-nb i.e 11) - (len of hash i.e 11) = 41
In ODH username between 36-41 chars were failing in statefulset creation stage , fixing the Statefulset name to generated using Kubernets generateName method, we can fix the controller-revision-hash label.
With this, username can be up to 52 chars.
as there are other labels, which would fail the 63 chars limit (app, notebook-name labels)
End Result:
Old username limit: max 36
New username limit: max 52
Related-to:
#179
https://issues.redhat.com/browse/RHOAIENG-4148
How Has This Been Tested?
TBD
Merge criteria: