Commit Graph

39 Commits

Author SHA1 Message Date
Martchus 55c7c62c7c Speed up returning build actions table by avoiding deserializing whole obj 2022-05-31 20:54:02 +02:00
Martchus ae44624989 Rebuild package DBs as well when fixing DBs 2022-05-15 00:32:46 +02:00
Martchus e343b3ca44 Split `ResourceUsage` into `MemoryUsage` and setup specific stats 2022-04-24 18:25:22 +02:00
Martchus 142f6466ae Show resource usage in UI 2022-04-23 19:56:22 +02:00
Martchus a780b26ef6 Log package cache size on startup 2022-04-20 22:47:29 +02:00
Martchus eae8af6571 Avoid big build action IDs by reusing older/lower ones 2022-04-15 19:20:01 +02:00
Martchus d163f56abf Log whether `io_uring` is used/configured 2022-03-20 17:37:33 +01:00
Martchus 11f1849fde Keep local pkg paths deduced from pacman config
It makes the setup easier and shouldn't hurt otherwise.
2022-03-15 01:07:36 +01:00
Martchus 55f081153e Add command to delete invalid build actions from DB 2022-03-07 23:36:48 +01:00
Martchus 7ade757c8d Avoid locking whole config when updating DBs
* Only lock the config for writing the reloading the config file
* Make sure all write operations to the database acquire an "update mutex"
  to ensure only one write operation happens at a time
* Do *not* acquire any additional locks when reading from a database as it
  should be safe to do so even when a write operation happens because
    * LMDB read and write transactions can happen at the same time
    * The package cache has its own mutex anyways
    * Write ops to the package cache try to lock the "update mutex" to
      prevent writing "old" data to the cache during updates
* Make "lastUpdate" atomic to avoid locking the config when accessing it
2022-03-05 18:55:52 +01:00
Martchus 8fdf7bfb04 Print certain resource limits on server startup 2022-03-05 12:34:26 +01:00
Martchus 9acd10fa4c Catch `boost::exception`s 2022-03-05 12:34:05 +01:00
Martchus 79123e4cd9 Improve error handling of server
* Return with non-zero exit code when an exception occurred
* Handle exceptions when terminating the service
2022-03-01 00:39:50 +01:00
Martchus 67fa8def0b Name additional threads 2022-02-25 23:09:46 +01:00
Martchus 90ff9678fe Limit results returned by the API for better scalability 2022-02-25 00:29:43 +01:00
Martchus 8ea2f5fd62 Reintroduce cache file as it is still required for "lastUpdate" for DBs
Maybe it makes more sense to use LMDB for this as well. On the other hand
it is an easy way of keeping the remaining state persistent.
2022-02-20 20:17:42 +01:00
Martchus 8949b5f3c1 Fix resetting running build actions on server startup 2022-02-16 19:17:29 +01:00
Martchus 557fd1a738 lmdb: Use lmdb to store build actions 2022-02-13 21:04:54 +01:00
Martchus 45922b47ec lmdb: Allow configuring cache limit 2022-01-26 00:41:53 +01:00
Martchus 218dfecf56 Avoid loading databases when modification date is <= last update
* Do HTTP head request first when loading database from mirror to avoid
  downloading the full database all the time
* Use the last modification date of the local database file because with
  the persistent storage even local database reloads became a bit expensive
2022-01-25 00:13:10 +01:00
Martchus 300f74fb10 lmdb: Open LMDB file after restoring cache so DBs added from cache have the storage initialized 2022-01-25 00:01:59 +01:00
Martchus 1c820fc2f6 lmdb: Fix storage initialization when config file cannot be loaded 2022-01-23 19:47:50 +01:00
Martchus f088e54c61 lmdb: Use package cache when querying packages for dependencies
* Use package cache when querying packages for dependencies or library
  names
* Avoid manual instantiations of `std::shared_ptr<Package>`
2022-01-21 20:35:43 +01:00
Martchus 2ffa6629c8 lmdb: Use lmdb to store packages and dependency indices 2022-01-18 21:50:53 +01:00
Martchus 95ae827c74 Fix applying relative working directory multiple times 2021-07-31 14:55:49 +02:00
Martchus f3ec908bcc Hold lock for named lock table not while acquiring named lock
Otherwise all other attempts to acquire named locks are blocked. It should
be ok because references are not invalidated when inserting/accessing
elements of an `std::unique_map`. When cleaning locks up elements are
erased, though. Hence an additional cleanup lock is required to prevent
acquiring a named lock which has already been cleaned up.
2021-07-25 00:40:39 +02:00
Martchus bc8a0549b2 Log package download limit 2021-07-14 15:27:49 +02:00
Martchus c05a581322 Increase the max. download size for packages and allow configuring it 2021-07-12 15:00:43 +02:00
Martchus 49aebdd8a5 Fix typos found via `codespell --skip .git -w` 2021-07-03 19:59:57 +02:00
Martchus 7f0ec081c6 Allow specifying build tasks with more complicated build actions
The new data structures (e.g. concurrent flag) aren't actually used yet.
2021-04-02 00:14:00 +02:00
Martchus fa969270c1 Fix warnings 2021-03-22 15:08:41 +01:00
Martchus 1c75e8f957 Allow signing packages manually after the build
Simply adding `--sign` to the `makepkg` flags doesn't work because it would
require setting up GPG within the chroot environment (of `makechrootpkg`).

When debugging it is anyways annoying that `makepkg` sends the `gpg` output
to `/dev/null`. This way the logs are preserved.
2021-03-14 21:53:51 +01:00
Martchus 4416922397 Fix clearing locks 2021-03-02 18:30:15 +01:00
Martchus 0760860c6d Log lock acquisitions/releases 2021-02-25 22:12:56 +01:00
Martchus b7f27cb0a0 Use locks to prevent multiple actions accessing the same db files and chroot dirs 2021-02-22 23:44:06 +01:00
Martchus bc993f1d78 Add locking system so build actions can acquire named locks 2021-02-20 23:25:31 +01:00
Martchus ab6b940d8e Acknowledge restoring config from cache file correctly 2021-02-09 14:59:40 +01:00
Martchus 6b274ccc88 Improve log messages 2021-02-08 23:54:03 +01:00
Martchus c1554f4c87 Initial import 2021-02-08 23:53:56 +01:00