feat: add rhoai-upgrade-helpers and relocate binary to /opt/rhoai-cli#7
Conversation
- 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>
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughDockerfile 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 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (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 |
There was a problem hiding this comment.
🧹 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 anUPGRADE_HELPERS_COMMITARG 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
COPYsource/workspace/bin/kubectl-odhcorrectly matches the Makefile'sBINARY_NAME=bin/kubectl-odh. However, the rename fromkubectl-odhtorhoai-clicreates 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 buildrhoai-clidirectly 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>
/opt/rhoai-upgrade-helpers in runtime image (repo URL and branch
configurable via build args)
/opt/rhoai-cli/bin/rhoai-cli and update ENTRYPOINT accordingly
Co-authored-by: Cursor cursoragent@cursor.com
Description
How Has This Been Tested?
Merge criteria:
Summary by CodeRabbit
New Features
Chores