mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
refactor: exctract calling traefik setup from ensure_jupyterhub_package func
This commit is contained in:
@@ -115,7 +115,6 @@ def ensure_jupyterhub_package(prefix):
|
|||||||
os.path.join(HERE, "requirements-hub-env.txt"),
|
os.path.join(HERE, "requirements-hub-env.txt"),
|
||||||
upgrade=True,
|
upgrade=True,
|
||||||
)
|
)
|
||||||
traefik.ensure_traefik_binary(prefix)
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_usergroups():
|
def ensure_usergroups():
|
||||||
@@ -536,6 +535,7 @@ def main():
|
|||||||
|
|
||||||
logger.info("Setting up JupyterHub...")
|
logger.info("Setting up JupyterHub...")
|
||||||
ensure_jupyterhub_package(HUB_ENV_PREFIX)
|
ensure_jupyterhub_package(HUB_ENV_PREFIX)
|
||||||
|
traefik.ensure_traefik_binary(HUB_ENV_PREFIX)
|
||||||
|
|
||||||
# Stop the http server with the progress page before traefik starts
|
# Stop the http server with the progress page before traefik starts
|
||||||
if args.progress_page_server_pid:
|
if args.progress_page_server_pid:
|
||||||
|
|||||||
@@ -91,7 +91,10 @@ def check_traefik_version(traefik_bin):
|
|||||||
|
|
||||||
@backoff.on_exception(backoff.expo, Exception, max_tries=2, giveup=fatal_error)
|
@backoff.on_exception(backoff.expo, Exception, max_tries=2, giveup=fatal_error)
|
||||||
def ensure_traefik_binary(prefix):
|
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:
|
if plat is None:
|
||||||
raise OSError(
|
raise OSError(
|
||||||
f"Error. Platform: {os.uname().sysname} / {machine} Not supported."
|
f"Error. Platform: {os.uname().sysname} / {machine} Not supported."
|
||||||
|
|||||||
Reference in New Issue
Block a user