Skip to content

Conversation

@jiridanek
Copy link
Member

Description

Successfully integrated mongocli compilation stages into the templating system managed by scripts/dockerfile_fragments.py.

Changes Made:

1. Enhanced Template System

Added three new templates to dockerfile_fragments.py:

  • mongocli-builder stage: Simple mongocli builder for most images
  • mongocli-builder stage with s390x support: Advanced builder with s390x architecture handling for datascience images
  • Copy mongocli from builder: Template for copying the compiled binary

2. Automated Marker Addition

Created scripts/add_mongocli_markers.py to automatically add BEGIN/END markers to all Dockerfile.* files containing mongocli stages.

3. Applied Templates

Successfully applied templates to 16 Dockerfiles across:

  • jupyter/pytorch (cuda, konflux.cuda)
  • jupyter/pytorch+llmcompressor (cuda, konflux.cuda)
  • jupyter/tensorflow (cuda, konflux.cuda)
  • jupyter/trustyai (cpu, konflux.cpu, cowsay.cpu)
  • jupyter/rocm/pytorch (rocm, konflux.rocm)
  • jupyter/rocm/tensorflow (rocm, konflux.rocm)
  • jupyter/datascience (cpu, konflux.cpu, cpu.j2, mongocli-builder)

Benefits:

  • Centralized Management: All mongocli build stages now managed from a single location
  • Consistency: Ensures identical mongocli compilation across all images
  • Easy Updates: Future changes to mongocli version or build process only need to be made in dockerfile_fragments.py
  • Maintainability: Reduces code duplication and potential for drift between Dockerfiles

How Has This Been Tested?

Self checklist (all need to be checked):

  • Ensure that you have run make test (gmake on macOS) before asking for review
  • Changes to everything except Dockerfile.konflux files should be done in odh/notebooks and automatically synced to rhds/notebooks. For Konflux-specific changes, modify Dockerfile.konflux files directly in rhds/notebooks as these require special attention in the downstream repository and flow to the upcoming RHOAI release.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

…fragments.py templates

Successfully integrated mongocli compilation stages into the templating system managed by [`scripts/dockerfile_fragments.py`](scripts/dockerfile_fragments.py:1).

## Changes Made:

### 1. Enhanced Template System
Added three new templates to [`dockerfile_fragments.py`](scripts/dockerfile_fragments.py:63):
- **`mongocli-builder stage`**: Simple mongocli builder for most images
- **`mongocli-builder stage with s390x support`**: Advanced builder with s390x architecture handling for datascience images
- **`Copy mongocli from builder`**: Template for copying the compiled binary

### 2. Automated Marker Addition
Created [`scripts/add_mongocli_markers.py`](scripts/add_mongocli_markers.py:1) to automatically add BEGIN/END markers to all Dockerfile.* files containing mongocli stages.

### 3. Applied Templates
Successfully applied templates to **16 Dockerfiles** across:
- jupyter/pytorch (cuda, konflux.cuda)
- jupyter/pytorch+llmcompressor (cuda, konflux.cuda)
- jupyter/tensorflow (cuda, konflux.cuda)
- jupyter/trustyai (cpu, konflux.cpu, cowsay.cpu)
- jupyter/rocm/pytorch (rocm, konflux.rocm)
- jupyter/rocm/tensorflow (rocm, konflux.rocm)
- jupyter/datascience (cpu, konflux.cpu, cpu.j2, mongocli-builder)

## Benefits:
- **Centralized Management**: All mongocli build stages now managed from a single location
- **Consistency**: Ensures identical mongocli compilation across all images
- **Easy Updates**: Future changes to mongocli version or build process only need to be made in [`dockerfile_fragments.py`](scripts/dockerfile_fragments.py:1)
- **Maintainability**: Reduces code duplication and potential for drift between Dockerfiles
@openshift-ci
Copy link

openshift-ci bot commented Dec 22, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link

openshift-ci bot commented Dec 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jiridanek for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jiridanek
Copy link
Member Author

/build-konflux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant