aaw icon indicating copy to clipboard operation
aaw copied to clipboard

2.0: New namespace + name generation

Open wg102 opened this issue 2 years ago • 11 comments

New feature for AAW 2.0

-> When a new user logs in for the first time, show the 'create a namespace' pop up. -> Generate the username based on firstname-lastname(possible digit if it already exists)

See https://github.com/StatCan/aaw/issues/1909, possibly make code so it detects a specific username for now, since testing without a namespace might be harder. It will need to be tested for the number feature regardless.

(ref 1). ref 2

wg102 avatar Dec 13 '23 13:12 wg102

Note: Use a "Next: button instead. Where is the email gonna validate

wg102 avatar Dec 13 '23 16:12 wg102

template(is='dom-if', if='[[registrationFlow]]') this is what defines if the popup shows. I will disable it for now, since this is not what I want to test, but I want to modify the landing-page(user-details='[[_extractLdap(user)]]' on-flowcomplete='resyncApp', language='[[language]]', resources='[[resources]]')

wg102 avatar Dec 14 '23 14:12 wg102

The page was removed on this commit https://github.com/StatCan/kubeflow/commit/befdcc07572cf37897f542293989b9265e819b2a during the 1.7 upgrade.

Now that I found this, I can find when we had the create function as well

wg102 avatar Dec 14 '23 19:12 wg102

First idea for wizard text:

Welcome

This seems to be the first time you access Kubeflow!
We are happy to see you

The email you are using is:
(input with the email - readonly)

Your namespace will be
(input with namesapce - readonly)

If you have questions or issues, please contact our Slack support channel at https://statcan-aaw.slack.com

[Next button]

wg102 avatar Dec 18 '23 13:12 wg102

Current slight issue with the md2-input, it has a property to handle disabled, but it was never added to the UI, hence why it never triggered. see here Now I just need to edit the pug code of upstream (in our repo) to most likely fix this issue. Once that is dealt with, the algorithm is next, to generate the name

wg102 avatar Dec 18 '23 18:12 wg102

The current visuals is looking like this: image

wg102 avatar Dec 20 '23 16:12 wg102

Links to the old generation of namespace https://github.com/kubeflow/kubeflow/blob/65d1bfed1853c9db3972c4aae1090fae417ff769/components/centraldashboard/public/components/registration-page.js https://github.com/StatCan/kubeflow/blob/a422476d2a6d1cdf9d2f2ff3d57710672564f4ed/components/centraldashboard/public/components/registration-page.js

wg102 avatar Dec 28 '23 13:12 wg102

image French has not being translated, so it's a bit glitchy.

wg102 avatar Jan 03 '24 15:01 wg102

The visual for French looks right, image

but the button is having trouble

wg102 avatar Jan 03 '24 18:01 wg102

The code now seems to work, at least for the generation of the namespace, I did hit another issue, the api of jupyter i was calling to verify if the namespace existed will not work because of how authentication is done. jupyter/api/namespaces/${namespace} Since when the namespace exists and you have rolebindings, you get 200, but when you don't have rolebindings you get 403, and when it does not exist, you also get 403. Therefore you cannot discern if the namespace actually exists or not if you don't have rolebindings to it, and since it's before creating the namespace, it might clash with another one.

wg102 avatar Jan 08 '24 14:01 wg102

The issue was mostly in the Promises, it was coded wrong, and the sequence was not the best. After a few tries, I bypassed the issue by having the promise be the one setting the value to the textbox, which will only populate when the data is done.

wg102 avatar Jan 08 '24 20:01 wg102