Skip to content

feat: add rhoai-upgrade-helpers and relocate binary to /opt/rhoai-cli#7

Merged
lburgazzoli merged 2 commits intoopendatahub-io:mainfrom
lburgazzoli:helper-scripts
Feb 16, 2026
Merged

feat: add rhoai-upgrade-helpers and relocate binary to /opt/rhoai-cli#7
lburgazzoli merged 2 commits intoopendatahub-io:mainfrom
lburgazzoli:helper-scripts

Conversation

@lburgazzoli
Copy link
Copy Markdown
Member

@lburgazzoli lburgazzoli commented Feb 16, 2026

  • Clone rhoai-upgrade-helpers repo in builder stage and copy to
    /opt/rhoai-upgrade-helpers in runtime image (repo URL and branch
    configurable via build args)
  • Move CLI binary from /usr/local/bin/kubectl-odh to
    /opt/rhoai-cli/bin/rhoai-cli and update ENTRYPOINT accordingly
  • Add /opt/rhoai-cli/bin to PATH for convenient invocation

Co-authored-by: Cursor cursoragent@cursor.com

Description

How Has This Been Tested?

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

  • New Features

    • The container now uses rhai-cli as the default command-line tool.
    • Upgrade helper tools are bundled and available inside the image.
  • Chores

    • Build and runtime image configuration updated to include the new CLI and helpers.
    • Environment setup adjusted so the new CLI is on the default PATH.

- Clone rhoai-upgrade-helpers repo in builder stage and copy to
  /opt/rhoai-upgrade-helpers in runtime image (repo URL and branch
  configurable via build args)
- Move CLI binary from /usr/local/bin/kubectl-odh to
  /opt/rhoai-cli/bin/rhoai-cli and update ENTRYPOINT accordingly
- Add /opt/rhoai-cli/bin to PATH for convenient invocation

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Dockerfile updated to add build args for cloning the rhoai-upgrade-helpers repo, copy that helper tree into the final image, replace the kubectl-odh runtime binary with rhai-cli at /opt/rhai-cli/bin/rhai-cli, update PATH, and change ENTRYPOINT to the new rhai-cli binary.

Changes

Cohort / File(s) Summary
Dockerfile
Dockerfile
Added ARG UPGRADE_HELPERS_REPO and ARG UPGRADE_HELPERS_BRANCH, clone rhoai-upgrade-helpers into /opt/rhai-upgrade-helpers during build, copy /opt/rhai-upgrade-helpers into the final image, copy builder output to /opt/rhai-cli/bin/rhai-cli, update PATH to include /opt/rhai-cli/bin, and change ENTRYPOINT from kubectl-odh to /opt/rhai-cli/bin/rhai-cli.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 I hopped through layers, fetched helpers with glee,
Cloned a tiny repo and tucked it by me,
A new CLI found its cozy bin,
PATH adjusted — let the run begin,
I celebrate this image, light and free! 🥕✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (30 files):

⚔️ Dockerfile (content)
⚔️ pkg/lint/check/condition_test.go (content)
⚔️ pkg/lint/check/validate/component.go (content)
⚔️ pkg/lint/check/validate/workload.go (content)
⚔️ pkg/lint/checks/components/codeflare/codeflare.go (content)
⚔️ pkg/lint/checks/components/codeflare/codeflare_test.go (content)
⚔️ pkg/lint/checks/components/datasciencepipelines/renaming.go (content)
⚔️ pkg/lint/checks/components/kserve/serverless.go (content)
⚔️ pkg/lint/checks/components/kserve/serverless_test.go (content)
⚔️ pkg/lint/checks/components/kueue/kueue.go (content)
⚔️ pkg/lint/checks/components/kueue/kueue_test.go (content)
⚔️ pkg/lint/checks/components/modelmesh/modelmesh.go (content)
⚔️ pkg/lint/checks/components/modelmesh/modelmesh_test.go (content)
⚔️ pkg/lint/checks/dependencies/openshift/openshift.go (content)
⚔️ pkg/lint/checks/dependencies/openshift/openshift_test.go (content)
⚔️ pkg/lint/checks/dependencies/servicemeshoperator/servicemeshoperator.go (content)
⚔️ pkg/lint/checks/dependencies/servicemeshoperator/servicemeshoperator_test.go (content)
⚔️ pkg/lint/checks/services/servicemesh/servicemesh.go (content)
⚔️ pkg/lint/checks/services/servicemesh/servicemesh_test.go (content)
⚔️ pkg/lint/checks/workloads/codeflare/impacted.go (content)
⚔️ pkg/lint/checks/workloads/datasciencepipelines/instructlab_removal.go (content)
⚔️ pkg/lint/checks/workloads/datasciencepipelines/stored_version_removal.go (content)
⚔️ pkg/lint/checks/workloads/kserve/impacted.go (content)
⚔️ pkg/lint/checks/workloads/kserve/impacted_support.go (content)
⚔️ pkg/lint/checks/workloads/kserve/inferenceservice_config.go (content)
⚔️ pkg/lint/checks/workloads/notebook/impacted.go (content)
⚔️ pkg/lint/checks/workloads/ray/impacted_support.go (content)
⚔️ pkg/lint/checks/workloads/ray/impacted_test.go (content)
⚔️ pkg/util/version/helpers.go (content)
⚔️ pkg/util/version/helpers_test.go (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding rhoai-upgrade-helpers support and relocating the binary, matching the primary modifications in the Dockerfile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch helper-scripts
  • Post resolved changes as copyable diffs 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.

@lburgazzoli lburgazzoli requested a review from kahowell February 16, 2026 08:22
Copy link
Copy Markdown

@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.

🧹 Nitpick comments (2)
Dockerfile (2)

39-45: Consider pinning the upgrade-helpers repo to a specific commit SHA for reproducible builds.

Using a branch name (main) means the content cloned can differ between builds. For supply-chain integrity and reproducibility, consider adding an UPGRADE_HELPERS_COMMIT ARG and verifying it after clone:

♻️ Suggested improvement
 ARG UPGRADE_HELPERS_REPO=https://github.com/red-hat-data-services/rhoai-upgrade-helpers.git
 ARG UPGRADE_HELPERS_BRANCH=main
+ARG UPGRADE_HELPERS_COMMIT=""
 
 RUN git clone --depth 1 --branch ${UPGRADE_HELPERS_BRANCH} \
     ${UPGRADE_HELPERS_REPO} /opt/rhoai-upgrade-helpers \
-    && rm -rf /opt/rhoai-upgrade-helpers/.git
+    && if [ -n "${UPGRADE_HELPERS_COMMIT}" ]; then \
+         cd /opt/rhoai-upgrade-helpers && \
+         git fetch --depth 1 origin ${UPGRADE_HELPERS_COMMIT} && \
+         git checkout ${UPGRADE_HELPERS_COMMIT}; \
+       fi \
+    && rm -rf /opt/rhoai-upgrade-helpers/.git

93-93: The COPY source path is correct; consider whether the naming inconsistency warrants updating the Makefile.

The COPY source /workspace/bin/kubectl-odh correctly matches the Makefile's BINARY_NAME=bin/kubectl-odh. However, the rename from kubectl-odh to rhoai-cli creates an inconsistency between the build artifact name and the final image binary name. If this renaming is intentional for the public API, consider updating the Makefile to build rhoai-cli directly for consistency. If the rename is unnecessary, consider removing it. Note that if the Makefile's output name changes in the future, the build will fail at the COPY step—not silently, but with an explicit error.

Rename container paths and binary references from rhoai-cli to rhai-cli
to align with the new CLI naming convention. Also update the local
upgrade-helpers destination path to /opt/rhai-upgrade-helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lburgazzoli lburgazzoli merged commit bc3aaaf into opendatahub-io:main Feb 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants