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

Enable auto-generation of Lotman policies #1831

Merged
merged 11 commits into from
Dec 18, 2024

Conversation

jhiemstrawisc
Copy link
Member

This gives caches the ability to inform Lotman of known namespaces, which Lotman can use to automatically create a (currently toothless) purge policy.

A lot of the work here involved figuring out how to specify named lot policies through our yaml config. Examples of what I came up with can be found in docs/parameters.yaml. Outside of that, some changes involved figuring out how to merge local config with potentially-discovered config.

Until Pelican actually uses the new purge code with the Lotman purge plugin, none of this really does much other than set up a database. For now, this lets us set up most of the lot config in a cache through Pelican, and then the last bits for testing purge stuff need to be configured manually. Until then, the actual purge ordering portion of a policy isn't plumbed into anything -- eventually it will modify XRootD config directly.

Finally, I still haven't worked out completely how to manage expiration/deletion of lots. I'll save that for another PR, potentially in the next release cycle.

This gives caches the ability to inform Lotman of known namespaces, which
Lotman can use to automatically create a (currently toothless) purge policy.

A lot of the work here involved figuring out how to specify named lot policies
through our yaml config. Examples of what I came up with can be found in
docs/parameters.yaml. Outside of that, some changes involved figuring out how
to merge local config with potentially-discovered config.

Until Pelican actually uses the new purge code with the Lotman purge plugin,
none of this really does much other than set up a database. For now, this lets
us set up most of the lot config in a cache through Pelican, and then the last
bits for testing purge stuff need to be configured manually. Until then, the
actual purge ordering portion of a policy isn't plumbed into anything -- eventually
it will modify XRootD config directly.

Finally, I still haven't worked out completely how to manage expiration/deletion of
lots. I'll save that for another PR, potentially in the next release cycle.
@jhiemstrawisc jhiemstrawisc added enhancement New feature or request cache Issue relating to the cache component lotman labels Dec 16, 2024
@jhiemstrawisc jhiemstrawisc added this to the v7.12.0 milestone Dec 16, 2024
@jhiemstrawisc
Copy link
Member Author

For testing this PR, I'd recommend configuring a cache with some lotman policy and a few defined lots, of which at least one should should be an existing namespace. The cache should start up and create the lotman sqlite database, and the tester should be able to verify the values are correctly merged, that a lot is created for each top-level namespace (e.g. for /chtc but not for /chtc/PROTECTED), and that cache disk space is evenly across lots' dedicated_GB field for lots that didn't provide a config override.

@jhiemstrawisc jhiemstrawisc linked an issue Dec 16, 2024 that may be closed by this pull request
@jhiemstrawisc
Copy link
Member Author

@CannonLock, this one also requires a ping for you -- there's a new PolicyDefinitions object from parameters.yaml that replaces the old Lots object.

@jhiemstrawisc
Copy link
Member Author

Also note that tests will continue to fail until the Harbor outage is fixed.

Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

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

Mostly asking questions and clarification. A few test additions as well as some validation questions. The logic of InitLotman makes sense as do most of the helper functions. Assuming that logic is what we want, then I see any large issues.

```yaml
Lotman:
EnabledPolicy: "my-policy"
PolicyDefinitions:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this line is causing validate-parameters to fail. Seems like it might cause web-ui issues. If it doesn't currently break anything, can you create an issue for Cannon to fix so that we don't have it consistently failing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cannon is tagged as a reviewer and I pinged cannon for the new PolicyDefinitions object explicitly in a comment. Is that enough?

Copy link
Contributor

@CannonLock CannonLock Dec 17, 2024

Choose a reason for hiding this comment

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

@jhiemstrawisc Yup, I will post the fix within the hour.

@turetske
Copy link
Collaborator

@jhiemstrawisc I've looked through your changes and they seem correct, but I need to do another run and look at the sql database

@turetske turetske self-requested a review December 18, 2024 12:53
Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

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

Approving. The changes all look good and I think I managed to get the policies loaded properly. I'm being a little bit more permissive here since nothing is actually occurring in the caches, yet.

@jhiemstrawisc
Copy link
Member Author

Cannon is going to open a followup PR with the new parameter validation code, so I'm merging even though this currently fails that action.

@jhiemstrawisc jhiemstrawisc merged commit 6244b29 into PelicanPlatform:main Dec 18, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache Issue relating to the cache component enhancement New feature or request lotman
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create auto-configuration mechanism for Lotman + Caches
3 participants