-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Currently, the existing startup-options (environment variables) are undocumented and confusing. One can only assume what they do by reading the code from server/app/main.py.
We propose the following improvements:
-
Refactor the functionalty of reading arbitrary JSON, XML, AASX files from a given directory into an
ObjectStorefrom here tosdk/basyx/aas/adapter/__init__.pyas a reusable function. (And reuse them in step 2-3) -
Split the current
STORAGE_PATHdirectory into two separate directories:STORAGE(as in the directory for theLocalFileObjectStore, if data persistence is needed) andINPUT(is there a better name?), for the data that should be loaded into the server via startup.
The reason for this split is that it is very difficult to recreate the exact files (AASX, JSON, XML) with multiple Identifiables per file and optional supplementary files from the LocalFileObjectStore, therefore editing them with changes to make them persistent is hard. Instead, now we have the data that is read during startup of the server split from the directory that ensures data persistence across server reboots.
Expected behavior would be the following:
- Any
Identifiablein theINPUTdirectory, that is not present in theLocalFileObjectStoregets added to theLocalFileObjectStore(and with that to theSTORAGEdirectory. - Any
Identifiablein theINPUTdirectory that alread is inside theLocalFileObjectStoregets skipped (unless an other startup-option "OVERRIDE_PERSISTENT_DATA_VIA_INPUT" (better name is welcome as well) is set, in which case, theIdentifiablein theLocalFileObjectStoreshould be replaced by the one from theINPUTdirectory.
-
Rename the
LOCAL_FILE_READ_ONLYoption to something more likeMEMORY_ONLY, wheras the other option (see 2.) should have a discriptive name as well e.g.LOCAL_FILE? These options could be called something likePERSISTENCEoptions. -
Lastly, cleary document the options and their behavior in the
README.mdand possible also the module docstring ofmain.py.