-
Notifications
You must be signed in to change notification settings - Fork 122
NO-JIRA: refactor(jupyter/datascience/Dockerfile.cpu): wrap multiple RUN commands with bash for consistency, readability, and improved error handling #2647
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
Conversation
…RUN commands with bash for consistency, readability, and improved error handling
WalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ide-developer 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 |
There was a problem hiding this 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 useset -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
$TARGETARCHand${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
📒 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).
|
/kfbuild all |
|
@jiridanek: The following tests failed, say
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. |
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):
make test(gmakeon macOS) before asking for reviewDockerfile.konfluxfiles should be done inodh/notebooksand automatically synced torhds/notebooks. For Konflux-specific changes, modifyDockerfile.konfluxfiles directly inrhds/notebooksas these require special attention in the downstream repository and flow to the upcoming RHOAI release.Merge criteria:
Summary by CodeRabbit