-
Notifications
You must be signed in to change notification settings - Fork 28
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
Enable auto-generation of Lotman policies #1831
Conversation
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.
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 |
@CannonLock, this one also requires a ping for you -- there's a new |
Also note that tests will continue to fail until the Harbor outage is fixed. |
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.
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: |
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.
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?
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.
Cannon is tagged as a reviewer and I pinged cannon for the new PolicyDefinitions
object explicitly in a comment. Is that enough?
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.
@jhiemstrawisc Yup, I will post the fix within the hour.
@jhiemstrawisc I've looked through your changes and they seem correct, but I need to do another run and look at the sql database |
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.
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.
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. |
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.