25 Commits

Author SHA1 Message Date
Giacomo Vercesi dfb9a36bb2 pypeline: implement compression
Implement compression of objects before they are saved into the storage
provider. Each container type can specify which algorithm to use
(currently `none` or `zstd`) and the compression level.
2026-06-17 10:06:35 +02:00
Giacomo Vercesi f0144ac0c9 pypeline: make artifact_categories kebab-case 2026-06-17 09:43:07 +02:00
Giacomo Vercesi 3a9317d512 pypeline: factor out starlette middleware code
Factor out in a function the generation of the middleware list, to
facilitate reuse. Add the `AuthMiddleware` which allows authenticating
requests.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 653f92514b pypeline: adopt hypercorn in place of uvicorn
Switch out from using uvicorn to hypercorn for the pypeline daemon, make
the facilities create hypercorn commands in stand-alone functions, as
they will be re-used for other servers later on.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi edab3e26e9 ProjectMetadata: add additional fields
Expand the `ProjectMetadata` dataclass to include additional timestamps
and the hash of the pipeline description. Change all the
`StorageProvider`s so that all the new data is saved and returned.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi a1878f0f05 StorageProvider: collapse object deps and saving
Consolidate the saving of object dependencies and saving the actual
objects' data into a single function called `add_objects`. The previous
methods `add_dependencies`, `add_custom_invalidation_data` and `put`
have been removed.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi bbff447181 pypeline: split ScheduledTask
Due to the drifting differences, split `ScheduledTask` into
`PipeScheduledTask` and `SavepointScheduledTask`, which allows each to
specialize on the task it has to accomplish.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi e6bdae206e pypeline: notifications a duty of StorageProvider
Make the issuing of notification completely out of band with respect to
the `Pipeline`. Now the `StorageProvider` is responsible for providing
notifications to clients. Since some providers are local-only, there is
a `LOCAL_QUEUE` which allows sensing notifications through a local
queue, re-using the local revng daemon.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi b7f914d53f StorageProvider: move invalidate into set_model
Make `set_model` perform both the invalidation and the changing of the
model bytes. This makes persisting the result of an analysis to storage
atomic.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 2fabd9c400 pypeline: split Pipe.invalidate in two
Split the `invalidate` method in two phases: in `invalidateCheck` it
just checks if the model diff warrants the execution of the actual
`invalidate` method, which requires fetching the custom invalidation
data from storage. The actual `invalidation` method remains the same.
This should make invalidation faster for storage providers that store
the invalidation remotely.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi dbc734f23a CMake: force use of Python3
Switch from using `find_package(Python ...)` to `find_package(Python3
...)` as it excludes that CMake picks a Python 2 version by accident.
2026-05-14 11:26:41 +02:00
Giacomo Vercesi 18e3501731 pypeline: implement proper config parsing
Overhaul the pipeline configuration logic by collapsing all dynamic
configuration options, both for analyses and pipes into a single
dictionary. Change all the interfaces so that there is no longer
distinction between the configuration of an analysis and of pipes.
Expose these options to the command line via `--{name}-configuration`
options for each pipe/analysis that is applicable to the command-line
invocation.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 2e6193e77f test_pypeline_daemon: fix flaky SIGSEGV
Avoid triggering a flaky SIGSEGV caused by running the asyncio event
loop in a thread. Switch to using `Process` which avoids the issue
altogether.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi 9b68cf4a39 pypeline-daemon: rework /artifact endpoint
Rework the artifact endpoint, making it similar to the CLI invocation.
It now works on a single artifact and can be made to return both `json`
and `tar` as formats.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi 4c6436f7b2 pypeline: introduce artifact category
Add categories in the pipeline, allow an artifact to have a category
specified which allows it to be shown or hidden by default. Adapt the
CLI tools to hide artifacts of the category that don't
`show_by_default=True`.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 39f1a9c3a9 pypeline: drop underscores from pipeline yaml
Remove the only instance of underscores in the pipeline yaml from the
use of `analysis_lists`. Substitute it with `analysis-list`.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 550ac7b700 pypeline-daemon: add put-file endpoint
Add an endpoint to the daemon that allows adding a file to the file
storage.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 6dc053e55c pypeline-daemon: rework error propagation
Rework how errors are propagated from the daemon code to the HTTP
client, creating an exception hierarchy to handle the most common
cases.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 14d95a924d pypeline: rework fields in pipeline metadata
Rework which information is transmitted in the pipeline metadata,
avoiding redundancy and moving some information there instead of
returning it every time a request is made.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi c53e615fa0 Cleanup pypeline code
Remove some cruft and apply trivial changes to the existing pypeline
code, especially on the daemon side.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 773245b893 pypeline/cli: use dataclass for ctx.obj
Add typing to the `ctx.obj` object used to store pypeline-specific data
while parsing the command-line in click.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi ce60d8a1e5 pypeline: integrate model migration infrastructure
When calling `Model.deserialize` the model will be automatically be
migrated if it needs to.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi f4d0573017 pypeline: StorageProvider works with Model
Change the `get_model` and `set_model` interface of `StorageProvider` so
that it is responsibility of the `StorageProvider` to
serialize/deserialize the model before returning to the caller.
This is in preparation to the model migration being implemented, since
it's now a responsibility of the storage provider to deserialize it it
can trivially re-save it to disk if it is migrated.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 9287c51d27 pypeline: fix -C option
Instead of executing `chdir` when using the `-C` option, which is
fragile when other paths are involved, store the option in the click
context and propagate it to the required code paths that require knowing
what the base directory is.
2026-03-04 14:58:02 +01:00
Giacomo Vercesi df4f8b76ac pypeline: re-organize tests
Split the tests into two subdirectories: those that work in pure python
and those that use the C++ bindings.
2026-02-16 10:34:39 +01:00