As part of my work on the foreman_rh_cloud plugin, I need a place to store reports. Currently I use the filesystem directly, which is not a great solution especially if we think about HA enabled setups.
While working on this, I have discovered a couple of other use cases that need file storage in the system.
So far I can identify two types of file storage usage:
- Files that are uploaded by hosts for different processing, like forwarding them into the cloud. Good examples for this kind of work would be reports generated on the host that need to be forwarded to the Red Hat Cloud services, like
insights-client
reports, OpenSCAP reports or rh_cloud reports. - Files that are uploaded by the users into the Foreman server and will be consumed by the managed hosts. Examples would be Remote Execution actions that will have files attached to them, so the files would be consumed by the action running on a specific host.
- Files that will be synced from the cloud into Foreman by some automatic process. An example for that would be using Foreman as a cache service for auto-updatable components like
insights-client
. This executable tries to download latest metadata file each time it generates a report. Instead of pinging the cloud each time, we would like to have the files synced once in a while into Foreman and then distributed from there.
Current we can see two ways we can integrate Katelo and Pulp as the backend to store files:
- Using native Katello features
- Using ActiveStorage as a common interface to storage capabilities and implementing a backend in Katello similar to postgres adapter
Discussion points:
- Native Katello support enables more integration with Katello workflows
- ActiveStorage enables decoupling from a specific backend and enables replacing it with any other supported backend
- ActiveStorage does not have a native UI, meaning each plugin that consumes file storage will need to implement its own ways to access the file storage (both for upload and for download
- Native Katello will cause dependencies between plugins - thing we should try to avoid.
- Active storage will give more control on the visibility and permissions of the files, since the plugin has to implement the endpoint.
- Active storage will probably require creating object directly in Pulp and those object would not be visible from Katello UI.
I would like to start a discussion about ways of implementing file storage service as part of Foreman.