refactor: exctract calling traefik setup from ensure_jupyterhub_package func

This commit is contained in:
Erik Sundell
2024-09-26 22:32:26 +02:00
parent a059d6ffbb
commit 3ddc1e8d59
2 changed files with 5 additions and 2 deletions

View File

@@ -115,7 +115,6 @@ def ensure_jupyterhub_package(prefix):
os.path.join(HERE, "requirements-hub-env.txt"),
upgrade=True,
)
traefik.ensure_traefik_binary(prefix)
def ensure_usergroups():
@@ -536,6 +535,7 @@ def main():
logger.info("Setting up JupyterHub...")
ensure_jupyterhub_package(HUB_ENV_PREFIX)
traefik.ensure_traefik_binary(HUB_ENV_PREFIX)
# Stop the http server with the progress page before traefik starts
if args.progress_page_server_pid:

View File

@@ -91,7 +91,10 @@ def check_traefik_version(traefik_bin):
@backoff.on_exception(backoff.expo, Exception, max_tries=2, giveup=fatal_error)
def ensure_traefik_binary(prefix):
"""Download and install the traefik binary to a location identified by a prefix path such as '/opt/tljh/hub/'"""
"""
Ensure that a traefik binary of a hardcoded version is made available at a
prefix path such as '/opt/tljh/hub/'.
"""
if plat is None:
raise OSError(
f"Error. Platform: {os.uname().sysname} / {machine} Not supported."