Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jupyter-base-notebook): add jupyterhub py package dep #41195

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxgio92
Copy link
Member

@maxgio92 maxgio92 commented Feb 3, 2025

Because the jupyter-base-notebook package resembles the upstream jupyter/base-notebook component, it should include the jupyterhub python package. In particular, upstream includes the jupyterhub-singleuser conda metapackage that aligns to the jupyterhub pypi package.

Fixes:

Related:

Pre-review Checklist

For new package PRs only

  • This PR is marked as fixing a pre-existing package request bug
    • Alternatively, the PR is marked as related to a pre-existing package request bug, such as a dependency
  • REQUIRED - The package is available under an OSI-approved or FSF-approved license
  • REQUIRED - The version of the package is still receiving security updates
  • This PR links to the upstream project's support policy (e.g. endoflife.date)

For new version streams

  • The upstream project actually supports multiple concurrent versions.
  • Any subpackages include the version string in their package name (e.g. name: ${{package.name}}-compat)
  • The package (and subpackages) provides: logical unversioned forms of the package (e.g. nodejs, nodejs-lts)
  • If non-streamed package names no longer built, open PR to withdraw them (see WITHDRAWING PACKAGES)

For package updates (renames) in the base images

When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk)

  • REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk images successfully build
  • REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk contain no obsolete (no longer built) packages
  • Upon launch, does apk upgrade --latest successfully upgrades packages or performs no actions

For security-related PRs

  • The security fix is recorded in the advisories repo

For version bump PRs

  • The epoch field is reset to 0

For PRs that add patches

  • Patch source is documented

@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Feb 3, 2025
Copy link
Member

@kranurag7 kranurag7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small comment around string in expected_output and we can also cleanup pip install jupyterlab as part of this patch.

jupyter-base-notebook.yaml Outdated Show resolved Hide resolved
Because the jupyter-base-notebook package resembles the upstream jupyter/base-notebook
component, it should include the jupyterhub python package.
In particular, upstream includes the jupyterhub-singleuser conda metapackage that aligns
to the jupyterhub pypi package.

Signed-off-by: Massimiliano Giovagnoli <[email protected]>
@maxgio92 maxgio92 force-pushed the jupyter-base-notebook-hub-singleuser branch from 10f5ff2 to 681df3c Compare February 3, 2025 19:21
Copy link
Contributor

octo-sts bot commented Feb 3, 2025

⚠️ EXPERIMENTAL

Please use 👍 or 👎 on this comment to indicate if you agree or disagree with the recommendation.

To provide more detailed feedback please comment on the recommendation prefixed with /ai-verify:

e.g. /ai-verify partially helpful but I also added bash to the build environment

Gen AI suggestions to solve the build error:

• Detected Error: /bin/sh: jupyter: not found
• Error Category: Dependency/Configuration
• Failure Point: Command execution of jupyter server --generate-config in pipeline
• Root Cause Analysis: The jupyter executable is not in the PATH after pip installation because the package's binary directory is not properly configured

• Suggested Fix:

  1. Add PATH configuration before executing jupyter commands:
pipeline:
  - runs: |
      export PATH="/usr/bin:$PATH"
      mkdir -p ${{targets.contextdir}}/usr/local/bin
      mkdir -p ${{targets.contextdir}}/home/jovyan/.jupyter
      # install jupyterlab, nbclassic and notebook
      pip install jupyterhub --prefix=/usr --root=${{targets.contextdir}}
      pip install jupyterlab --prefix=/usr --root=${{targets.contextdir}}
      pip install nbclassic --prefix=/usr --root=${{targets.contextdir}}
      pip install notebook --prefix=/usr --root=${{targets.contextdir}}
      export PYTHONPATH="${{targets.contextdir}}/usr/lib/python3.12/site-packages:$PYTHONPATH"
      jupyter server --generate-config
      cp /home/build/.jupyter/jupyter_server_config.py ${{targets.contextdir}}/home/jovyan/.jupyter/jupyter_server_config.py
      jupyter lab clean

• Explanation:

  • The pip installations are being done with --prefix=/usr and --root=${{targets.contextdir}}
  • This causes the executables to be installed in a non-standard location
  • Adding the correct PATH and PYTHONPATH ensures the jupyter executable can be found and Python packages are properly loaded

• Additional Notes:

  • The fix ensures binaries installed via pip are discoverable
  • PYTHONPATH addition helps Python find the installed packages
  • This is a common issue when installing Python packages with custom prefixes in isolated environments

• References:

@octo-sts octo-sts bot added the ai/skip-comment Stop AI from commenting on PR label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants