From 79237c65b09d267747508fa54b042365ea37a4a9 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 22:19:15 -0400 Subject: [PATCH 1/6] jupyterhub/tasks/install.yml: Use --no-cache-dir w/o --pre --- roles/jupyterhub/tasks/install.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index d92b166fe..a593bf8d6 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -41,9 +41,9 @@ - jupyterhub virtualenv: "{{ jupyterhub_venv }}" # /opt/iiab/jupyterhub virtualenv_site_packages: no - virtualenv_command: python3 -m venv "{{ jupyterhub_venv }}" # 2021-07-29: This works on RaspiOS 10, Debian 11, Ubuntu 20.04 and Mint 20 -- however if you absolutely must use the older Debian 10 -- you can work around errors "can't find Rust compiler" and "This package requires Rust >=1.41.0" if you (1) revert this line to 'virtualenv_command: virtualenv' AND (2) uncomment the line just below + virtualenv_command: python3 -m venv "{{ jupyterhub_venv }}" # 2021-07-29: This works on RasPiOS 10, Debian 11, Ubuntu 20.04 and Mint 20 -- however if you absolutely must use the older Debian 10 -- you can work around errors "can't find Rust compiler" and "This package requires Rust >=1.41.0" if you (1) revert this line to 'virtualenv_command: virtualenv' AND (2) uncomment the line just below #virtualenv_python: python3 # 2021-07-29: Was needed when above line was 'virtualenv_command: virtualenv' (generally for Python 2) - extra_args: "--no-cache-dir --pre" # 2021-11-30: The "--pre" flag should likely be removed after JupyterHub 2.0.0 is released. + extra_args: "--no-cache-dir" # 2021-11-30, 2022-07-07: The "--pre" flag had earlier been needed, for beta-like pre-releases of JupyterHub 2.0.0 # 2022-07-07: Attempting to "pip install" all 7 together (3 above + 4 below) # fails on OS's like 64-bit RasPiOS (but interestingly works on Ubuntu 22.04!) @@ -59,6 +59,7 @@ virtualenv: "{{ jupyterhub_venv }}" virtualenv_site_packages: no virtualenv_command: python3 -m venv "{{ jupyterhub_venv }}" + extra_args: "--no-cache-dir" - name: "Install from template: {{ jupyterhub_venv }}/etc/jupyterhub/jupyterhub_config.py" template: From c153cb8d9a964f496272967490986721cb25828b Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 22:41:52 -0400 Subject: [PATCH 2/6] jupyterhub/tasks/install.yml: Clarify ~304MB /opt/iiab/jupyterhub --- roles/jupyterhub/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index a593bf8d6..257f817f3 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -33,7 +33,7 @@ global: yes state: latest -- name: "pip install 3 packages into virtual environment: {{ jupyterhub_venv }} (~306 MB total, in two ansible plays)" +- name: "pip install 3 packages into virtual environment: {{ jupyterhub_venv }} (~304 MB total, in two ansible plays)" pip: name: - pip From 5dad80366edbc14fd8fdc70661e458aba0c944e7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 23:16:58 -0400 Subject: [PATCH 3/6] jupyterhub/tasks/install.yml: Nix getsite.py & patch_FUA.sh --- roles/jupyterhub/tasks/install.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index 257f817f3..0018b4422 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -71,20 +71,21 @@ src: jupyterhub.service.j2 dest: /etc/systemd/system/jupyterhub.service -- name: Install {{ jupyterhub_venv }}/bin/getsite.py from template, to fetch site_packages path, e.g. {{ jupyterhub_venv }}/lib/python{{ python_ver }}/site-packages - template: - src: getsite.py.j2 - dest: "{{ jupyterhub_venv }}/bin/getsite.py" - mode: 0755 - -- name: Install patch_FUA.sh from template -- to (1) fix async password-changing page, and (2) force usernames to lowercase -- patching $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py - template: - src: patch_FUA.sh.j2 - dest: "{{ jupyterhub_venv }}/bin/patch_FUA.sh" - mode: 0755 - -- name: "Run the above two, via: {{ jupyterhub_venv }}/bin/patch_FUA.sh" - command: "{{ jupyterhub_venv }}/bin/patch_FUA.sh" +# 2022-07-07: No longer needed, thx to upstream fixes +# - name: Install {{ jupyterhub_venv }}/bin/getsite.py from template, to fetch site_packages path, e.g. {{ jupyterhub_venv }}/lib/python{{ python_ver }}/site-packages +# template: +# src: getsite.py.j2 +# dest: "{{ jupyterhub_venv }}/bin/getsite.py" +# mode: 0755 +# +# - name: Install patch_FUA.sh from template -- to (1) fix async password-changing page, and (2) force usernames to lowercase -- patching $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py +# template: +# src: patch_FUA.sh.j2 +# dest: "{{ jupyterhub_venv }}/bin/patch_FUA.sh" +# mode: 0755 +# +# - name: "Run the above two, via: {{ jupyterhub_venv }}/bin/patch_FUA.sh" +# command: "{{ jupyterhub_venv }}/bin/patch_FUA.sh" - name: Install patch_http-warning.sh from template, to turn off the warning about http insecurity, in {{ jupyterhub_venv }}/share/jupyterhub/templates/login.html template: From 54703fa34afedceb1f95c064f61cb7491d854143 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 23:18:09 -0400 Subject: [PATCH 4/6] Rename patch_FUA.sh.j2 to patch_FUA.sh.j2.unused --- .../templates/{patch_FUA.sh.j2 => patch_FUA.sh.j2.unused} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename roles/jupyterhub/templates/{patch_FUA.sh.j2 => patch_FUA.sh.j2.unused} (100%) diff --git a/roles/jupyterhub/templates/patch_FUA.sh.j2 b/roles/jupyterhub/templates/patch_FUA.sh.j2.unused similarity index 100% rename from roles/jupyterhub/templates/patch_FUA.sh.j2 rename to roles/jupyterhub/templates/patch_FUA.sh.j2.unused From 042dff872bc33845d5f171194b4e82347341ff5e Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 23:18:46 -0400 Subject: [PATCH 5/6] Rename getsite.py.j2 to getsite.py.j2.unused --- .../jupyterhub/templates/{getsite.py.j2 => getsite.py.j2.unused} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename roles/jupyterhub/templates/{getsite.py.j2 => getsite.py.j2.unused} (100%) diff --git a/roles/jupyterhub/templates/getsite.py.j2 b/roles/jupyterhub/templates/getsite.py.j2.unused similarity index 100% rename from roles/jupyterhub/templates/getsite.py.j2 rename to roles/jupyterhub/templates/getsite.py.j2.unused From f035414ce9df5fcaf0a3257c0bc591535f9b3b2a Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 7 Jul 2022 23:47:32 -0400 Subject: [PATCH 6/6] jupyterhub/tasks/install.yml: Ansible output re: mutual dep deadlock --- roles/jupyterhub/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index 0018b4422..8ef7ce7d9 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -33,7 +33,7 @@ global: yes state: latest -- name: "pip install 3 packages into virtual environment: {{ jupyterhub_venv }} (~304 MB total, in two ansible plays)" +- name: "pip install 3 packages into virtual environment: {{ jupyterhub_venv }} (~304 MB total, after 2 Ansible calls)" pip: name: - pip @@ -49,7 +49,7 @@ # fails on OS's like 64-bit RasPiOS (but interestingly works on Ubuntu 22.04!) # https://github.com/iiab/iiab/issues/3283 -- name: Break apart jupyterhub/jupyterlab pip installs into two parts - must have conflicting mutual dependency (3 packages above + 4 packages here) +- name: Break up jupyterhub/jupyterlab pip installs into 2 parts (3 packages above + 4 packages here) due to mutual dependency deadlock on some OS's pip: name: - jupyterlab