Draft: cdn-requester: Add recipes to request to frontends to cdn from its shared instance list
This is a big work in progress and everything is subject to change.
After discussion with Lukas and seeing the need expressed to manage configuration through shared instance the new cdn requester that is going to be between users and frontend requests will use recipes instead on jinja magic to request frontend and and keep the list of frontend updated.
A local sqlite3 database has been introduced to store the state of shared instance of the instance. This avoids passing an ever expanding list of shared instances and their parameters through buildout options where each change is displayed in the logs https://www.erp5.com/group_section/forum/zc.buildoutPart--option--changed-does-not-scale-with-many-slaves-on-the-frontend-ztDTRvEF34
Introduce the tools to manage a local instance data base
- LocalDBAccessor: generic tool to manage local db
- HostedInstanceLocalDB: Tool for managing instances in the DB
- InstanceListComparator: Tool to track changes between two list of instance
- SharedInstanceResultDB: Tool to update the db from another instance list
reciperequestinstancelist: add recipe for instance management
- Introduced a new recipe
requestinstancelistto compare instance databases and manage instance requests. - Added functionality to request new instances, update modified instances, and destroy removed instances.
- Implemented logging for operations and error handling for request failures.
- Updated
setup.pyto include the new recipe. - Added comprehensive unit tests to ensure correct behavior of the new recipe.
TODO:
-
Add a validator to check that an instance can be requested. For CDN requester it means at least checking if the domain is owned by the user requesting the instance -
Publish information of the shared instances