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

Jupyter web app should respect namespace in central dashboard #2845

Closed
jlewi opened this issue Mar 28, 2019 · 10 comments · Fixed by #3244
Closed

Jupyter web app should respect namespace in central dashboard #2845

jlewi opened this issue Mar 28, 2019 · 10 comments · Fixed by #3244
Assignees
Labels
area/jupyter Issues related to Jupyter priority/p1

Comments

@jlewi
Copy link
Contributor

jlewi commented Mar 28, 2019

Screenshot
jupyternamespace

The central dashboard is displaying the jupyter web app in an iframe.

The central dashboard has a namespace selector. This namespace selector is not wired up to the
jupyter web app.

/cc @avdaredevil @kimwnasptd @vkoukis

@avdaredevil this might be a good opportunity to figure out how the namespace selector should interact with individual web apps.

@jlewi jlewi added priority/p1 area/jupyter Issues related to Jupyter labels Mar 28, 2019
@vkoukis
Copy link
Member

vkoukis commented Mar 28, 2019

@jlewi we could get this in for 0.5, but we need a precise description of how the namespace selector works.

Will it be functional in 0.5? I guess the question is, who is responsible for listing K8s namespaces, and how can iframe-d apps access the contents of this selector?

@zabbasi
Copy link
Contributor

zabbasi commented Mar 28, 2019

Similarly tf-operator and Katib dashboard's default namespace should respect namespace in central dashboard. @richardsliu @avdaredevil

@kimwnasptd
Copy link
Member

Also as a side note, in our discussion here #2521 people expressed the need to not show k8s concepts such as Namespaces to the end user.

One option that was proposed was to use the term Project instead of Namespace. Should we also take this into account for the dashboard?

@jlewi
Copy link
Contributor Author

jlewi commented Mar 28, 2019

One option that was proposed was to use the term Project instead of Namespace. Should we also take this into account for the dashboard?

One of the principles we try to follow in Kubeflow is not introducing new concepts, terms, patterns when they are already such things in K8s.

So w.r.t to namespace vs. project. If we introduce project, I think we should be creating something that is fundamentally different from a namespace. If a project is 1:1 mapping to namespace then I think we should just call it namespace.

Will it be functional in 0.5? I guess the question is, who is responsible for listing K8s namespaces, and how can iframe-d apps access the contents of this selector?

I think this is the question for @avdaredevil .

@prodonjs
Copy link
Contributor

There are a couple of different options for making the iframed applications aware of a namespace selection from its parent.

  1. The parent page injects JS into the iframe child that is invoked when the parent's namespace selector changes. This requires the parent to be aware of and manipulate the DOM state of its children. This is a bit brittle since the child app can change and any injected scripts would fail.
  2. The iframe children accept namespace as part of their URL structure or as a query-string parameter. The selector is then made to synchronize with the URL in both directions. This allows the parent to set/change the iframe's src to reflect its namespace.

I don't know that either option is feasible within the next week or so. For the time being, the 0.5.0 version of the landing page only shows the namespace selector on the Activities tab that allows a user to see recent K8s events for the chosen namespace.

@avdaredevil
Copy link
Contributor

avdaredevil commented Mar 29, 2019

+1 to Jason's points. Basically we can:

  • Establish a communication channel via JS using a event-driven model like: https://gist.github.com/pbojinov/8965299
  • Or, a one time-url query param or location hash object. For example:
    • <base-url>/route?ns=<namespace> OR .../route#ns=<namespace>

With regards to the listing. Technically when running in iframe mode, the subapp does not need to be aware of all namespaces available.

@prodonjs
Copy link
Contributor

prodonjs commented Apr 2, 2019

  • Links from Central Dashboard should include the selected namespace
  • Selected namespace should be passed down to iframed content after it's loaded

@prodonjs
Copy link
Contributor

prodonjs commented Apr 3, 2019

/assign @avdaredevil
/assign @prodonjs

@prodonjs
Copy link
Contributor

prodonjs commented May 2, 2019

@avdaredevil This issue should track the work that needs to follow #2926 to integrate the library with the Jupyter application. I'm going to create a separate issue for TFJobs dashboard.

@prodonjs
Copy link
Contributor

prodonjs commented May 3, 2019

@avdaredevil https://github.com/prodonjs/kubeflow/tree/iframe-lib-import-test is the test branch I created in my fork that has the proof-of-concept integration of the namespace selection passdown into the Notebooks server UI. That would probably be a good starting point to base your PR off of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jupyter Issues related to Jupyter priority/p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants