-
Notifications
You must be signed in to change notification settings - Fork 42
Fix installation logic for File on k8s #781
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
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughKubernetesInstaller now handles Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/cloudai/systems/kubernetes/kubernetes_installer.py (1)
2-2: Update copyright year to 2026.The pipeline failure indicates the SPDX header year is outdated.
Proposed fix
-# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.tests/test_base_installer.py (1)
2-2: Update copyright year to 2026.The pipeline failure indicates the SPDX header year is outdated.
Proposed fix
-# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
🤖 Fix all issues with AI agents
In `@src/cloudai/systems/kubernetes/kubernetes_installer.py`:
- Around line 121-124: The check for truthiness on File.installed_path is
redundant because File.installed_path always returns a Path; update the
kubernetes_installer.py branch that handles File items so it directly checks
existence via item.installed_path.exists() and returns InstallStatusResult(True)
when it exists, otherwise return InstallStatusResult(False, f"File
{item.installed_path} does not exist."), keeping the same InstallStatusResult
usage and message.
Greptile OverviewGreptile SummaryAdded missing
This fix prevents unnecessary re-installation of files by properly tracking their installation status. Confidence Score: 5/5
|
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.
1 file reviewed, 1 comment
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.
1 file reviewed, 1 comment
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.
1 file reviewed, 1 comment
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
No files reviewed, no comments
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: 1
🤖 Fix all issues with AI agents
In `@src/cloudai/systems/kubernetes/kubernetes_installer.py`:
- Around line 121-127: The current File handling in kubernetes_installer.py uses
read_text() which fails on binary files and yields wrong error wording; change
the logic in the branch that handles isinstance(item, File) to compare bytes
using (self.system.install_path / item.src.name).read_bytes() and
item.src.read_bytes(), set item.installed_path when bytes match and return
InstallStatusResult(True), and when the file exists but bytes differ return
InstallStatusResult(False, f"File {self.system.install_path / item.src.name}
exists but content differs") instead of saying it does not exist; ensure you
still return a not-found message if the file truly doesn't exist.
jeffnvidia
left a comment
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.
LGTM
Summary
Filewasn't handled foris_installed_oneandmark_as_installed_oneofKubernetesInstallerwhich led to unnecessary re-installation.It adresses internal issue.
Test Plan
Additional Notes
—