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

Visual feedback that the hub restarted #112

Closed
betatim opened this issue Aug 5, 2018 · 3 comments
Closed

Visual feedback that the hub restarted #112

betatim opened this issue Aug 5, 2018 · 3 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@betatim
Copy link
Member

betatim commented Aug 5, 2018

Right now when restarting the hub there is almost now feedback on whether that worked or not. In particular if you are running the restart command from a web terminal in your single-user server.

Having some kind of feedback that "jupp this thing restarted and loaded your newly modified configuration" would be good. Mostly as a way to reassure users. Even better would be if there was some validation of the configuration before restarting and a corresponding error message. In particular checking for yaml keys that aren't recognised as they are potential typos.

@yuvipanda
Copy link
Collaborator

I think I was partially (and unconsciously) following the ol' school unix setup of 'if everything went ok, output nothing'. I think that's the wrong thing here, so we should fix that.

JSON Schema validation! <3

@betatim
Copy link
Member Author

betatim commented Aug 7, 2018

I think "output nothing on success" would work if we tell the user that 100% guaranteed there will be a message you can not miss if something went wrong. In my case I had a typo in the config, got no feedback from restarting, and did not observe my attempted reconfiguration taking effect. Which made me wonder "config wrong or mistake restarting or need to restart more??"

@yuvipanda yuvipanda added the enhancement New feature or request label May 20, 2019
@consideRatio
Copy link
Member

consideRatio commented Oct 22, 2021

I created an issue for implementing JSONSchema validation of our config as it is a relevant separate task in #725.

Is it correct that this regards tljh-config reload [hub|proxy], and making sure it doesn't fail without an error is emitted or indicating success on completion?

I think to indicate success, is the same as to ensure we have no errors. So in my mind, the gist of this issue is to validate the outcome of the reload command, or, to clarify that the reload command just did a restart without checking for if it succeeded or not.

The current tljh-config reload logic is defined here.

def reload_component(component):
"""
Reload a TLJH component.
component can be 'hub' or 'proxy'.
"""
# import here to avoid circular imports
from tljh import systemd, traefik
if component == 'hub':
systemd.restart_service('jupyterhub')
# Ensure hub is back up
while not systemd.check_service_active('jupyterhub'):
time.sleep(1)
while not check_hub_ready():
time.sleep(1)
print('Hub reload with new configuration complete')
elif component == 'proxy':
traefik.ensure_traefik_config(STATE_DIR)
systemd.restart_service('traefik')
while not systemd.check_service_active('traefik'):
time.sleep(1)
print('Proxy reload with new configuration complete')

Aha! It seems like this is already resolved. I'll go for a close on this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

4 participants