dlr-eoc / prosEO

prosEO – A Processing System for Earth Observation Data
GNU General Public License v3.0
14 stars 1 forks source link

Add attribute to Product to store value for PRIP "ProductionType" attribute #82

Closed tangobravo62 closed 4 years ago

tangobravo62 commented 4 years ago

Currently the PRIP interface attribute ProductionType is derived from the productQuality attribute of the Product class. Since production type (systematic or on-demand) is a different concept from product quality, a separate attribute shall be introduced, which is passed on from the processing order requesting the product generation. Only at the time of creating the order is it known, whether the processing happens in the context of systematic processing or on-demand processing (reprocessing).

tangobravo62 commented 4 years ago

Production type in orders can now be set and modified:

prosEO (PTM)> order show "L3_products_9:30-17:30"
---
- id: 80
  version: 2
  missionCode: "PTM"
  identifier: "L3_products_9:30-17:30"
  [...]
  productionType: "ON_DEMAND_DEFAULT"

prosEO (PTM)> order update "L3_products_9:30-17:30" productionType=SYSTEMATIC
(I2938) Order with identifier L3_products_9:30-17:30 updated (new version 3)

prosEO (PTM)> order show "L3_products_9:30-17:30"
---
- id: 80
  version: 3
  missionCode: "PTM"
  identifier: "L3_products_9:30-17:30"
  [...]
  productionType: "SYSTEMATIC"

Illegal production types are not accepted:

prosEO (PTM)> order update "L3_products_9:30-17:30" productionType=BLA
(E2806) Command failed (cause: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 199 proseo-ordermgr-ordercontroller No enum constant de.dlr.proseo.model.enums.ProductionType.BLA)

Product data model extended to include production type (note that null is valid for products, e. g. all ingested products):

- id: 84
  version: 1
  uuid: "babfddc7-2751-4bce-a1d9-63ba95f3e4dd"
  missionCode: "PTM"
  productClass: "PTM_L2A"
  [...]
  productionType: null
  [...]

Updating products via CLI still fails:

prosEO (PTM)> product update 84 productionType=ON_DEMAND_NON_DEFAULT
(E2806) Command failed (cause: org.springframework.web.client.HttpClientErrorException: 500 )

Extract from Ingestor log:

2020-06-30 17:34:24.691 ERROR 1 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
    at de.dlr.proseo.ingestor.rest.ProductManager.modifyProduct(ProductManager.java:489) ~[classes!/:0.5.0]
    at de.dlr.proseo.ingestor.rest.ProductManager$$FastClassBySpringCGLIB$$8171773e.invoke(<generated>) ~[classes!/:0.5.0]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
    [...]
    at de.dlr.proseo.ingestor.rest.ProductManager$$EnhancerBySpringCGLIB$$293338b.modifyProduct(<generated>) ~[classes!/:0.5.0]
    at de.dlr.proseo.ingestor.rest.ProductControllerImpl.modifyProduct(ProductControllerImpl.java:162) ~[classes!/:0.5.0]
    at de.dlr.proseo.ingestor.rest.ProductControllerDecorator.modifyProduct(ProductControllerDecorator.java:111) ~[classes!/:0.5.0]

Not yet tested: Propagation of production type from order via job step to product.

tangobravo62 commented 4 years ago

Implementation in Product class completed, updating products via CLI now works:

prosEO (PTM)> product update 84 productionType=ON_DEMAND_NON_DEFAULT
(I2955) Product with database ID 84 updated (new version 2)

prosEO (PTM)> product show -v PTM_L2A
---
- id: 84
  version: 2
  uuid: "babfddc7-2751-4bce-a1d9-63ba95f3e4dd"
  missionCode: "PTM"
  productClass: "PTM_L2A"
  [...]
  productionType: "ON_DEMAND_NON_DEFAULT"
  [...]

Invalid production type is rejected:

prosEO (PTM)> product update 84 productionType=BLA
(E2806) Command failed (cause: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 199 proseo-ingestor (E2050) Invalid production type 'BLA')

Propagation test still open.

emelchinger commented 4 years ago

Propagation of prder production type to created product implemented.

tangobravo62 commented 4 years ago

Attribute "productionType" propagated correctly during order planning:

prosEO (S2)> order plan "L2A_TL TDS1_ORBIT_15250-00003" telekom-otc
(I2943) Order with identifier L2A_TL TDS1_ORBIT_15250-00003 planned (new version 3)
(    1) L2A_TL TDS1_ORBIT_15250-00003-3025 ({id=null, version=null, missionCode=null, spacecraftCode=null, orbitNumber=null, startTime=null, stopTime=null})
        ... proseojob3026 -> L2A_TL

prosEO (S2)> product show L2A_TL 3027
---
- id: 3027
  version: 1
  uuid: "498d046e-a6c4-4e39-8d66-775016db363e"
  missionCode: "S2"
  productClass: "L2A_TL"
  fileClass: "OPER"
  mode: "process_tile"
  productQuality: "NOMINAL"
  sensingStartTime: "2020-02-06T13:51:04.000000"
  sensingStopTime: "2020-02-06T13:51:04.000000"
  generationTime: null
  productionType: "SYSTEMATIC"
  [...]