Thanks for your interest in contributing to the notebooks repository.
Please take a few minutes to read GitHub's guide on How to Contribute to Open Source. It's a quick read, and it's a great way to introduce yourself to how things work behind the scenes in open-source projects.
If you want to update the documentation, README.md is the file you're looking for.
Pull requests are the best way to propose changes to the notebooks repository:
- Configure name and email in git
- Fork the repo and create your branch from main.
- Sign off your commit using the -s, --signoff option. Write a good commit message (see How to Write a Git Commit Message)
- If you've added code that should be tested, add tests.
- Ensure the test suite passes.
- Make sure your code lints.
- Issue that pull request!
Each notebook image is a self-contained multi-stage Dockerfile — there are no inter-image dependencies. To add a new notebook:
- Copy an existing leaf Dockerfile that is closest to your new image (e.g. copy
jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpuand add your new stage at the end) - Create a proper filepath:
jupyter/${NOTEBOOK_NAME}/ubi9-python-3.12/ - Add the minimum files:
pyproject.tomlwith the additional Python packagesDockerfile.cpu(and/or.cuda,.rocm) with multi-stage build instructionsbuild-args/directory withcpu.conf,konflux.cpu.conf, etc.
- Add a Makefile target (no dependency on another notebook target):
.PHONY: jupyter-${NOTEBOOK_NAME}-ubi9-python-$(RELEASE_PYTHON_VERSION) jupyter-${NOTEBOOK_NAME}-ubi9-python-$(RELEASE_PYTHON_VERSION): $(call image,$@,jupyter/${NOTEBOOK_NAME}/ubi9-python-$(RELEASE_PYTHON_VERSION)/Dockerfile.cpu)
- Add the new image path under
refresh-lock-files - Run
make refresh-lock-filesto generate lock files - Test locally:
make jupyter-${NOTEBOOK_NAME}-ubi9-python-3.12
The project requires Go 1.26+ for building helper tools (scripts/buildinputs, scripts/check-payload).
The Makefile sets GOTOOLCHAIN=auto so Go will auto-download the correct version if yours is older.
If you're on Fedora and the auto-download fails with a GOSUMDB=off error, either:
- Run
export GOSUMDB=sum.golang.orgbeforemake, or - Install Go 1.26+ manually from https://go.dev/dl/
All third-party actions must be pinned by full commit SHA with a version comment:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2After adding or modifying any uses: line in .github/, run:
# Install: brew install pinact (or: go install github.com/suzuki-shunsuke/pinact/v3/cmd/pinact@v3.9.0)
GITHUB_TOKEN=$(gh auth token) pinact runCI enforces this via pinact run --check --verify in the code-quality workflow.
See ADR 0008 for background.
Recommended: If you have write access to the repo, push your branch directly
and create the PR from there. If you started from a fork, add the upstream remote
first so the branch lands in opendatahub-io/notebooks (not your fork):
git remote add upstream https://github.com/opendatahub-io/notebooks.git
git push upstream HEAD:<your-initials>/branch-nameThis gives CI full access to build secrets (RHEL subscription, AIPCC registry) and uses the org's paid runners with higher concurrency limits.
Fork PRs: If you open a PR from a fork, CI will run non-secret checks (code quality, ODH image builds) but subscription builds (RHEL, AIPCC) will be skipped. A bot will comment with instructions for re-creating the PR from a same-repo branch.
- Run prek before you commit, to lint the Python sources that have been put under its management
uvx prek run --all-files - If you like, you can install prek to run automatically using
uvx prek install -f, as per its install instructions
uvx prek install -f installs both the normal pre-commit hook and the
commit-message hook used to guard submodule references. Contributors who
already installed the hooks should run the command again after pulling this
change. The guard checks staged submodule pointers during local commits and
checks every commit in a pull request in CI. An intentional pointer update
should include [submodule-update] anywhere in its commit message; matching is
case-insensitive. ALLOW_SUBMODULE_CHANGE=1 is a local-only escape hatch for a
single commit and has no effect in CI.
Switching branches can leave a submodule worktree at a revision from the old
branch. That working-tree state is separate from a staged or committed pointer:
the guard only blocks the latter. To inspect an accidental staged pointer,
unstage it with git restore --staged -- <submodule-path> and synchronize the
worktree with git submodule update --init --recursive. Review the resulting
status before staging anything again; avoid resetting or deleting work you have
not verified.
To run a local Trivy filesystem vulnerability scan using the repository's trivy.yaml configuration:
make trivy-scanEach notebook image is built as an independent Konflux component with its own Tekton
PipelineRun in .tekton/. To add CI for a new notebook, create a PipelineRun YAML
following the pattern of existing ones in .tekton/. See the .tekton/README-odh.md
for details.
For the full test catalog (types, markers, CI parity, and a package upgrade checklist), see docs/agents/testing.md.
- Use
uvfor local development:uv venv --python "$(which python3.14)" uv sync --locked - On macOS, install Homebrew GNU Make 4.x and put
gnubinonPATHsomakeresolves to the same binary used on Linux:brew install make PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" - After dependency changes, regenerate locks with
make refresh-lock-files.
make test
make test-unit
make test-integration PYTEST_ARGS="--image=<image>"
make jupyter-${NOTEBOOK_NAME}-ubi9-python-3.12
make test-${NOTEBOOK_NAME}- Run tests from a checkout whose directory name is exactly
notebooks. Hyphenated worktree paths such as/tmp/pr-2293-cibreaktest_image_pyprojects_version_alignment. - If static tests fail in a surprising way, retry from a clean clone first. Extra
top-level files and directories such as
.cursor-tmp-*can interfere with repo-wide assertions. - For filesystem-heavy unit tests, prefer the
pyfakefsfsfixture overtmp_path. - When renaming image labels or similar CI metadata, update only the current
-nentries inci/check-params-env.shandci/expected-image-metadata.yaml. Historical entries intentionally keep old names. - macOS python.org SSL certificates: If your default
python3is the python.org framework build (e.g./Library/Frameworks/Python.framework/...), ad-hoc scripts that useurlliborrequestsmay fail withssl.SSLCertVerificationError: certificate verify failed. This is because the python.org installer does not wire up CA certificates automatically. Fix once by running:(adjust the version number to match your install). Alternatively, use the"/Applications/Python 3.12/Install Certificates.command"uv-managed Python (python3.14) which uses the system trust store.
PRODUCT selects the product variant, not whether the build runs on Konflux/Tekton.
Both variants are built on Konflux in CI; the variable changes which build-args/*.conf
and manifest tree the Makefile uses locally.
PRODUCT value |
Product variant | Build args | Manifests |
|---|---|---|---|
unset or odh |
ODH (midstream default) | build-args/<variant>.conf |
manifests/odh/ |
rhoai |
RHOAI downstream | build-args/konflux.<variant>.conf |
manifests/rhoai/ |
Keep the same PRODUCT value for both the build step and the matching make test-*
step so the imagestream manifests and expected package versions line up.
For deeper references:
- Konflux and Tekton details:
docs/konflux.md - Subscribed/AIPCC local builds:
docs/subscribed-builds.md - Hermetic build internals:
docs/hermetic-guide.md - CI failure ownership and systems:
docs/ci.md - CVE-driven lockfile work:
docs/cves/python.mdanddocs/cves/nodejs.md
When contributing to notebook-related changes in the Red Hat Data Services (RHDS) ecosystem, it's important to understand the repository structure and contribution workflow:
OpenDataHub Notebooks Repository (odh/notebooks):
- Primary Development Location: All changes to notebook images, dependencies, configurations, and documentation should be made here first
- What to modify: Dockerfiles, pyproject.toml files, test suites, documentation, CI/CD configurations, and all notebook-related code
- Sync Process: Changes made here are automatically synced to the RHDS notebooks repository
RHDS Notebooks Repository (rhds/notebooks):
- Limited Changes: Only
Dockerfile.konfluxfiles should be modified directly in this repository. Changes to these files flow to RHOAI upcoming release - Konflux Integration: This repository contains Konflux-specific build configurations and pipeline definitions
- Automated Sync: Receives updates from the ODH notebooks repository automatically
In this terminology, ODH is the midstream repo and RHOAI/RHDS is the downstream product repo. When shared files need one convention, follow the Konflux/RHOAI naming and behavior that the downstream automation expects.
-
For General Changes:
- Make all notebook-related changes in
odh/notebooksand they will be automatically synchronized torhds/notebooks - Submit pull requests to the OpenDataHub repository
- Changes to everything except
Dockerfile.konfluxfiles should be done inodh/notebooksand synced torhds/notebooks
- Make all notebook-related changes in
-
For Konflux-Specific Changes (Requires Special Attention):
- Modify
Dockerfile.konfluxfiles directly inrhds/notebooks - These files contain Konflux build configurations and require special attention in the downstream repository
- Changes to these files flow to RHOAI upcoming release and need careful coordination
- Modify
-
For Tekton Pipeline Changes:
- ODH
.tekton/changes are made in this repository - RHDS PR PipelineRun changes are authored in
konflux-central, then synced into the downstream notebooks repo - Follow the repository-specific Konflux documentation before editing pipeline definitions
- ODH
- Always start with ODH: Begin your contributions in the OpenDataHub notebooks repository unless specifically working on Konflux configurations
- Check synchronization: Verify that your changes are properly synchronized between repositories
- Follow documentation: Refer to repository-specific README files for detailed contribution guidelines
- Coordinate changes: When making related changes across repositories, ensure consistency and proper sequencing
This workflow ensures that the OpenDataHub community remains the primary development hub while maintaining compatibility with Red Hat's enterprise tooling and processes.
To debug tests, run pytest with verbose logging:
uv run pytest -s --log-cli-level=DEBUG tests/For container tests, add --capture=fd to see container output:
uv run pytest --capture=fd tests/containers --image=<image> --log-cli-level=DEBUG- Once the PR is submitted, you can either select specific reviewers or let the bot to select reviewers automatically.
- For the PR to be merged, it must receive 2 reviews from the repository approvals/reviewers. Following that, an
/approvecomment must be added by someone with approval rights. If the author of the PR has approval rights, it is preferred that they perform the merge action.