Skip to content
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

NC | CLI | Lifecycle worker #8839

Merged
merged 1 commit into from
Mar 4, 2025
Merged

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Feb 27, 2025

Explain the changes

This PR adds the NC CLI command used for running the lifecycle worker.

  1. Added a new CLI command type called lifecycle and options that currently contain only the global options.
  2. Started creating a frame for the nc_lifecycle worker process -
  • Block noobaa nc_lifecycle worker from working if NooBaa service is not running.
  • list buckets, iterate them and on every bucket that contains a lifecycle policy - handle the rules.
  • handle_bucket_rule logic -
    • check that the rule is enabled
    • get delete candidates
    • call delete multiple objects
    • update last_sync of the processed lifecycle rule
  • the actual rules processing will be added in the next PRs, currently its implementation is empty.
  1. Added 2 new manage_nsfs_cli errors - SystemJsonIsMissing and NooBaaServiceIsNotActive.

Refactoring -

  1. moved nsfsObjectSDK from nsfs.js to its own file src/sdk/nsfs_object_sdk.js and updated its callers.
  2. moved NOOBAA_SERVICE_NAME and service state status check by systectl call from health.js to manage_nsfs_cli_utils.js.

Issues: Fixed #xxx / Gap #xxx

Gaps -

  1. Add implementation of the processing of the 4 rules in POSIX.
  2. Add implementation of the processing of expiration and nonCurrenytays
  3. Add notifications usage.
  4. Decide on batch size
  5. Endpoints Stats should be supported? currently we will not collect stats on the lifecycle worker process.
  6. Add CLI unit tests
  7. Add CLI documentation.

Testing Instructions:

  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-lifecycle-cli branch 2 times, most recently from c3aaeaf to f5bda99 Compare February 27, 2025 15:46
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Mar 2, 2025
@romayalon romayalon force-pushed the romy-lifecycle-cli branch from 30ed1dd to 1428802 Compare March 3, 2025 08:18
@pull-request-size pull-request-size bot added size/L and removed size/XL labels Mar 3, 2025
@romayalon romayalon requested a review from nadavMiz March 3, 2025 08:21
Copy link
Contributor

@nadavMiz nadavMiz left a comment

Choose a reason for hiding this comment

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

can you add PR description so if anyone wants to understand why the changes were done we will have a record for it

Copy link
Contributor

@nadavMiz nadavMiz left a comment

Choose a reason for hiding this comment

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

LGTM

@romayalon romayalon force-pushed the romy-lifecycle-cli branch from 1428802 to b418f8e Compare March 4, 2025 12:49
@romayalon romayalon merged commit 16133d6 into noobaa:master Mar 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants