Skip to content

Latest commit

 

History

History
214 lines (176 loc) · 9.1 KB

NOTES.md

File metadata and controls

214 lines (176 loc) · 9.1 KB

Notes

This docker stack uses modified startup scripts from jupyter/docker-stacks.
ℹ️ Nevertheless, all Docker Options and Permission-specific configurations can be used for the images of this docker stack.

Tweaks

In comparison to pangeo-data/jupyter-earth, these images are tweaked as follows:

Jupyter startup scripts

Shell script /usr/local/bin/start.sh is modified to

  • allow bind mounting of a home directory.

Jupyter startup hooks

The following startup hooks are put in place:

Custom scripts

/usr/local/bin/busy is executed during screen/tmux sessions to update the last-activity timestamps on JupyterHub.
ℹ️ This prevents the JupyterHub Idle Culler Service from shutting down idle or long-running Jupyter Notebook servers, allowing for unattended computations.

Environment variables

Versions

  • QGIS_VERSION
  • JUPYTERHUB_VERSION
  • JUPYTERLAB_VERSION
  • PYTHON_VERSION
  • GIT_VERSION
  • OTB_VERSION
  • TURBOVNC_VERSION

GRASS GIS

  • GRASS_PYTHON: Set to /usr/bin/python3

Otherwise, grass would use /user/local/bin/python3.
ℹ️ grass was built against Python and packages from the distro's package repository.

Orfeo Toolbox

  • GDAL_DRIVER_PATH: Set to disable (amd64 only)
  • OTB_APPLICATION_PATH: Set to /usr/local/lib/otb/applications (amd64 only)
  • PYTHONPATH: Set to /usr/local/lib/otb/python (amd64 only)

A subset of the environment variables used in otbenv.profile.

Miscellaneous

  • BASE_IMAGE: Its very base, a Docker Official Image.
  • PARENT_IMAGE: The image it was derived from.
  • BUILD_DATE: The date it was built (ISO 8601 format).

Shell

The default shell is Zsh, further enhanced with

Settings

Default

  • IPython:
    • Only enable figure formats svg and pdf for IPython.
  • IPython kernel:
    • Only enable figure formats svg and pdf for IPython Kernel (Jupyter Notebooks).
  • JupyterLab:
  • Autostart
    • DPI setting: Set DPI accoding to variable DPI exported in ~/.xprofile. (QGIS versions ≥ 3.34.0)
  • Xfce xinitrc:
    • ~/.xprofile: Commands to execute at the beginning of the X user session. (QGIS versions ≥ 3.34.0)
      ℹ️ To set a custom display resolution not available in 'Display Settings'.
    • ~/.i18n: Set LANG to change the system language of the desktop environment.
      ℹ️ To override environment variable LANG. Must be one of LANGS.
  • Xfce Panel:
    • Hide 'Lock Screen' and 'Log Out...' because those kill the session.
      (Removed: 'Log Out' from Applications)
      (Disabled: Ctrl+Alt+Del to trigger session logout)
  • Xfce Terminal:
    • Set FontName=MesloLGS NF 10 and Encoding=UTF-8.
  • QGIS Desktop:
    • Append /usr/lib/python3/dist-packages to PYTHONPATH.
      ℹ️ One distro refused to find the Python bindings to QGIS (at /usr/lib/python3/dist-packages/qgis)...
  • Zsh
    • Oh My Zsh: ~/.zshrc
      • Set PATH so it includes user's private bin if it exists
      • Update last-activity timestamps while in screen/tmux session
    • Powerlevel10k: p10k configure
      • Does this look like a diamond (rotated square)?: (y) Yes.
      • Does this look like a lock?: (y) Yes.
      • Does this look like a Debian logo (swirl/spiral)?: (y) Yes.
      • Do all these icons fit between the crosses?: (y) Yes.
      • Prompt Style: (3) Rainbow.
      • Character Set: (1) Unicode.
      • Show current time?: (2) 24-hour format.
      • Prompt Separators: (1) Angled.
      • Prompt Heads: (1) Sharp.
      • Prompt Tails: (1) Flat.
      • Prompt Height: (2) Two lines.
      • Prompt Connection: (2) Dotted.
      • Prompt Frame: (2) Left.
      • Connection & Frame Color: (2) Light.
      • Prompt Spacing: (2) Sparse.
      • Icons: (2) Many icons.
      • Prompt Flow: (1) Concise.
      • Enable Transient Prompt?: (n) No.
      • Instant Prompt Mode: (3) Off.

Customise

  • Terminal IPython: Create file ~/.ipython/profile_default/ipython_config.py
    • Valid figure formats: png, retina, jpeg, svg, pdf.
  • IPython: Create file ~/.ipython/profile_default/ipython_config.py
    • Valid figure formats: png, retina, jpeg, svg, pdf.
  • JupyterLab: Settings > Advanced Settings Editor
  • Zsh
    • Oh My Zsh: Edit ~/.zshrc.
    • Powerlevel10k: Run p10k configure or edit ~/.p10k.zsh.
      • Update command: git -C ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k pull

Custom display resolution

noVNC + TurboVNC can take full advantage of a HiDPI/Retina display. E.g. for standard 2160p/4K UHD (3840x2160):

  1. Create file ~/.xprofile with the following content:
    xrandr --newmode "3840x2160_60.00"  712.34  3840 4152 4576 5312  2160 2161 2164 2235  -HSync +Vsync
    xrandr --addmode VNC-0 "3840x2160_60.00"
    xrandr -s 3840x2160
    export DPI=192
    
    ℹ️ xrandr values according to command gtf 3840 2160 60
  2. Close 'QGIS Desktop'.
  3. Stop and restart the Jupyter server.
  4. Open 'QGIS Desktop'.
  5. Change the following settings:
    • Appearance > Settings: Window Scaling: 2x
    • Window Manager > Style: Theme: Default-xhdpi
    • Mouse and Touchpad > Theme: Size: Increase/Decrease 'Cursor size' if required.
  6. Close 'QGIS Desktop'.
  7. Stop and restart the Jupyter server.
  8. Open 'QGIS Desktop'.

With the browser in full screen mode (hidden toolbars), 'QGIS Desktop' should fit the display perfectly.

Python

The Python version is selected as follows:

This Python version is installed at /usr/local/bin.