Add jupyter server configuration

This commit is contained in:
clearml 2025-04-20 15:53:15 +03:00
parent 48960acbe7
commit 7378a30d26

View File

@ -582,6 +582,14 @@ def start_jupyter_server(hostname, hostnames, param, task, env, bind_ip="127.0.0
print( print(
"Running Jupyter Notebook Server on {} [{}] port {} at {}".format(hostname, hostnames, port, cwd) "Running Jupyter Notebook Server on {} [{}] port {} at {}".format(hostname, hostnames, port, cwd)
) )
additional_args = [
"--ServerApp.token='{}'".format(param.get("jupyter_token")) if param.get("jupyter_token") is not None else "",
"--ServerApp.password=''".format(param.get("jupyter_password")) if param.get("jupyter_password") is not None else "",
"--ServerApp.allow_origin=*".format(param.get("jupyter_allow_origin")) if param.get("jupyter_allow_origin") is not None else "",
"--ServerApp.base_url={}".format(param.get("jupyter_base_url")) if param.get("jupyter_base_url") is not None else "",
]
additional_args = [a for a in additional_args if a]
process = subprocess.Popen( process = subprocess.Popen(
[ [
sys.executable, sys.executable,
@ -594,7 +602,7 @@ def start_jupyter_server(hostname, hostnames, param, task, env, bind_ip="127.0.0
bind_ip, bind_ip,
"--port", "--port",
str(port), str(port),
], ] + additional_args,
env=env, env=env,
stdout=fd, stdout=fd,
stderr=fd, stderr=fd,
@ -1324,6 +1332,7 @@ def verify_workspace_storage_access(store_workspace, task):
# do not throw the exception itself, because it will confuse readers # do not throw the exception itself, because it will confuse readers
exit(1) exit(1)
class SyncCallback: class SyncCallback:
pipe_file_name_c = "/tmp/clearml_sync_pipe_c" pipe_file_name_c = "/tmp/clearml_sync_pipe_c"
pipe_file_name_r = "/tmp/clearml_sync_pipe_r" pipe_file_name_r = "/tmp/clearml_sync_pipe_r"