Skip to content

KPMP 6555 dont copy when full#170

Merged
HaneenT merged 2 commits into
developfrom
KPMP-6555_dont-copy-when-full
Jun 16, 2026
Merged

KPMP 6555 dont copy when full#170
HaneenT merged 2 commits into
developfrom
KPMP-6555_dont-copy-when-full

Conversation

@Dert1129

@Dert1129 Dert1129 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • Updated Docker image version to 1.11
  • Bug Fixes

    • Added disk space validation before package transfers to prevent failures when insufficient storage is available; packages are automatically flagged when transfer cannot proceed

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The DLUWatcher class gains three new methods (get_directory_size, format_size, check_disk_space) and two new directory instance attributes. move_packages_to_DLU is updated to verify disk space before copying each package. Separately, the GitHub Actions workflow bumps IMAGE_TAG from 1.10 to 1.11.

Changes

Disk Space Check in DLUWatcher

Layer / File(s) Summary
Imports, directory config, and disk space helper methods
data_management/watch_files.py
Adds shutil and Path imports; initializes globus_data_directory (/globus) and dlu_data_directory (/data) in the constructor; introduces get_directory_size (walks source tree to sum bytes), format_size (formats bytes to human-readable units), and check_disk_space (enforces free-space buffer, logs failure, and sets globus_dlu_status on error).
move_packages_to_DLU integration
data_management/watch_files.py
Builds target_directory from self.dlu_data_directory, checks that the Globus package directory exists, and skips the package if check_disk_space returns False.

Docker Image Tag Bump

Layer / File(s) Summary
IMAGE_TAG version bump
.github/workflows/build-libra.yml
IMAGE_TAG environment variable changed from 1.10 to 1.11, updating the Docker image tag for both develop-branch and non-develop-branch builds.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KPMP-6555_dont-copy-when-full

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27890c67-938a-4a3e-bfda-ac82355bd363

📥 Commits

Reviewing files that changed from the base of the PR and between 7dbb57d and 4bc0ccf.

📒 Files selected for processing (2)
  • .github/workflows/build-libra.yml
  • data_management/watch_files.py

Comment on lines +94 to +100
if available_space < required_space or source_size == 0:
error_msg = (f"Error: Insufficient disk space for package {package_id}. "
f"Required: {self.format_size(required_space)}, "
f"Available: {self.format_size(available_space)}. Skipping.")
logger.warning(error_msg)
self.dlu_management.update_dlu_package(package_id, { "globus_dlu_status": f"Error: Insufficient disk space for package {package_id}" })
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid classifying empty source directories as disk-space failures.

On Line 94, source_size == 0 is treated as “insufficient disk space,” and Line 99 persists that status. That bypasses the existing directory-validity path and stores the wrong failure reason. Because package pickup filters on globus_dlu_status (non-NULL excluded), this can incorrectly gate retries/triage.

Proposed fix
-            if available_space < required_space or source_size == 0:
+            if available_space < required_space:
                 error_msg = (f"Error: Insufficient disk space for package {package_id}. "
                             f"Required: {self.format_size(required_space)}, "
                             f"Available: {self.format_size(available_space)}. Skipping.")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if available_space < required_space or source_size == 0:
error_msg = (f"Error: Insufficient disk space for package {package_id}. "
f"Required: {self.format_size(required_space)}, "
f"Available: {self.format_size(available_space)}. Skipping.")
logger.warning(error_msg)
self.dlu_management.update_dlu_package(package_id, { "globus_dlu_status": f"Error: Insufficient disk space for package {package_id}" })
return False
if available_space < required_space:
error_msg = (f"Error: Insufficient disk space for package {package_id}. "
f"Required: {self.format_size(required_space)}, "
f"Available: {self.format_size(available_space)}. Skipping.")
logger.warning(error_msg)
self.dlu_management.update_dlu_package(package_id, { "globus_dlu_status": f"Error: Insufficient disk space for package {package_id}" })
return False

@HaneenT HaneenT merged commit 2b47af3 into develop Jun 16, 2026
1 check passed
@HaneenT HaneenT deleted the KPMP-6555_dont-copy-when-full branch June 16, 2026 16:59
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