-
Notifications
You must be signed in to change notification settings - Fork 27
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
Create a Workflow component #90
Comments
Examples: @oliver-sanders the |
DockPanel! Awesome! |
While it looks powerful, I am not sure that PhosphorJS is the right way to approach creating our UI frame components (panels, tabs, menus etc,). Would it not be much simpler to use Vue component(s) designed for this purpose, so we can create a solution most customised to our own requirements, & so it/they are simpler to incorporate being Vue-based? From a quick look at the Awesome Vue listing, I can find some components that do very similar to that shown for PhosphorJs. For instance, there is a huge list of possibilities for the UI layout & some more for tabbing. Lots of great features are included in some/most: responsivity, drag, drop, . Some decent examples for are:
Actually, I was hoping to be able to have a go at implementing something for the UI frame components, using one the above. How far along are you on this @kinow? If you haven't started, can I take over, as I have some spare time? Otherwise don't worry, I can find something else. Thanks. |
It would be grand to have you working on this Sadie! And no need to follow what I described here. It was what I found when looking at JupyterLabs, but if we have something done in Vue.js, then it might be even easier. Thanks for stepping in! |
|
|
??? |
Ops, wrong issue! |
Wrong issue as well 😄 |
The PhosphorJS project has been archived, and is not maintained any more. Jupyter has started lumino fork to maintain it and use it in JupyterLab. For now it should be possible to use the phosphor docs while experimenting with lumino. |
Also spent some time looking at the project referenced by @sadielbartholomew (thanks!). Here's a comparison table:
Four can be discarded, IMO.
That would leave us with two options, lumino and vue-grid-layout. Both have pros and cons. luminoA fork by the Jupyter team from the archvied PhosphorJS project. It is being maintained mainly for JupyterLab. The first issue is that the project is new, so there are no docs. We can probably rely on the PhosphorJS documentation for now. PhosphorJS' main developer has left the project. So there is no guarantee on when issues will be addressed (they are going to be busy for a while with the new project bootstrap), nor if they will have the know-how of the old project internals. Finally, there is a risk that the code is contaminated by Jupyter-specific code. The pros is that even though the project is not a vue component, it should be fairly easy to create a wrapper to vue-ifies it. And it checks most boxes for the features we need. Its main advantage is that is has several components that interact with each other. So we can have a dynamic canvas (the widgets area is dynamic, where a widget can occupy 1 unit of size, or more), widgets can be resized, and it can also have tabs. Other solutions will require us to wire everything up together, forcing us to maintain more code. vue-grid-layoutNot as powerful as lumino, but provides very similar functionality. Its learning curve is way less steep than lumino's. Adding it to the project should be fairly straightforward. Its only issue is that it doesn't support tabs. Not sure if it would be easy to add tabs. Vue has other components that provide tabs, but we would have to "sync" the vue-grid-layout with the tabs, meaning that we would have to listen to events, propagate them, and make sure everything works well together. ConclusionFor now, I think the simplest is vue-grid-layout for a quick experiment. Where we have a simple canvas like their demo. It would start empty, and users could then add a Tree or a Graph to the workflow area/canvas. Any objection? This issue will be probably split into other issues, and have more follow up issues. @sadielbartholomew feel free to chime in and volunteer if you would like to work on anything related to this issue. It is not high priority. My next priority will be mutations, but I'm working on it while other PR's are reviewed 🙂 |
Thanks for doing this, the table is really helpful. I think my preference would be Lumino as it gives us everything we need out of the box. My thinking would be that Vue support isn't important for this and trying to get an interchangeable tabbing system working with "dynamic widgets" is pretty darned hard. If Lumino is difficult and we want to use Vue-Grid as a stepping stone ... |
After I finished testing the subscriptions/websockets this morning, I had a go at Lumino. This branch contains a With little documentation for both Lumino and Phosphor, I got stuck now where I need to create a The current issue is that it is not clear to me how I get a Vue component, and convert/wrap/integrate into a Lumino widget. But once that's done, in theory, we should have a working prototype that resembles JupyterLab 🤞 |
(the GIF doesn't show my mouse cursor, but I am clicking on Add View link on the top right corner several times to add the widget/tree) Branch updated, a few console errors now that I am trying to understand how to avoid (they are from Lumino, not from Vue or Cylc UI). Already spent some time (30mins) overriding the Lumino default CSS theme to look more like the design sketches. Once I have fixed the console errors, it will be missing:
But right now I would say it's near 50% done? |
Ready for a draft PR. |
Thanks for chiming in over on the lumino docs: sorry we haven't been more responsive, but taking on another upstream is a bit of a challenge for the already heads-down-trying-to-get-a-major-version-out JupyterLab team. Basically, the only magic in wrapping insert-framework-hotness-here in a Widget is a DOM node you plan to manage, e.g.
or using your framework to use the node it gets.
(though you'd probably do them inside a subclass, etc.). It pretty much gets out of the way after that, though you might want to overload some lifecycle methods like There isn't a lot of in-the-wild examples of wrapping lumino/JupyterLab components inside other app frameworks, as especially Here's the deepest I've delved into Lumino/JupyterLab/Vue, which was picked up by the community to move a bit further (though it kinda looks like that would make a lot of Vue objects, but then, I don't really understand how vue works). Another approach is to extend the JupyterLab application itself, which isn't as insane as it sounds especially if you don't plan on supporting third-party extensions. Indeed, it's possible to write plugins that work for any lumino application. A good starting point is the notebook example which is kind of the minimum testable product for reusing lab components. Hopefully we'll be able to get something moving on the docs front, soon! |
Hi @bollwyvl ! Thanks for the detailed reply. I will go through it again in two weeks once the summer break is over and I will start working on our Vue component that is using Lumino (still in a PR, but looks like we will go down that route). Oh, and I thought I recognized your GitHub username. Looks like this is your second time helping us, thanks for this and also for the So in theory, once everything is working, we should have that code helping to send the data to Vue.js & ApolloClient, which puts the data in the store for Vue to react and then create/update components, which will be Lumino widgets too. I will have to take a look at your explanation and links to see if the approach I did is similar to what others have out there. |
Funny little world! Enjoy the holiday!
I confess utter ignorance of your product, of course, but as you may guess,
if there's any overlap between you're users and jupyter users, I'd also
recommend investigating getting your novel client pieces into the
jupyterlab client as an extension... Especially if you have a
well-constrained data file format. This could span from a custom editor, a
live preview, a renderer or a jupyter widget... Or a custom lab app.
While everyone likes to control their own window, the serendipity of having
multiple features can often yield something even more powerful.
The server piece looks more heavy duty... But given the pr referenced
above, if you're already on the event loop, you could be running right
inside the notebook server (or kernel), if that has any value (even for
development or training).
…On Sat, Dec 28, 2019, 01:17 Bruno P. Kinoshita ***@***.***> wrote:
Hi @bollwyvl <https://github.com/bollwyvl> ! Thanks for the detailed
reply. I will go through it again in two weeks once the summer break is
over and I will start working on our Vue component that is using Lumino
(still in a PR, but looks like we will go down that route).
Oh, and I thought I recognized your GitHub username. Looks like this is
your second time helping us, thanks for this and also for the graphql-ws pull
request <graphql-python/graphql-ws#25>. Even
though that's pending, we have incorporated your code in our code base for
now, until they finish the review.
So in theory, once everything is working, we should have that code helping
to send the data to Vue.js & ApolloClient, which puts the data in the store
for Vue to react and then create/update components, which will be Lumino
widgets too. I have to take a look at your explanation and links to see if
the approach I did is similar to what others have out there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90?email_source=notifications&email_token=AAALCRCONDGM5S6JDV5XQFLQ23VQLA5CNFSM4HZXXE72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYDJWY#issuecomment-569390299>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALCRGYA6LU7SZLEWAI2PDQ23VQLANCNFSM4HZXXE7Q>
.
|
We have a way to start our app in "offline" mode, without the need for the server. I've deployed the version with Lumino here: https://kinow.github.io/#/workflows/one If you click on "Add View" on the right top corner, and choose "Tree" (Graph is slightly broken ATM), that will add a new Vue component/Lumino Widget. The difference from the real, non-offline mode, is that this Vue.js app is accessed through a Tornado application. And this Tornado application is actually imitating JupyterHub's Our workflow service is composed of several parts, one being the UI Server, which is basically this Tornado app running behind JupyterHub. Once logged in, users should initiate a WebSocket sending GraphQL queries to the UI Server (which is replying it using your code), that will serve workflows data (it aggregates data from workflow servers). So I am not sure if a JupyterLab extension would work for us. We have a UI that has other parts, where the Lumino widgets will be just a part of it - though one of the most important parts. Although what you are suggesting could work as well... instead of a complete Vue.js app, we could create some JupyterLab extensions instead, and perhaps we would have a similar UI. I guess it depends on how much control we need over the UI, and how much JupyterLab can be extended. Do you know if it is easy to control authorization in JupyterLab? e.g. we will need to limit what users see, what actions they can execute in some of the widgets/components. CC @oliver-sanders (who had the idea to use Lumino and copy JupyterLab). Good food for thought @bollwyvl, we will have a developer meetup in New Zealand in about two months. I will try to explore more this idea. Thanks! |
Very exciting stuff! Obviously no pressure on any of these fronts, just trying to be helpful, but I'm always look for ways to poke open source tools into supporting rich integration into Lab/Hub vs just "iframing it"/"shelling out"!
If users can ever interact with data that is like what is in the cool offline demo, then a MimeRenderer might fit the bill. If the data is live, widgets can go further, and can support both lab/classic, though it's tricky: luckily there's help.
Integrating with Hub is always exciting! But is really the value-add of the Jupyter ecosystem, if you have users that at some point will be consuming your data programmatically: it's no fun to build import/export mechanisms to lossy formats like csv/excel or (gasp) word if they then have to turn around and write a parser to get them into a dataframe. Giving users a (insert kernel here)-compatible client, and being able to use their credentials in-kernel is amazing, e.g. jupyterlab-dask, especially if the magic of hub takes care of all the auth business. Specifically on the GraphQL front, I've wanted to build a generalized GraphQL subscription widget, but haven't gotten around to it.
The sky is pretty much the limit: I usually suggest folk start with a
In addition to the above, you'd be able to add new things to the main menu, the status bar, command palettes, keyboard shortcuts, per-user settings, (multiple) workspace restoration/import/export, etc. In addition, external links that you want to keep as iframes can be trivially directly in the dockpanel (though navigation is somewhat impeded, as is the ability to create bookmarks, etc). You can eventually go way beyond what is in core, and selectively disable or replace existing things... but at some point, if you disable too much stuff (basically
Assuming the GraphQL frontend is a hub-managed service, the client would likely already have the right tokens set from their initial login. The Lab component would likely be able to use those creds to open the connection. Another approach is to move some of the complexity to inside each user's spawned notebook server, as is done on jupyterlab-github. Then you can use the "standard" As to selectively disabling/enabling features with the same build, I'd usually try to model it in the GraphQL layer: a pattern I have had to implement is a Happy to keep ruminating! Excited to see what you folks come up with! |
A lot of things to go through and read/learn/experiment. Thanks heaps @bollwyvl ! Will wait for others to return from summer holidays too and chime in. In the meantime might have time to try some of what you suggested. I am also involved with a possible GSoC for next year with Jenkins & ML, where we are trying to port a plugin (active choices) to JupyterLab extensions, then drive Jenkins (or other workflow runners) in the background. Might drop by Jupyter's GitHub/Gitter later to ask for help, but might use some of your suggestions there as well (discussions open in gitter too). Oh, about that offline mode, I forgot to mention that's used only for development. So instead of needing the hub, the UI Server, Python, etc, it basically mocks the response from the GraphQL so developers can quickly see what components will look like. So I used it just so you could take a look without having to install anything :-) But MimeRenderer looks interesting! Another link to the bookmarks to read later. Thanks again!! |
We had considered offering cut-down components of our framework as Jupyterlab extensions, the idea of orchestrating the entire UI via Jupyterlab hadn't occurred. In terms of interaction between Jupyterlab and Cylc, users run workflows with Cylc, these workflows spit out data which they may want to poke around with interactively, some are already using the Jupyter environment for this. It would be nice to streamline the development => workflow => analysis process, Jupyterlab provides a promising platform for this. Some benefits:
My initial thinking is that implementing the Cylc UI via Jupyterlab would result in a reduction in functionality and usability from the Cylc perspective, this would outstrip functionality gains mainly for people running larger numbers of workflows. Despite similar appearances there are fundamental differences in what we are trying to achieve, but it's worth experimenting, I might be wrong and it would be a very interesting union if it could be pulled off. Some of the hurdles we would need to get past (off the top of my head):
Some avenues for exploration (off the top of my head):
|
Lots to chew on there. I'll start with what I can see on my screen while replying, and work my way backwards...
Sure: in Lab parlance, this might be a
Depends on what you mean by "workspace"... a lab workspace incorporates all of the sources/sizes of open tabs, the state of the sidebars, and a few other things. But you could also default to "single document mode" Ctrl-or-⌘+Shift+D, and let each workflow act as a workspace, controlling its own DockPanel of many tabs, and never really present the lab many-tab view. But if you did need many workflows in the future, you're ready to go... it would just take some doing to prevent views from "escaping" from a workflow DockPanel into the main (or each others!) DockPanel.
Right: each suite could act like its own file browser. An examples of this is
Yes. In fact, shipping a "gold master"
Sure! Like I said, I'm just trying to build some 🌉, and help users downstream that might want to use Jupyter +
Many of the bells and whistles can be stripped away, either for real by (notionally) |
No problem: either feed them yourself to
Yeah, this would be a "command" invocation, |
Throughout lab, there is the
Yup, just don't read what you don't need. The only real gotcha is if a model must be interpreted as entirely different model serializations: we run into this with JSON-as-text and JSON-as-JavaScirpt-Objects: non-trivial to keep in sync, as text can sometimes not be JSON, even if you say it is.
See |
As mentioned above, Lab is more model oriented, but folks are usually interested in models of... files and kernels :P
As mentioned above, you can have many views (tabs) of the same model (be it a kernel, file or... other).
See thoughts about "single document mode" above. You can hide complexity until you need it...
As mentioned above, you can have many (separate) views into the same model, and one view can encompass multiple models. An example: a code editor might have a text model of a Python source file, but be tied to a model of a running kernel. That kernel model can be shared with a running notebook (which has an evented JSON model) and a running console (which doesn't really have a file, but sort of does).
This is where the lumino/lab approach starts to make sense, as we've already fought a lot of these dragons. |
This was meant more of, "are you using something that is schema constrained"? If you're not stuffing huge, unpredictable stuff into strings, GraphQL makes is basically impossible to not be well-structured.
Right. |
@bollwyvl thanks for all this info! I think we've got some digging to do now, particularly with Labs models, "single document mode" and try to figure out how users might want to bridge between Cylc workflows and other Labs components. |
Thanks indeed @bollwyvl ! I've got a huge list of things to read about, but will start by going through some of your links, and trying to play with existing widgets, and maybe create a small one too. |
As long as you make your pieces small and unopinionated enough (e.g. don't be writing graphql in your mouseover event), it's unlikely you'd need to strip anything down, just not use part of it.
Hooray! Give people a graph/table/model/analysis/database (Thing), and they'll keep asking you for another, bigger, faster, more interactive Thing linked to more kinds of Things. Give them a (self-)documented, evented, easy-to-install, sanely-versioned API client in their language of choce that can access the data underlying the Thing that they can run in a notebook, and work in/around/next to the Thing you gave them, and they will amaze you with what they can build.
And if you don't like CodeMirror, there's plugins for other renderers, e.g. monaco (what powers vscode). Also emacs bindings!
The same terminal that is in vscode. Also runs emacs!
Yeah, dunno what those are!
I can't quite parse that, but Lab just offers a modular approach to building high-interactivity work environments, and happens to already offer a bunch of interesting kinds of work that can be done.
Indeed!
I'm all out of stuff to respond to, but yeah: I think the future of work lies in bringing a scientist the 80% solution in off-the-shelf, open source UI/auth/infra/vcs/data/pkgmgmt, and leaving them the tools they need to build their remaining 20%... in as close a proximity as possible. |
Thanks for the link. I had a look at the issue, and at the linked repo. That's interesting. It does the reverse of what I did. Instead of using a Widget with Vue, the repo linked shows an example of using Vue with JupyterLab. Which is still interesting, but not exactly what I was trying to achieve. But if we move in the direction of using JupyterLab for Cylc, that might be a way to migrate our existing Vue app to within JupyterLab :-) So far I've been able to keep Vue components & Lumino widgets in sync, mainly through a central event bus. Then I capture the Lumino events, do whatever is required (e.g. destroy a tab/widget in a boxpanel) then emit another event for Vue (e.g. destroy a component that was rendered in a tab/widget). |
Sounds intense! If that component (e.g a vue wrapper for dockpanel) is
sufficiently self-contained, that would make a great package, e.g
lumino-vue-dockpanel, or at least an examples/vue/dockpanel which could be
included in the docs and test infra. _Lumino for X_ is something that we
haven't been focused on so much, but would no doubt be value-add to the
community.
…On Wed, Jan 8, 2020, 20:32 Bruno P. Kinoshita ***@***.***> wrote:
@bollwyvl <https://github.com/bollwyvl>
Here's the deepest I've delved into Lumino/JupyterLab/Vue, which was
picked up by the community to move a bit further (though it kinda looks
like that would make a lot of Vue objects, but then, I don't really
understand how vue works).
Thanks for the link. I had a look at the issue, and at the linked repo.
That's interesting. It does the reverse of what I did. Instead of using a
Widget with Vue, the repo linked shows an example of using Vue with
JupyterLab. Which is still interesting, but not exactly what I was trying
to achieve.
But if we move in the direction of using JupyterLab for Cylc, that might
be a way to migrate our existing Vue app to within JupyterLab :-) So far
I've been able to keep Vue components & Lumino widgets in sync, mainly
through a central event bus. Then I capture the Lumino events, do whatever
is required (e.g. destroy a tab/widget in a boxpanel) then emit another
event for Vue (e.g. destroy a component that was rendered in a tab/widget).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90?email_source=notifications&email_token=AAALCRHO4NE4R2JMXBSEJBLQ4Z5BBA5CNFSM4HZXXE72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIOTHXI#issuecomment-572339165>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALCRF2NJEI4CJXD6WUXH3Q4Z5BBANCNFSM4HZXXE7Q>
.
|
Good idea @bollwyvl ! I've added a post-it to polish the code and submit as an example later. Not sure if that's the best code example, but sharing should give others an opportunity to either re-use, or provide feedback on better alternatives—so a win-win I think. Thanks! |
Yeah, gotta start somewhere! Just having a pr to point people towards and
be found by search engines would help.
Another approach may be to make a (working) cookiecutter/yeoman repo that
encapsulates and tests the example. In Jupyter, we've been favoring cc, as
it's simpler, but yo is more broadly used in the js crowd.
If nothing else, it would motivate deciding if such things belong in the
main repo, or in a contrib-examples repo... No doubt adding every framework
under the sun would bloat the install/test cycle.
…On Fri, Jan 10, 2020, 03:34 Bruno P. Kinoshita ***@***.***> wrote:
Good idea @bollwyvl <https://github.com/bollwyvl> ! I've added a post-it
to polish the code and submit as an example later. Not sure if that's the
best code example, but sharing should give others an opportunity to either
re-use, or provide feedback on better alternatives—so a win-win I think.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#90?email_source=notifications&email_token=AAALCRDONTNL5XKWZ2HK22LQ5AXJRA5CNFSM4HZXXE72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEITDJBY#issuecomment-572929159>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALCRCVZGKWUUGD5NFVHF3Q5AXJRANCNFSM4HZXXE7Q>
.
|
This is related to #87 and #75 .
@oliver-sanders showed us the JupyterLab application, which allows users to add as many notebooks as they like to a sort of dashboard panel.
This looks like an experiment worth a try - with the risk of having some performance issues due to the number of workflows open simultaneously. So I think a Workflow view could be used for that.
JupyterLab uses PhosphorJS. From their about:
In order to include it in our current application, we would need something similar to the following steps:
Workflow
component, that simply loads the Phosphor main viewWorkflowTreeView
component (simpler than the graph for this experiment)WorkflowTreeView
can be added multiple times to theWorkflowTreeView
component panel - that probably means using props or some other mechanism in the component to pass the workflow we want it to displayWith that I think we would be able to have something similar to JupyterLab.
The text was updated successfully, but these errors were encountered: