-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GNIP 89: Architecture Design - Resource and Storage Manager Modules #7664
Comments
Hi @afabiani, this is a very interesting proposal and I'm happy to see that GeoNode 4.0 is moving forward. It would be helpful to see how the Another question that comes up is if with |
@francbartoli please take a look at the proposed implementation here: Resource Manager
Storage Manager
GeoServer Async Uploader RefactoringHope this helps. Feel free to comment and review/test the DRAFT PR at your convenience. |
@afabiani Thanks for the proposal. I am not done with reviewing it since it is complex and should be reviewed thoroughly. @francbartoli manager.py for RessourceManager: settings.py which does provide rm_settings.RESOURCE_MANAGER_CONCRETE_CLASS: |
Thanks @gannebamm, I see. I have to deep dive into this since it is huge. Couple of feedbacks @afabiani:
|
|
Thanks @afabiani. For the first point: whatever you think is better for the stability and testability of the PR of course. |
If I understand the concept properly this should use a minio S3 compatible storage as concrete storage manager, right? https://github.com/gannebamm/geonode/blob/storage_test/.env#L9-L14 It does not work currently due some of those gannebamm@4e66e66 commits did alter the utils.py, which will raise an import error like:
|
|
Yeah, I have seen your commits and have merged them. But the general idea is correct? Instantiate the concrete storage via .env file and using eg. a minio S3 storage? I would like to keep this GNIP discussion on the architectural level. Errors and changes to the PR itself shall be discussed there. |
My +1 for this code cleanup. I further do welcome @francbartoli suggestion to review the PR with "more than two eyes" @afabiani Can you say how a migration from < 4 versions will look like? Will it for example work as a Django migration or are other steps needed? |
@t-book the migrations will be all automatic and the old data ported to the new attributes through several @mattiagiupponi is currently working on the latest ones. |
I also like the code cleanup and idea of pluggable stores. I would like to run a working example with a non-file-system based store, like eg. minio S3 storage, just as a proof of concept. I will try to work on that and see how easily pluggable the proposed system is. I am sorry but that will take some time (maybe middle/end of next week). |
I got it working for documents in my repo: gannebamm@e97e943 You will have to create the default bucket 'geonode' manually before uploading a document. The minio admin is published on localhost:9000. It seems to work ok so far. Uploading a shapefile does work, too. |
I have done the last test and was able to load the statics into a minio S3 storage. To actually load the frontend from S3 the nginx image needs to be edited to load from the S3 minion container. This is just configuration and not a bug. |
A PSC call about this GNIP and the new client has been held last Friday. Here below I summarize the outcomes.
The concern raised by @t-book about the complexity of working with React / MapStore to implement custom views and pages has been discussed thoroughly with the frontend team. In the end we decided to slightly change the initial plan, where the React client also incorporated the legacy pages. We think this is the sweet spot: the new client will still be designed as an SPA, and will incorporate more and more functionalities from the legacy UI. However, anybody will be able to write and host custom pages with simple plain Django templates, and no hacks in between. This new approach will be applied initially to the integration of the legacy pages, but it will also be ported to the new home and editor pages afterwards. This change will probably be merged to the master branch during the next couple of weeks. |
GNIP 89: Architecture Design - Resource and Storage Manager Modules
Overview
Currently the architectural model of GeoNode is flat.
We have a
ResourceBase
class, which basically stores almost all the metadata fields for every generic GeoNode resource, and several concrete instances, such asLayer
,Map
,Document
andGeoApp
, that add few more attributes and methods specific to the instance itself.Whenever we need to create a new resource on GeoNode, actually we do:
ResourceBase
instance and set/update few or more metadata fieldsgeonode.base
module, some others from thegeonode.<type>
one and, finally, some other from thegeonode.<backend_gis>
one to finalize the configurationThis "functional" approach is confusing and error prone. Moreover it is quite difficult to update or change the backends, often the developer must deal with a crazy
if-else
checks on every view and template.What we would like to achieve with this GNIP, is:
if-else
checkspre-post-<delete>/<save>
signalsbackend-gis
pluggable and centralize any further check we would need when updating a resource metadata or security permission.Last, but not least, we would like also make the uploader module more stable and efficient by avoiding redundant calls and signal fallbacks.
Proposed By
Alessio Fabiani <@afabiani>
Giovanni Allegri <@giohappy>
Ricardo Garcia Silva <@ricardogsilva>
Mattia Giupponi <@mattiagiupponi>
Assigned to Release
This proposal is for GeoNode 4.0.
State
Proposal
In order to achieve our goals, we need to review a bit the current GeoNode core architecture design.
We envisage four main components of the new GeoNode resource management architecture (see Fig.1).
Storage Manager
The general Storage will be able to organize and allocate GeoNode resources raw data, whatever a GeoNode resource could be. Through the Storage Manager it will be possible to read/write raw data from a pluggable (aka
concrete
) storage, which could be aFileSytemStorage
as well as aDropboxStorage
orAmazonS3Storage
. Theconcrete storage
will be defined by the settings through a factory mechanism.On the other side we will benefit of a generic
storage interface
being able to expose generic methods to access the R/W operations on the raw data.Resource Manager
The Resource Manager exposes some atomic operations allowing it to manage the GeoNode
ResourceBase
models. This is an internal component meant to be used primarily by theResource Service
to manage the publication ofResourceBase
s into GeoNode.As well as the Storage Manager, the Resource Manager also will benefit also of an abstract
Resource Manager Interface
, a default implementation and aconcrete resource manager
which will pluggable, defined through the settings by a factory mechanism, and being able to deal with thebackend gis
.Accordingly to this architectural design, almost all the logic specifically bounded to the
backend gis
, will be moved to theconcrete resource manager
, ending up with a real separation of concerns.The proposed
Resource Manager Interface
will expose some generic methods allowing to perform CRUD operations against aResourceBase
. Therefore, accordingly to this paradigm, a GeoNode developer should never break this contract by manually instantiating aResourceBase
, but, instead, passing through theresource manager
methods. This is the only way to guarantee that theResourceBase
state will be always coherent and aligned with thebackend gis
.The proposed
Resource Manager Interface
would be something like the following oneThe
concrete resource manager
will be dealing with thebackend gis
through the factory instance, by taking care of performing the generic logic against theResourceBase
and later delegate thebackend gis
to finalize it.As an instance, at
__init__
time theconcrete resource manager
will instantiate the pluggablebackend gis
through the factory pattern, like shown below:The implementation of an operation from the
interface
will take care of:ResourceBase
real instance
As an instance a
delete
operation would be implemented as shown here below:Uploader
The
Uploader
module will be fully pluggable and aware of thebackend gis
.It will be relying on the
Resource Manager
andStorage Manager
in order to create/update theReourceBase
s and raw data into GeoNode.Harvester
Similarly to the
Uploader
, theHarvester
will be relying on theResource Manager
andStorage Manager
in order to create/update theReourceBase
s and raw data into GeoNode.We envisage a complete refactoring of the
Harvester
by improving the way it synchronizes and fetches the resources from the remote service. This will be better detailed on another GNIP.Async States
The
Resource Manager
will be managing the differentSTATES
of theResourceBase
also.This is a quite important concept. As part of this work we envisage also to move the workflow/processing state into the
ResourceBase
. This will allow us to ensure we never expose a not fully configuredResourceBase
to the users.As long as any component will respect the architectural contract, we will be also sure that the
ResourceBase
s will be always in a consistent state.Backwards Compatibility
This work won't be backward compatible with 3.2.x and 3.3.x versions.
However, since we won't break the
ResourceBase
model, it will be possible to easily upgrade older GeoNode versions to the new one.Future evolution
This is a preliminary work that prepares the core to go towards a fully pluggable and headless GeoNode middleware.
Through a real separation of concerns, the code will be much more maintainable and extensible, by easily allowing developers to create their own
backend gis
andstorage manager
s modules.Feedback
Update this section with relevant feedbacks, if any.
Voting
Project Steering Committee:
Links
Remove unused links below.
The text was updated successfully, but these errors were encountered: