mintproject / mint-ui-lit

New version of the MINT-UI
Apache License 2.0
4 stars 0 forks source link

[MINT-UI] Add way of sharing result bundles #245

Open dgarijo opened 4 years ago

dgarijo commented 4 years ago

Right now every time I want to share a result, I must do the following:

  1. Trigger the ingestion CURL command to get the summary.csv. Until now I have been doing this by copy/pasting thread, scenario and task ids into a a command that looks like: curl -X POST -H "Content-Type: application/json" -d '{"scenario_id":"9SLDL3Bfvj5oZQndE0fK", "subgoal_id":"SDf5lyj20e5VgUGG2q56", "thread_id": "vjXMFbEA7Vc1mzM6GFNk"}' https://ingestion.mint.isi.edu/v1.1.0/summary
  2. Download the summary and the results csv.
  3. Create (manually) a metadata.json such as this one: { "source":"MINT (https://mint-project.info/)", "generationThread": "https://dev.mint.isi.edu/ethiopia/modeling/scenario/B46nwKOrapiUoBP35Go0/VXE8dVUiEyN1FY4zHSOV/l2QgEeoX15hL6OSRTPTP", "license":"https://creativecommons.org/licenses/by-nc-sa/4.0", "credit":"This dataset was generated by the Cycles model (https://w3id.org/okn/i/mint/CYCLES) created by Armen Kemanian, Yuning Shi and Lorne Leonard. The results were generated using the MINT modeling framework (https://mint-project.info/).", "dataQuality":"This dataset represents interim results from modeling. Results have not been validated by a modeler yet.", "modelSetupUsed":"https://w3id.org/okn/i/mint/cycles-0.10.2-alpha-collection-oromia", "provenance":"summary.json" }
  4. Zip the three files and add them to https://data.mint.isi.edu/files/sharedResults/
  5. Update https://docs.google.com/spreadsheets/d/1xACH1rxLvrG-fq85g9OBkZNs9aHsT7pjvw7ePUPg1zI/edit#gid=0 with the things that are ready to share.

I had to do this for all of our Cycles, TopoFlow, PIHM, Economic and HAND runs. I think we need to support this in MINT. The metadata.ttl can be filled in by the user. I will be happy if I can download a zip with those 3 files to begin with.

mosoriob commented 4 years ago

Requirements

  1. Return by model version
curl  "http://localhost:8080/v1.3.0/summary?limit=200&page=1&model=cycles-0.9.4-alpha" -H "accept: application/json" | jq -r '.[].thread.models.id'  | wc -l
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1626k  100 1626k    0     0  1375k      0  0:00:01  0:00:01 --:--:-- 1375k
      90
  1. A link to go to the thread
  1. Parameters
curl  "http://localhost:8080/v1.3.0/summary?limit=200&page=1&model=cycles-0.9.4-alpha" -H "accept: application/json" | jq -r '.[].thread.models.input_parameters'
  1. Input
curl  "http://localhost:8080/v1.3.0/summary?limit=200&page=1&model=cycles-0.9.4-alpha" -H "accept: application/json" | jq -r '.[].thread.models.input_files'
  1. Download link

Steps:

  1. Query the {model}_runs and obtain the run_id and (parameters and inputs (we dont have the links))
  2. Query the threads_output_table by the thread_id
  3. For each mint_runid, obtain the link of the output
  4. Query the thread_inputs by thread_id and the inputs_name to obtain the link