cmda-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qihao Bao (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CMDA-9) Modification on entry.py to enable climate services rerun on CMU provenance
Date Thu, 17 Mar 2016 23:56:33 GMT
Qihao Bao created CMDA-9:
----------------------------

             Summary: Modification on entry.py to enable climate services rerun on CMU provenance
                 Key: CMDA-9
                 URL: https://issues.apache.org/jira/browse/CMDA-9
             Project: Apache Climate Model Diagnostic Analyzer
          Issue Type: Task
         Environment: entry.py
            Reporter: Qihao Bao


Here is a modification request from CMU team.

The reason why we could get plot and re-run with the same configuration from CMU side but
not on JPL side is that we actually modified entry.py file on Einstein for testing purpose.

In order to make re-run pages work as well as enabling automatic image and .nc files downloading
once for all, I may need to request you to make the following changes on entry.py.

1.Modify
===============================================================
post_json_wei = {'dataUrl': dataUrl, 'userId': long(userId), 'serviceId':long(serviceId),
'purpose':purpose,
                 'executionStartTime':long(executionStartTime)*1000, 'executionEndTime':long(executionEndTime)*1000,
                 'parameters': parameters_json, 'url': url, 'datasetStudyStartTime': startT,
'datasetStudyEndTime': endT}
===============================================================

TO
===============================================================
post_json_wei = {'plotUrl':plotUrl, 'dataUrl':dataUrl, 'urlLink':urlLink,  'userId': long(userId),
'serviceId':long(serviceId), 'purpose':purpose,
                 'executionStartTime':long(executionStartTime)*1000, 'executionEndTime':long(executionEndTime)*1000,
                 'parameters': parameters_json, 'datasetStudyStartTime': startT, 'datasetStudyEndTime':
endT}
===============================================================


Where value of urlLink should equal to, for example
===============================================================
"?model1=GFDL_ESM2G&var1=pr&lon1=0&lon2=360&lat1=-90&lat2=90&startT=200401&endT=200412&months=1,2,3,4,5,6,7,8,9,10,11,12&scale=0&Image=http://cmacws4.jpl.nasa.gov:8090/static/twoDimZonalMean/3035de17274428938127423b6029c754/gfdl_esm2g_pr_200401_200412_Annual.jpeg&data_url=http://cmacws4.jpl.nasa.gov:8090/static/twoDimZonalMean/3035de17274428938127423b6029c754/gfdl_esm2g_pr_200401_200412_Annual.nc&purpose="
===============================================================
We will store that string in our database and when a user need to re-run one service through
execution log, we will utilize the string since Benyang has already enabled such function
in HTML pages.

And dataUrl should be, for example, "http://cmacws4.jpl.nasa.gov:8090/static/twoDimZonalMean/3035de17274428938127423b6029c754/gfdl_esm2g_pr_200401_200412_Annual.nc",
which is the location of OutputFile.

And plotUrl should be, for example, ""http://cmacws4.jpl.nasa.gov:8090/static/twoDimZonalMean/3035de17274428938127423b6029c754/gfdl_esm2g_pr_200401_200412_Annual.jpeg",
which is the location of image generated.


2.REMOVE
===============================================================
    post_json_addPicture = {'url':url}
    post_json_addPicture = json.dumps(post_json_addPicture)
    post_json_addOutputfile = {'url':dataUrl}
    post_json_addOutputfile = json.dumps(post_json_addOutputfile)
    print 'post_json_addPicture: ', post_json_addPicture
    print 'post_json_addOutputfile: ', post_json_addOutputfile
===============================================================

And 
===============================================================
print requests.post(BASE_POST_URL_ADD_PICTURE, data=post_json_addPicture, headers=HEADERS).text
print requests.post(BASE_POST_URL_ADD_OUTPUTFILE, data=post_json_addOutputfile, headers=HEADERS).text
===============================================================
Because we merge 3 APIs into one API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message