1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Merge pull request #3295 from holta/jupyterhub-pip-flags

jupyterhub/tasks/install.yml: Use --no-cache-dir w/o --pre [AND stop patching firstuseauthenticator.py]
This commit is contained in:
A Holt 2022-07-07 23:55:56 -04:00 committed by GitHub
commit e04325eeb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 18 deletions

View file

@ -33,7 +33,7 @@
global: yes global: yes
state: latest 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, after 2 Ansible calls)"
pip: pip:
name: name:
- pip - pip
@ -41,15 +41,15 @@
- jupyterhub - jupyterhub
virtualenv: "{{ jupyterhub_venv }}" # /opt/iiab/jupyterhub virtualenv: "{{ jupyterhub_venv }}" # /opt/iiab/jupyterhub
virtualenv_site_packages: no 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) #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) # 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!) # fails on OS's like 64-bit RasPiOS (but interestingly works on Ubuntu 22.04!)
# https://github.com/iiab/iiab/issues/3283 # 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: pip:
name: name:
- jupyterlab - jupyterlab
@ -59,6 +59,7 @@
virtualenv: "{{ jupyterhub_venv }}" virtualenv: "{{ jupyterhub_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
virtualenv_command: python3 -m venv "{{ jupyterhub_venv }}" virtualenv_command: python3 -m venv "{{ jupyterhub_venv }}"
extra_args: "--no-cache-dir"
- name: "Install from template: {{ jupyterhub_venv }}/etc/jupyterhub/jupyterhub_config.py" - name: "Install from template: {{ jupyterhub_venv }}/etc/jupyterhub/jupyterhub_config.py"
template: template:
@ -70,20 +71,21 @@
src: jupyterhub.service.j2 src: jupyterhub.service.j2
dest: /etc/systemd/system/jupyterhub.service 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 # 2022-07-07: No longer needed, thx to upstream fixes
template: # - name: Install {{ jupyterhub_venv }}/bin/getsite.py from template, to fetch site_packages path, e.g. {{ jupyterhub_venv }}/lib/python{{ python_ver }}/site-packages
src: getsite.py.j2 # template:
dest: "{{ jupyterhub_venv }}/bin/getsite.py" # src: getsite.py.j2
mode: 0755 # 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: # - 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
src: patch_FUA.sh.j2 # template:
dest: "{{ jupyterhub_venv }}/bin/patch_FUA.sh" # src: patch_FUA.sh.j2
mode: 0755 # 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: "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 - 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: template: