127 Commits

Author SHA1 Message Date
Giacomo Vercesi 4f9e811110 pypeline: implement Pypeline Data Viewer
Implement the Pypeline Data Viewer, an HTTP server that allows browsing
the data stored by PRSS.
2026-06-17 17:48:13 +02:00
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 d3d73a48c9 PRSS: add envvars for secret parameters
Allow passing command-line options which might contain secrets via an
environment variable instead of directly on the CLI.
2026-06-17 09:43:07 +02:00
Giacomo Vercesi d6e02c1f95 get_middlewares: allow x-project-id
When authentication is enabled the `x-project-id` header needs to be
provided. Add it to the list of allowed CORS headers.
2026-06-17 09:43:07 +02:00
Ivan Krysak 17945bbe95 local_provider: improve an error message 2026-06-15 17:28:22 +02:00
Ivan Krysak ea785998ec Minor improvements 2026-06-15 11:47:41 +02:00
Giacomo Vercesi 828bd9c49f pypeline: add remote storage server
Add the PRSS (Pypeline Remote Storage Server) and the relay companion
server.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi ff4c899954 pypeline: add RSSStorageProvider
Add the storage provider (and factory) for the Pypeline Remote Storage
Server (PRSS).
2026-05-22 09:04:35 +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 25b90139f0 pypeline: rotate notification broker code
Move around the code pertaining to the notification broker, making the
various roles a bit clearer. This also de-couple the broker logic from
the local revng daemon.
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 2f0f320711 revng2 project init: fix for non-local providers
Fix the `revng2 project init` command to work with all
`StorageProvider`s, not just the local one. It still specializes for the
local one to allow creating the model file.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 41ad874013 StorageProviderFactory: add lock_type parameter
Add the `lock_type` parameter to `StorageProviderFactory`, this allows
signaling what operations are going to be done while using the provider.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi 6f6cffde3b LocalProvider: add object_id_string to objects
Add the `object_id_string` to the `objects` table. This is for
debugging purposes as it's hard to figure out what is what with binary
objects ids.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi d7d87e237a LocalProvider: add migration logic
Add additional logic to allow the local database to be migrated to newer
versions.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi ccadc30709 StorageProvider: clarify prune purpose 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 4e0f4a6540 pypeline: stabilize pipeline description
Before this commit the pipeline description suffered from some
non-determinism that led to some values changing between runs of
`revng`. Add extra sorting so to eliminate the non-determinism.
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 a68c53cbb0 pypeline.cli: drop PypeGroup
The `PypeGroup` click group did not provide any real benefit:
* It added extra help about pipebox arguments, but text that was not
  correct from where the help was coming from (the group does not parse
  the arguments). The subcommands still reports it though.
* It forbid using non-PypeGroup and non-PypeCommand commands in the
  command tree, but in the long run this is desirable so it should be
  dropped
For these reasons it has been dropped.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi dc511987ed revng2 project daemon: propagate exception
When one of the tasks completes, it might be due to an exception, call
the `exception()` method so that the exception can actually be caught by
the try block.
2026-05-22 09:04:35 +02:00
Giacomo Vercesi e8d6e48a1f pypeline-cli: fix logic for --format option
The `--format` option relied on `click.Context.get_parameter_source` to
determine if the default value for the `--format` parameter was passed.
A bug in click caused this to behave "correctly", click 8.4.0 fixed the
bug. Change the logic by using `None` as the default value so that it
can be checked without using the parameter source.
2026-05-19 10:41:18 +02:00
Giacomo Vercesi aa28975c3f LocalStorageProvider: prune on startup
Add two situations where the cache is pruned on startup, removing all
the cached objects from storage:
1. the version field does not match the current one
2. the model has been changed out of band

The second one is very important as it allows to use the revng2 CLI
while editing the model manually on disk.
2026-04-10 11:45:13 +02:00
Giacomo Vercesi e5ca09e0f3 pypeline-storage: drop revng_ prefix
Drop the `revng_` prefix for the version field.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi a91d87315a pypeline daemon: add /status endpoint
Add a `/status` endpoint to the daemon that allows verifying that the
daemon is up.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi f626dece53 Add revng2 project dump-pipeline
Add the `revng2 project dump-pipeline` command which allows emitting the
pipeline description from the command-line.
2026-04-10 11:45:12 +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 9fd3077081 pype: adopt option group for wrappers
Group all the wrapper options (`--lldb`, `--gdb`, etc.) in an option
group, so that they are rendered in an indented section.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi d41f7bcd6e LocalStorageProvider: handle OSErrors
Ignore `OSError`s in `LocalStorageProvider` when rebuilding the list of
files for a given hash, since those paths might have become inaccessible
in the meantime.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi 2afcb4ec67 pype: improve output on wider terminals
Click clamps the output of its help to 80 columns, this makes reading
the help on wider terminals quite annoying. Change the formatter class
used to allow better help output on wider terminals.
2026-04-10 11:45:12 +02:00
Giacomo Vercesi b2293fec30 pypeline: fix Pipeline.run_analysis_list
Fix the `run_analysis_list` method as it had an incorrect way of
computing the overall list of invalidated artifacts.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi a904f356a4 pypeline-daemon: clean up websocket code
Clean up the code related to the handling of websockets and allow the
daemon to be terminated gracefully without any error messages.
2026-03-31 17:00:49 +02:00
Giacomo Vercesi a886c0509f pypeline: fix savepoint_id_to_artifact 2026-03-31 17:00:49 +02:00
Giacomo Vercesi fd95c7704e pypeline: expose artifact's pipe dependencies
Add an additional piece of metadata that states which pipes are used to
compute a specific artifact. This can be used to derive which
configuration options influence the creation of an artifact.
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 20059b5f3a pypeline: make Container.serialize selective
Change the `Container.serialize` interface so that it is possible to
supply a list of objects that will be serialized instead of all the ones
in the container.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 644b71b319 pypeline: add additional artifact PTML metadata
Add two additional fields to `Artifact`: `defined_locations` and
`preferred_artifacts`. These are pieces of metadata that allow
navigation between multiple PTML-enabled documents.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 63a11d0c63 pypeline: add Analysis.is_available
Add a method to the `Analysis` interface which allows an analysis to
report if it is available for execution.
2026-03-31 17:00:48 +02:00
Giacomo Vercesi 7a152425ca pypeline: add filename to artifact
Add a meta-information field to the artifact that adds an hint of what
filename a single object of an artifact should be represented in a
filesystem.
2026-03-31 17:00:48 +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 fc9193a0a8 pypeline: convert pipeline parser to class
Since most functions in `pipeline_parser.py` had a lot of redundancy in
the parameters passed, convert all of them to be part of a
`PipelineParser` class which stores all the variables.
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