Skip to content

Conversation

@jiridanek
Copy link
Member

@jiridanek jiridanek commented Nov 6, 2025

Carrying on with

Description

Reformat inline bash commands into HEREDOC blocks, so they can be later extracted to separate script files.

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

Summary by CodeRabbit

  • Chores
    • Restructured Docker build scripts for improved maintainability and standardized error handling across build stages while preserving existing functionality.

…RUN commands with bash for consistency, readability, and improved error handling
@openshift-ci openshift-ci bot requested review from atheo89 and daniellutz November 6, 2025 12:28
@github-actions github-actions bot added the review-requested GitHub Bot creates notification on #pr-review-ai-ide-team slack channel label Nov 6, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This PR refactors a Dockerfile by replacing inline RUN commands with bash heredoc scripts, consolidating architecture-specific conditionals into explicit if-blocks, and standardizing error handling across multiple build stages while preserving existing functionality.

Changes

Cohort / File(s) Summary
Dockerfile refactoring
jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu
Converted inline RUN commands to EOF-encapsulated bash heredoc scripts with standardized error handling via set -Eeuxo pipefail; consolidated architecture-specific logic (s390x vs other architectures) from inline expressions into explicit bash if-blocks; restructured multi-stage builds (cpu-base, pyarrow-builder, jupyter-minimal, jupyter-datascience, mongocli) with explicit directory management, environment setup, and finalization steps including /tmp/wheels creation and conditional wheel installation

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify error handling consistency across all refactored stages with the new heredoc and set -Eeuxo pipefail pattern
  • Confirm architecture-specific conditionals (s390x vs other arches) retain correct logic after consolidation into explicit if-blocks
  • Validate multi-stage build sequences and dependencies remain intact, particularly the pyarrow-builder, jupyter-minimal, and jupyter-datascience stages with new directory and wheel management steps
  • Test mongocli build sequence to ensure functionality is preserved through the restructuring

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes the required sections (Description, How Has This Been Tested) and mentions the self-checklist, but testing details are missing and all checklist items remain unchecked. Complete the testing section with specific details of how changes were tested, and check off the applicable items in the self-checklist and merge criteria before final approval.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: refactoring inline RUN commands to use bash heredocs for consistency, readability, and error handling in the Dockerfile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@openshift-ci openshift-ci bot added size/l and removed size/l labels Nov 6, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu (1)

219-235: Fix inconsistent shell specification in heredoc blocks.

Lines 219 and 244 use RUN <<'EOF' without specifying /bin/bash, which defaults to /bin/sh. However, both blocks use set -Eeuxo pipefail, which is bash-specific syntax and will fail in /bin/sh. This breaks the consistency of the refactoring and creates a functional defect.

Apply this diff to fix both blocks:

-RUN <<'EOF'
+RUN /bin/bash <<'EOF'

Also applies to: 244-255

🧹 Nitpick comments (2)
jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu (2)

68-80: Standardize architecture variable reference syntax.

The refactoring uses both $TARGETARCH and ${TARGETARCH} inconsistently. Lines 71, 84, 105, 330, 344, 354, 363, and 383 use $TARGETARCH, while lines 204, 221, 246 use ${TARGETARCH}. For consistency and clarity, prefer the braced form ${TARGETARCH} throughout, especially in conditionals.

Also applies to: 82-100, 103-110, 142-193, 311-316, 328-335, 342-349, 352-369, 378-415


378-415: Verify multiline comment does not affect heredoc parsing.

Lines 391–392 contain a multiline comment within the heredoc that spans across the conditional. While syntactically valid, ensure this doesn't inadvertently affect readability or future maintenance. Consider reformatting the comment to be on a single line or as separate line comments if clarity is a concern.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7e9a7 and acd2a43.

📒 Files selected for processing (1)
  • jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build (jupyter-datascience-ubi9-python-3.12, 3.12, linux/ppc64le, false) / build
  • GitHub Check: build (jupyter-datascience-ubi9-python-3.12, 3.12, linux/amd64, false) / build
  • GitHub Check: Red Hat Konflux / odh-workbench-jupyter-datascience-cpu-py312-ubi9-on-pull-request
🔇 Additional comments (1)
jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu (1)

275-275: Verify intentional blank line.

Line 275 is marked as changed but contains only whitespace. Confirm this formatting is intentional (e.g., for readability between sections).

@jiridanek
Copy link
Member Author

/kfbuild all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 6, 2025

@jiridanek: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/notebook-jupyter-ds-ubi9-python-3-12-pr-image-mirror acd2a43 link true /test notebook-jupyter-ds-ubi9-python-3-12-pr-image-mirror
ci/prow/images acd2a43 link true /test images
ci/prow/notebooks-py312-ubi9-e2e-tests acd2a43 link true /test notebooks-py312-ubi9-e2e-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

lgtm review-requested GitHub Bot creates notification on #pr-review-ai-ide-team slack channel size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants