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

JupyterServer: opening content in other extensions #472

Open
oliver-sanders opened this issue Jul 17, 2023 · 1 comment
Open

JupyterServer: opening content in other extensions #472

oliver-sanders opened this issue Jul 17, 2023 · 1 comment
Milestone

Comments

@oliver-sanders
Copy link
Member

The Cylc UI Server allows browsing workflows, cycles, tasks and whatnot.

We can open log files, but, the Cylc app lacks tooling to inspect and analyse task output. This is where tools like Jupyter Lab come into it.

We should make it easier to open resources associated with Cylc (e.g. data created by tasks) in other server extensions (e.g. Jupyter Lab).

E.G. We could have a button which opens a task's work directory in Jupyter Lab.

This is actually kinda possible, Jupyter Lab has a URL argument to open the server at a specific location, however, because this is done in the URL you get a new Lab instance every time you follow the link. Ideally we would like the ability to open tabs in an existing Lab session from within Cylc.

There are two ways to go about this problem:

  1. Send the message down into the server, and from the server back up to the Lab app.
  2. Use LocalStorage to send the message sideways to active Lap app sessions.

Ideally Jupyter Server would provide an interface for doing this so that all extensions can communicate in this way. Have a chat with the Jupyter folks and see what they think.

@oliver-sanders
Copy link
Member Author

Have made some progress towards opening Jupyter Lab from the Cylc UI with these two PRs:

We can take this further and open Jupyter Lab in a specified directory, these two branches allow opening Jupyter Lab in a workflow's source directory:

Opening content in existing Jupyter Lab sessions is trickier, however, it looks like there is now a viable option in the form of jupyter_events. This is a global Jupyter event bus implemented in jupyter_server and available to all extensions. Currently there are only a couple of events going into this. It should be possible for us to register an event in cylc-ui requesting jupyter-lab to open a file, and have jupyter-lab subscribe to this event and handle it when fired. This would require upstream changes in jupyter-lab and a bit of dialogue as I think the event bus is more geared towards telemetry at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant