From 9a4247223b283b64298cf427a9d1489807386e8b Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 30 Aug 2023 12:00:24 -0700 Subject: [PATCH] Remove all the dask support code from Lab startup --- modify_settings.py | 21 --------------------- runlab.sh | 36 ++++++------------------------------ 2 files changed, 6 insertions(+), 51 deletions(-) diff --git a/modify_settings.py b/modify_settings.py index bb4d178..cb569a7 100755 --- a/modify_settings.py +++ b/modify_settings.py @@ -20,7 +20,6 @@ def main() -> None: increase_log_limit() - remove_dask_url() def increase_log_limit() -> None: @@ -54,25 +53,5 @@ def write_limits_file(settings: dict) -> None: json.dump(settings, f, sort_keys=True, indent=4) -def remove_dask_url() -> None: - for fn in WS_FILES: - process_ws_file(fn) - - -def process_ws_file(fn: str) -> None: - with open(fn) as f: - try: - contents = json.load(f) - except (OSError, json.decoder.JSONDecodeError) as e: - return # Skip file - try: - del contents["data"]["dask-dashboard-launcher"]["url"] - except KeyError: - return # if it ain't there, it ain't a problem - LOGGER.info(f"Removing Dask dashboard URL from workspace file {fn}") - with open(fn, "w") as f: - json.dump(contents, f, separators=(",", ":")) - - if __name__ == "__main__": main() diff --git a/runlab.sh b/runlab.sh index e11b84d..e6f30cf 100755 --- a/runlab.sh +++ b/runlab.sh @@ -84,11 +84,6 @@ function manage_access_token() { fi } -function copy_lsst_dask() { - mkdir -p "${HOME}/.config/dask" - cp "/opt/lsst/software/jupyterlab/lsst_dask.yml" "${HOME}/.config/dask/" -} - function reset_user_env() { local now=$(date +%Y%m%d%H%M%S) local reloc="${HOME}/.user_env.${now}" @@ -150,13 +145,6 @@ function copy_etc_skel() { done } -function start_dask_worker() { - cmd="/opt/lsst/software/jupyterlab/lsstwrapdask.bash" - echo "Starting dask worker: ${cmd}" - exec ${cmd} - exit 0 # Not reached -} - function start_noninteractive() { cmd="python3 -s \ /opt/lsst/software/jupyterlab/noninteractive/noninteractive" @@ -272,29 +260,17 @@ fi FIREFLY_HTML="slate.html" export FIREFLY_URL FIREFLY_HTML export JUPYTER_PREFER_ENV_PATH="no" -if [ -z "${JUPYTERHUB_SERVICE_PREFIX}" ]; then - # dask.distributed gets cranky if it's not there (since it is used - # in lsst_dask.yml); it will be for interactive use, and whether - # or not the proxy dashboard URL is correct doesn't matter in a - # noninteractive context. - JUPYTERHUB_SERVICE_PREFIX="${JUPYTERHUB_BASE_URL}user/${JUPYTERHUB_USER}" - export JUPYTERHUB_SERVICE_PREFIX -fi -# Fetch/update magic notebook. We want this in interactive, noninteractive, -# and Dask pods. We must have ${HOME} mounted but that is the case for -# all of those scenarios. +# Fetch/update magic notebook. We want this in interactive and noninteractive +# pods. We must have ${HOME} mounted but that is the case for both of those +# scenarios. . /opt/lsst/software/jupyterlab/refreshnb.sh eups admin clearCache -if [ -n "${DASK_WORKER}" ]; then - start_dask_worker - exit 0 # Not reached -elif [ -n "${NONINTERACTIVE}" ]; then +if [ -n "${NONINTERACTIVE}" ]; then start_noninteractive exit 0 # Not reached else - # All of these tasks should only be run if we are an interactive lab, - # rather than a noninteractive lab or a Dask worker. - copy_lsst_dask + # These tasks should only be run if we are an interactive lab rather than + # a noninteractive lab. modify_settings_files manage_access_token fi