clarity-h2020 / csis-helpers-module

CSIS Helpers Drupal Module
GNU General Public License v3.0
1 stars 0 forks source link

Calculation in progress/finished indication #17

Closed DenoBeno closed 4 years ago

DenoBeno commented 4 years ago

EMIKAT calculation took 6 minutes for the test study that I tried today. Possibly more for larger areas.

It would be nice to have some indication on the site saying "calculation failed/in progress/done".

patrickkaleta commented 4 years ago

One possible way how to do it:

DenoBeno commented 4 years ago

Sounds OK to me.

On Wed, 2 Oct 2019 at 12:13, Patrick Kaleta notifications@github.com wrote:

One possible way how to do it:

  • add a new field Calculation Status to the Study group (0 => not active, 1 => running)
  • the Emikat trigger in the csis helpers module will set this field to 1 if the calculation has been triggered
  • add a new JS, which we would only include on all the Study-pages (not the GL-pages!), that would repeatedly pull the current status from Emikat via REST if this new field is set to 1 and print the result on the screen
    • if Emikat returns that the calculation is still running, re-sent request after e.g. 30 seconds
    • if result shows an error or success, print that error/success (tell user what to do next) and set via REST the Calculation Status of this study back to zero (inactive)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/clarity-h2020/emikat/issues/21?email_source=notifications&email_token=AAWTC7VS4735HI5BN4WIPJDQMRX4HA5CNFSM4I24BJSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAEIFZY#issuecomment-537428711, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWTC7UMROIGXRDSQFLWLVDQMRX4HANCNFSM4I24BJSA .

DenoBeno commented 4 years ago

@humerh : as discussed earlier today, can we access some view that will return us the status & progress information?

E.g. something like this:

patrickkaleta commented 4 years ago

Status update

Most of this feature is already implemented in this branch (still need to update the calculation field of the study after calculation in Emikat has finished + properly phrase the messages for the users). Once it's all done, I will merge and deploy it to our CSIS server.

One problem I encountered is that the SortBy parameter doesn't seem to work on Emikat-side. batchjob-order-wrong

Even when you try to access the endpoint via Swagger and set the SortBy parameter to "OBJECT_ID=DESC", it will ignore this parameter and return the batchjobs in (for me) no apparent order.

This is a crucial problem. I need the most recent batchjobs first, because I then iterate over them until I find the "initial" batch job that triggered the current (re-)calculation. That's how I separate relevant batch jobs from possibly older batch jobs from previous calculations.

@humerh please take a look at this sortBy parameter.

patrickkaleta commented 4 years ago

I've finished the implementation and deployed it onto the CSIS server. Users now can see messages like this, when they are in the Study-step and the calculation is ongoing (of course they are not going to see all 3 at once): status messages-new

More details about this feature in the readme.

What still needs to be fixed is the problem with the sorting of the batchjobs that I get from Emikat. Only after this sorting is working, the CSIS helpers module will be able to generate meaningful status messages.

patrickkaleta commented 4 years ago

Ok, batch jobs are now always sorted in ascending order, however we need them in descending order.

@humerh can you please check again if the sorting parameter is handled correctly in Emikat or if the syntax I'm using is correct?

This is an example of a request I'm making: https://service.emikat.at/EmiKatTst/api/scenarios/3233/feature/tab.AD_V_BATCH_IN_QUEUE.1710/table/data?rownum=20&filter=SZM_SZENARIO_REF=3233&sortby=OBJECT_ID=DESC

That's the relevant part for the sorting: ...&sortby=OBJECT_ID=DESC

No matter if I change it to "ASC" or omit it completely, the batch jobs always stay sorted in ascending order.

patrickkaleta commented 4 years ago

Thanks to @humerh I now configured the sortby parameter correctly and batch jobs are now sorted the way we need them. Closing this issue now.