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

[question] Make Cylc UI Server a Traitlet application? #123

Closed
kinow opened this issue Feb 19, 2020 · 1 comment · Fixed by #173
Closed

[question] Make Cylc UI Server a Traitlet application? #123

kinow opened this issue Feb 19, 2020 · 1 comment · Fixed by #173
Labels
question Flag this as a question for the next Cylc project meeting.

Comments

@kinow
Copy link
Member

kinow commented Feb 19, 2020

Describe exactly what you would like to see in an upcoming release

I had it in my notes from a long time ago, when I first started chopping parts of the JupyterHub single-user application, to get our UI Server working.

One thing that I completely ignored at that time was the whole Traitlets code.

Not sure if we need that. In theory the application spawned by the JupyterHub spawners doesn't need to use traitlets, but I never looked if there are any advantages of using it (hence the "question" label).

The only advantages of using it, I think, would be a) being able to use Python in the jupyterhub_config.py to define variables that could be shared/used in different sections of the file, e.g.

LOG_DATEFMT = '%Y-%m-%dT%H:%M:%S'
c.JupyterHub.log_datefmt = LOG_DATEFMT
c.CylcUIServer.log_datefmt = LOG_DATEFMT

and b) using the same tooling as the default application launched by the Hub spawners (i.e. notebook).

But there are probably cons too, like another dependency to the project, we wouldn't have our own configuration file, maybe we want to have more control on how configuration is done, etc.

No strong opinion on this, just remembered about this because yesterday I was reading the JupyterHub code while writing some cookie documentation.

Additional context

Here's one example from Jupyter Core. This is the base class of the NotebookApp, which is used by JupyterHub by default with the spawners, and we have replaced with our UI Server.

image

It provides the application configuration. The jupyterhub_config.py leverages of traitlets to load properties. That's how we have c.JupyterHub.properties, c.ConfigProxy.properties, and c.BatchSpawner.properties, etc.

Traitlets supports things such as defining an object property that will be initialized from the configuration file, with a default value, but that can be overridden by an environment variable.

image

Pull requests welcome!

@kinow kinow added the question Flag this as a question for the next Cylc project meeting. label Feb 19, 2020
@kinow kinow changed the title [question] Make Cylc UI Server a Trailet application? [question] Make Cylc UI Server a Traitlet application? Oct 14, 2020
@oliver-sanders
Copy link
Member

I think this is the right way to go for configuring the hub.

A good trial might be to make the hard-coded scan interval configurable as something like:

c.CylcHub.scan_interval = 5  # scan every 5 seconds

ioloop.PeriodicCallback(
self.workflows_mgr.update, 5000).start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Flag this as a question for the next Cylc project meeting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants