In this post, we'll look at an rpm artifact repository using a simple inotify + createrepo script. Artifacts are uploaded via webdav using apache httpd. Why apache httpd will be written towards the end of the post.
So, the solution must meet the following requirements for organizing only RPM storage:
Free
Availability of the package in the repository a few seconds after uploading to the artifact repository.
Pulp Seems like an over-engineered solution to me.
Artifacts in SonaType Nexus stored in blob. In the event of a sudden power outage, you will not be able to restore the blob if you do not have a backup. We had this error: ERROR [ForkJoinPool.commonPool-worker-2] *SYSTEM [com.orientechnologies.orient.core.storage](http://com.orientechnologies.orient.core.storage/).fs.OFileClassic - $ANSI{green {db=security}} Error during data read for file 'privilege_5.pcl' 1-th attempt [java.io](http://java.io/).IOException: Bad address. Blob was never recovered.
By default inotify-createrepo monitors a directory /var/www/repos/rpm-repo/.
You can change this directory in the file /etc/inotify-createrepo.conf.
Using
When adding any file to a directory /var/www/repos/rpm-repo/ inotifywait will create a file /tmp/need_create. The run_createrepo function runs in an infinite loop and monitors the file /tmp/need_create. If the file exists, then run createrepo --update.
To make high availability out of an existing solution, I think you can use 2 servers, Keepalived for HA and Lsyncd for artifact synchronization. Lsyncd - a daemon that monitors changes in the local directory, aggregates them, and after a certain time, rsync starts to synchronize them. Details and settings are described in the post "Fast synchronization of a billion files".
WebDav
There are several ways to upload files: SSH, NFS, WebDav. WebDav seems to be a modern and simple option.
For WebDav, we will use Apache httpd. Why Apache httpd in 2020 and not nginx?
I would like to use automated tools for building Nginx + modules (for example, Webdav).
I think you will do the rest of the Apache httpd configuration yourself.
Nginx in front of Apache httpd
Unlike Apache, Nginx uses an event-based request processing model, which means that only one HTTP server process is required for any number of clients. You can use nginx and reduce server load.
nginx-front.conf config. I think you will do the rest of the nginx configuration yourself.