nexus-main / nexus

Extensible user interface for your time-series data lake with REST API support.
MIT License
4 stars 5 forks source link

Data source extensions should be composable #116

Open Apollo3zehn opened 2 weeks ago

Apollo3zehn commented 2 weeks ago

This merge requests adds a pipeline feature to Nexus so that multiple IDataSources can be chained. This solves two problems:

To distinguish which data source should handle which data requests, every resource gets an integer property assigned under the path nexus/pipline-position:

grafik

This position is set by Nexus when the individual data sources return their resource catalogs. It is then later used to distribute ReadRequests to the corresponding data sources.

At the same time this additional piece of metadata is useful in making the data processing pipeline more tracable so that users can always find out which version of a software and which configuration led to the specific set of data. In future we should add Git support and create a commit every time the configuration changes. The current commit ID will then become part of the catalog metadata (#119).

A frequent change to Nexus source code is the renaming of DataSourceRegistration to Pipeline. This was necessary because we now do not only have a single DataSourceRegistration to provide a set of catalogs but multiple DataSourceRegistrations which compose a pipeline.

There are also many changes regarding to the "format on save" feature, i.e. often useless spaces have been removed. Or I have reformatted some individual LOC without changing their meaning.

Here are some comments to the individually changed files:

.github/workflows:

.vscode/settings.json

notes/plugin-pipeline.excalidraw

openapi.json

src/Nexus.UI/Components/CatalogAboutView.razor

src/Nexus.UI/Core/AppState.cs

src/Nexus.UI/Core/NexusDemoClient.cs

src/Nexus.UI/ViewModels/FakeResourceCatalogViewModel.cs

src/Nexus/API/CatalogsController.cs

src/Nexus/API/SourcesController.cs

grafik

The file pipelines.json contains all user-configured pipelines and the pipelines itself are managed by the newly created service PipelineService and the file system interaction is handled by the already existing DatabaseService which are both injected into this file (src/Nexus/API/SourcesController.cs).

The REST API code in this file has been adapted to let users interact with pipelines instead of data source registrations.

src/Nexus/API/UsersController.cs

src/Nexus/Core/CatalogContainer.cs

src/Nexus/Core/Models_NonPublic.cs

src/Nexus/Core/Models_Public.cs

src/Nexus/Extensibility/DataSource/DataSourceController.cs

src/Nexus/Extensions/Sources/Sample.cs

grafik

This property can be deliberately set by a data source or - in case the data source doesn't do this - Nexus will do it for you so that this value is never null. So the originalResourceName will now always be part of a ReadRequest.

src/Nexus/Extensions/Writers/Csv.cs

src/Nexus/Program.cs

src/Nexus/Services/AppStateManager.cs

src/Nexus/Services/CatalogManager.cs

src/Nexus/Services/DataControllerService.cs

src/Nexus/Services/DataService.cs

src/Nexus/Services/DatabaseService.cs

src/Nexus/Services/PipelineService.cs

src/Nexus/wwwroot/css/app.css

src/clients/dotnet-client/NexusClient.g.cs

src/clients/python-client/nexus_api/_nexus_api.py

src/extensibility/dotnet-extensibility/DataModel/DataModelExtensions.cs

new: grafik

old grafik

src/extensibility/dotnet-extensibility/DataModel/PropertiesExtensions.cs

src/extensibility/dotnet-extensibility/DataModel/ResourceCatalog.cs

src/extensibility/dotnet-extensibility/Extensibility/DataSource/DataSourceTypes.cs

src/extensibility/dotnet-extensibility/Extensibility/DataSource/IDataSource.cs

src/extensibility/python-extensibility/nexus_extensibility/_extensibility_data_source.py

tests/Nexus.Tests/DataSource/DataSourceControllerFixture.cs

tests/Nexus.Tests/DataSource/DataSourceControllerTests.cs

tests/Nexus.Tests/DataSource/SampleDataSourceTests.cs

tests/Nexus.Tests/DataSource/TestSource.cs

tests/Nexus.Tests/Other/CatalogContainersExtensionsTests.cs

tests/Nexus.Tests/Other/PackageControllerTests.cs

tests/Nexus.Tests/Services/CatalogManagerTests.cs

tests/Nexus.Tests/Services/DataControllerServiceTests.cs

tests/Nexus.Tests/Services/DataServiceTests.cs

tests/Nexus.Tests/Services/PipelineServiceTests.cs

tests/Nexus.Tests/Services/TokenServiceTests.cs

tests/TestExtensionProject/TestDataSource.cs