Permalink
Browse files

Merge pull request #664 from StochSS/develop

Release 1.9
  • Loading branch information...
briandrawert committed Aug 11, 2017
2 parents 25c72a4 + 033ba8f commit 28ecc3fa6d4272909579a325cf02f791f9035917
Showing with 13,449 additions and 15,970 deletions.
  1. +3 −0 .gitignore
  2. +6 −0 RELEASE_NOTES
  3. +1 −1 VERSION
  4. +119 −0 app/db_models/email_config.py
  5. +24 −15 app/db_models/parameter_sweep_job.py
  6. +6 −1 app/db_models/spatial_job.py
  7. +10 −1 app/db_models/stochkit_job.py
  8. +29 −2 app/db_models/user_data.py
  9. +69 −12 app/handlers/admin.py
  10. +267 −71 app/handlers/auth.py
  11. +121 −1 app/handlers/credentials.py
  12. +54 −0 app/handlers/emailsetup.py
  13. +1 −1 app/handlers/fileserver.py
  14. +187 −23 app/handlers/parametersweep.py
  15. +422 −0 app/handlers/parametersweep_qsub.py
  16. +3 −1 app/handlers/sensitivity.py
  17. +238 −22 app/handlers/simulation.py
  18. +290 −4 app/handlers/spatial.py
  19. +125 −5 app/handlers/status.py
  20. +6 −0 app/handlers/stochoptim.py
  21. +4 −0 app/lib/cluster_execution/.gitignore
  22. +1 −0 app/lib/cluster_execution/__init__.py
  23. +179 −0 app/lib/cluster_execution/cluster_deploy.py
  24. +26 −0 app/lib/cluster_execution/cluster_execution_exceptions.py
  25. +159 −0 app/lib/cluster_execution/cluster_molnsutil.py
  26. +159 −0 app/lib/cluster_execution/cluster_parameter_sweep.py
  27. +18 −0 app/lib/cluster_execution/constants.py
  28. +107 −0 app/lib/cluster_execution/molns_exec_helper.py
  29. +48 −0 app/lib/cluster_execution/remote_execution.py
  30. +42 −0 app/lib/cluster_execution/utils.py
  31. +467 −101 app/lib/gillespy/gillespy.py
  32. +9 −0 app/lib/molns/.gitignore
  33. +243 −0 app/lib/molns/MolnsLib/DockerProvider.py
  34. +314 −0 app/lib/molns/MolnsLib/DockerProxy.py
  35. +95 −0 app/lib/molns/MolnsLib/DockerSSH.py
  36. +3 −3 app/lib/molns/MolnsLib/EC2Provider.py
  37. +45 −0 app/lib/molns/MolnsLib/Utils.py
  38. +28 −0 app/lib/molns/MolnsLib/constants.py
  39. +28 −26 app/lib/molns/MolnsLib/installSoftware.py
  40. +84 −65 app/lib/molns/MolnsLib/molns_datastore.py
  41. +93 −0 app/lib/molns/MolnsLib/molns_landing_page.py
  42. +9 −3 app/lib/molns/MolnsLib/molns_provider.py
  43. +71 −0 app/lib/molns/MolnsLib/ssh.py
  44. +252 −194 app/lib/molns/MolnsLib/ssh_deploy.py
  45. +2 −2 app/lib/molns/README.md
  46. +1 −0 app/lib/molns/__init__.py
  47. +373 −252 app/lib/molns/molns.py
  48. +4 −0 app/lib/molnsutil/.gitignore
  49. +674 −0 app/lib/molnsutil/LICENCE.txt
  50. +4 −0 app/lib/molnsutil/README.md
  51. +1 −0 app/lib/molnsutil/VERSION
  52. +976 −0 app/lib/molnsutil/__init__.py
  53. +36 −0 app/lib/molnsutil/constants.py
  54. +44 −0 app/lib/molnsutil/job_submission.pbs
  55. +116 −0 app/lib/molnsutil/map_and_aggregate.py
  56. +1,075 −0 app/lib/molnsutil/molns_cloudpickle.py
  57. +6 −0 app/lib/molnsutil/molns_exceptions.py
  58. +23 −0 app/lib/molnsutil/parameter_sweep_reduce_job.sh
  59. +69 −0 app/lib/molnsutil/parameter_sweep_run_reducer.py
  60. +99 −0 app/lib/molnsutil/run_ensemble.py
  61. +76 −0 app/lib/molnsutil/run_ensemble_map_aggregate.py
  62. +5 −0 app/lib/molnsutil/setup.py
  63. +299 −0 app/lib/molnsutil/storage_providers.py
  64. +206 −0 app/lib/molnsutil/utils.py
  65. +3 −0 app/static/css/credentials.css
  66. +185 −0 app/static/css/loginstyle.css
  67. BIN app/static/img/.DS_Store
  68. BIN app/static/img/backgrounds/1.jpg
  69. +4 −4 app/static/js/admin_page.js
  70. +243 −0 app/static/js/cluster_credentials.js
  71. +2 −0 app/static/js/credentials.js
  72. +70 −0 app/static/js/default_values.js
  73. +119 −41 app/static/js/parameter_sweep.js
  74. +7 −0 app/static/js/placeholder.js
  75. +31 −0 app/static/js/scripts.js
  76. +178 −219 app/static/js/simulate.js
  77. +2 −0 app/static/js/spatial.js
  78. +7 −0 app/static/modelEditor/app.bundle.js
  79. +7 −0 app/static/modelEditor/forms/primary-view.js
  80. +2 −1 app/static/modelEditor/models/model.js
  81. +27 −1 app/stochssapp.py
  82. +44 −5 app/templates/admin.html
  83. +6 −4 app/templates/base.html
  84. +137 −0 app/templates/cluster_credentials.html
  85. +40 −23 app/templates/credentials.html
  86. +76 −0 app/templates/emailsetup.html
  87. +4 −1 app/templates/login.html
  88. +51 −0 app/templates/login_disabled.html
  89. +53 −0 app/templates/login_saas.html
  90. +2 −0 app/templates/modelEditor.html
  91. +18 −3 app/templates/parameter_sweep.html
  92. +50 −0 app/templates/passwordreset.html
  93. +25 −0 app/templates/passwordresetrequest.html
  94. +16 −0 app/templates/restricted.html
  95. +37 −20 app/templates/simulate.html
  96. +7 −2 app/templates/user_registration.html
  97. +0 −20 app2/app.yaml
  98. +0 −53 app2/export-ye-olde-stochssapp.py
  99. 0 app2/handlers/__init__.py
  100. +0 −100 app2/handlers/exportimport.py
  101. +0 −44 app2/handlers/modeleditor.py
  102. +0 −15 app2/static/main_page.css
  103. +0 −37 app2/static/main_page.js
  104. +0 −1 app2/stochss/__init__.py
  105. +0 −149 app2/stochss/examplemodels.py
  106. +0 −345 app2/stochss/model.py
  107. +0 −607 app2/stochss/stochkit.py
  108. +0 −219 app2/stochss/test_model.py
  109. +0 −77 app2/templates/main_page.html
  110. +8 −2 launchapp.py
  111. +10 −7 run.docker.sh
  112. +12 −2 run.ubuntu.sh
  113. +1 −0 sdk/python/google/appengine/api/modules/modules.py
  114. +0 −769 sdk/python/lib/requests/requests/HISTORY.rst
  115. +0 −809 sdk/python/lib/requests/requests/LICENSE
  116. +0 −1 sdk/python/lib/requests/requests/MANIFEST.in
  117. +0 −64 sdk/python/lib/requests/requests/NOTICE
  118. +0 −896 sdk/python/lib/requests/requests/PKG-INFO
  119. +0 −93 sdk/python/lib/requests/requests/README.rst
  120. +6 −6 sdk/python/lib/requests/requests/__init__.py
  121. +82 −41 sdk/python/lib/requests/requests/adapters.py
  122. +16 −5 sdk/python/lib/requests/requests/api.py
  123. +24 −9 sdk/python/lib/requests/requests/auth.py
  124. +7 −6 sdk/python/lib/requests/requests/certs.py
  125. +3 −56 sdk/python/lib/requests/requests/compat.py
  126. +49 −40 sdk/python/lib/requests/requests/cookies.py
  127. +37 −6 sdk/python/lib/requests/requests/exceptions.py
  128. +111 −53 sdk/python/lib/requests/requests/models.py
  129. +93 −1 sdk/python/lib/requests/requests/packages/__init__.py
  130. +0 −32 sdk/python/lib/requests/requests/packages/charade/__init__.py
  131. +0 −925 sdk/python/lib/requests/requests/packages/charade/big5freq.py
  132. +0 −42 sdk/python/lib/requests/requests/packages/charade/big5prober.py
  133. +0 −231 sdk/python/lib/requests/requests/packages/charade/chardistribution.py
  134. +0 −106 sdk/python/lib/requests/requests/packages/charade/charsetgroupprober.py
  135. +0 −62 sdk/python/lib/requests/requests/packages/charade/charsetprober.py
  136. +0 −61 sdk/python/lib/requests/requests/packages/charade/codingstatemachine.py
  137. +0 −34 sdk/python/lib/requests/requests/packages/charade/compat.py
  138. +0 −39 sdk/python/lib/requests/requests/packages/charade/constants.py
  139. +0 −44 sdk/python/lib/requests/requests/packages/charade/cp949prober.py
  140. +0 −86 sdk/python/lib/requests/requests/packages/charade/escprober.py
  141. +0 −242 sdk/python/lib/requests/requests/packages/charade/escsm.py
  142. +0 −90 sdk/python/lib/requests/requests/packages/charade/eucjpprober.py
  143. +0 −596 sdk/python/lib/requests/requests/packages/charade/euckrfreq.py
  144. +0 −42 sdk/python/lib/requests/requests/packages/charade/euckrprober.py
  145. +0 −428 sdk/python/lib/requests/requests/packages/charade/euctwfreq.py
  146. +0 −41 sdk/python/lib/requests/requests/packages/charade/euctwprober.py
  147. +0 −472 sdk/python/lib/requests/requests/packages/charade/gb2312freq.py
  148. +0 −41 sdk/python/lib/requests/requests/packages/charade/gb2312prober.py
  149. +0 −283 sdk/python/lib/requests/requests/packages/charade/hebrewprober.py
  150. +0 −569 sdk/python/lib/requests/requests/packages/charade/jisfreq.py
  151. +0 −219 sdk/python/lib/requests/requests/packages/charade/jpcntx.py
  152. +0 −229 sdk/python/lib/requests/requests/packages/charade/langbulgarianmodel.py
  153. +0 −329 sdk/python/lib/requests/requests/packages/charade/langcyrillicmodel.py
  154. +0 −225 sdk/python/lib/requests/requests/packages/charade/langgreekmodel.py
  155. +0 −201 sdk/python/lib/requests/requests/packages/charade/langhebrewmodel.py
  156. +0 −225 sdk/python/lib/requests/requests/packages/charade/langhungarianmodel.py
  157. +0 −200 sdk/python/lib/requests/requests/packages/charade/langthaimodel.py
  158. +0 −139 sdk/python/lib/requests/requests/packages/charade/latin1prober.py
  159. +0 −86 sdk/python/lib/requests/requests/packages/charade/mbcharsetprober.py
  160. +0 −54 sdk/python/lib/requests/requests/packages/charade/mbcsgroupprober.py
  161. +0 −575 sdk/python/lib/requests/requests/packages/charade/mbcssm.py
  162. +0 −120 sdk/python/lib/requests/requests/packages/charade/sbcharsetprober.py
  163. +0 −69 sdk/python/lib/requests/requests/packages/charade/sbcsgroupprober.py
  164. +0 −91 sdk/python/lib/requests/requests/packages/charade/sjisprober.py
  165. +0 −172 sdk/python/lib/requests/requests/packages/charade/universaldetector.py
  166. +0 −76 sdk/python/lib/requests/requests/packages/charade/utf8prober.py
  167. +1 −1 sdk/python/lib/requests/requests/packages/chardet/__init__.py
  168. +49 −15 sdk/python/lib/requests/requests/packages/chardet/chardetect.py
  169. +8 −0 sdk/python/lib/requests/requests/packages/chardet/jpcntx.py
  170. +3 −3 sdk/python/lib/requests/requests/packages/chardet/latin1prober.py
  171. +3 −6 sdk/python/lib/requests/requests/packages/chardet/mbcssm.py
  172. +1 −1 sdk/python/lib/requests/requests/packages/chardet/sjisprober.py
  173. +2 −2 sdk/python/lib/requests/requests/packages/chardet/universaldetector.py
  174. +16 −8 sdk/python/lib/requests/requests/packages/urllib3/__init__.py
  175. +229 −13 sdk/python/lib/requests/requests/packages/urllib3/_collections.py
  176. +151 −67 sdk/python/lib/requests/requests/packages/urllib3/connection.py
  177. +246 −137 sdk/python/lib/requests/requests/packages/urllib3/connectionpool.py
  178. +0 −6 sdk/python/lib/requests/requests/packages/urllib3/contrib/ntlmpool.py
  179. +108 −190 sdk/python/lib/requests/requests/packages/urllib3/contrib/pyopenssl.py
  180. +51 −13 sdk/python/lib/requests/requests/packages/urllib3/exceptions.py
  181. +14 −14 sdk/python/lib/requests/requests/packages/urllib3/fields.py
  182. +4 −11 sdk/python/lib/requests/requests/packages/urllib3/filepost.py
  183. +0 −1 sdk/python/lib/requests/requests/packages/urllib3/packages/ordered_dict.py
  184. +1 −1 sdk/python/lib/requests/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
  185. +40 −18 sdk/python/lib/requests/requests/packages/urllib3/poolmanager.py
  186. +33 −33 sdk/python/lib/requests/requests/packages/urllib3/request.py
  187. +94 −53 sdk/python/lib/requests/requests/packages/urllib3/response.py
  188. +0 −648 sdk/python/lib/requests/requests/packages/urllib3/util.py
  189. +24 −0 sdk/python/lib/requests/requests/packages/urllib3/util/__init__.py
  190. +98 −0 sdk/python/lib/requests/requests/packages/urllib3/util/connection.py
  191. +71 −0 sdk/python/lib/requests/requests/packages/urllib3/util/request.py
  192. +22 −0 sdk/python/lib/requests/requests/packages/urllib3/util/response.py
  193. +285 −0 sdk/python/lib/requests/requests/packages/urllib3/util/retry.py
  194. +257 −0 sdk/python/lib/requests/requests/packages/urllib3/util/ssl_.py
  195. +240 −0 sdk/python/lib/requests/requests/packages/urllib3/util/timeout.py
  196. +212 −0 sdk/python/lib/requests/requests/packages/urllib3/util/url.py
  197. +0 −5 sdk/python/lib/requests/requests/requirements.txt
  198. +194 −65 sdk/python/lib/requests/requests/sessions.py
  199. +0 −8 sdk/python/lib/requests/requests/setup.cfg
  200. +0 −63 sdk/python/lib/requests/requests/setup.py
  201. +2 −1 sdk/python/lib/requests/requests/status_codes.py
  202. +2 −26 sdk/python/lib/requests/requests/structures.py
  203. +0 −1,170 sdk/python/lib/requests/requests/test_requests.py
  204. +75 −31 sdk/python/lib/requests/requests/utils.py
  205. +130 −0 stochss-launcher/DF/Dockerfile
  206. +9 −10 stochss-launcher/Dockerfile
  207. +2 −2 stochss-launcher/Linux/README.md
  208. +7 −7 stochss-launcher/Linux/stochss.sh
  209. +0 −56 stochss-launcher/OSX/App/StochSS-no_docker_machine.app/Contents/Resources/script
  210. BIN stochss-launcher/OSX/App/StochSS.app/Contents/Resources/StochSS.scpt
  211. +8 −13 stochss-launcher/OSX/App/StochSS.app/Contents/Resources/pullImage.sh
  212. +97 −66 stochss-launcher/OSX/App/StochSS.app/Contents/Resources/script
  213. BIN ...er/OSX/App/{StochSS-no_docker_machine.app → StochSS__with_docker_machine.app}/Contents/Info.plist
  214. BIN ...OSX/App/{StochSS-no_docker_machine.app → StochSS__with_docker_machine.app}/Contents/MacOS/StochSS
  215. BIN ...SS-no_docker_machine.app → StochSS__with_docker_machine.app}/Contents/Resources/AppSettings.plist
  216. BIN ...StochSS-no_docker_machine.app → StochSS__with_docker_machine.app}/Contents/Resources/MainMenu.nib
  217. BIN stochss-launcher/OSX/App/StochSS__with_docker_machine.app/Contents/Resources/StochSS.scpt
  218. BIN ...StochSS-no_docker_machine.app → StochSS__with_docker_machine.app}/Contents/Resources/appIcon.icns
  219. +17 −0 stochss-launcher/OSX/App/StochSS__with_docker_machine.app/Contents/Resources/pullImage.sh
  220. +124 −0 stochss-launcher/OSX/App/StochSS__with_docker_machine.app/Contents/Resources/script
  221. BIN stochss-launcher/OSX/StochSS.scpt
  222. +13 −27 stochss-launcher/OSX/launchContainerDarwin.sh
  223. +3 −13 stochss-launcher/OSX/pullImage.sh
  224. +6 −11 stochss-launcher/OSX/stochss.sh
  225. +16 −16 stochss-launcher/Windows/README.md
  226. +13 −0 utils/port80redirect.py
  227. +2 −0 utils/run_isolated_jupyter_notebook_server.sh
View
@@ -23,10 +23,13 @@ stochoptim*
ode*
app/molns_install.log
app/index.yaml
TODO
app/preprocessed/
app/static/tmp/
app/userfile
conf/config
release-tools/create_stochss_ami_stderr.log
release-tools/create_stochss_ami_stdout.log
release-tools/flex-cloud/make_flex_vm_stderr.log
._StochKit2.0.11
._ode-1.0.4
View
@@ -1,5 +1,11 @@
StochSS - Stochastic Simulation Service: Release Notes
1.9.0
=============================
- Support for simulation and parameter sweep jobs on batch cluster computing (Qsub based computing clusters)
- Configuration of batch computing resources
- Enhancement to multi-user setup, including email authentication
1.8.0
=============================
- Parameter Sweep tool allow 1D/2D parameter sweeps for all models
View
@@ -1 +1 @@
1.8.0
1.9.0
@@ -0,0 +1,119 @@
from google.appengine.ext import db
import pprint
import sys
import os
from backend.common.config import AgentTypes, JobConfig, JobDatabaseConfig
import logging
class EmailConfig(db.Model):
""" A Model to store config for sending email """
enabled = db.BooleanProperty()
smtp_host = db.StringProperty()
smtp_port = db.StringProperty()
smtp_username = db.StringProperty()
smtp_password = db.StringProperty()
from_email = db.StringProperty()
url_prefix = db.StringProperty()
@classmethod
def get_config(self):
ret = {}
ret['smtp_host'] = ''
ret['smtp_port'] = ''
ret['smtp_username'] = ''
ret['smtp_password'] = ''
ret['from_email'] = ''
ret['url_prefix']=''
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is not None:
ret['smtp_host'] = config.smtp_host
ret['smtp_port'] = config.smtp_port
ret['smtp_username'] = config.smtp_username
ret['smtp_password'] = config.smtp_password
ret['from_email'] = config.from_email
ret['url_prefix']=config.url_prefix
ret['email_enabled'] = bool(config.enabled)
return ret
@classmethod
def save_config(self, smtp_host, smtp_port, smtp_username, smtp_password, from_email,url_prefix):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is None:
config = EmailConfig()
config.enabled = False
config.smtp_host = smtp_host
config.smtp_port = smtp_port
config.smtp_username = smtp_username
config.smtp_password = smtp_password
config.from_email = from_email
config.url_prefix = url_prefix
config.put()
@classmethod
def set_enabled_true(self):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is not None:
config.enabled = True
config.put()
return True
return False
@classmethod
def set_enabled_false(self):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is not None:
config.enabled = False
config.put()
return True
return False
@classmethod
def is_enabled(self):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is None:
return False
return bool(config.enabled)
@classmethod
def send_email(self, to_email_address, subject, message):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is None:
return False
import smtplib
smtp = smtplib.SMTP(config.smtp_host, int(config.smtp_port))
from email.mime.text import MIMEText
msg = MIMEText(message)
msg['To'] = to_email_address
msg['Subject'] = subject
msg['From'] = config.from_email
smtp.starttls()
smtp.login(config.smtp_username, config.smtp_password)
smtp.sendmail(config.from_email, to_email_address, msg.as_string())
smtp.quit()
return True
@classmethod
def send_verification_email(self,user_email, token):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is None:
return False
msg = "Please click the following link in order to verify your account: {0}".format(str(config.url_prefix)+"/verify?user_email={0}&signup_token={1}".format(user_email, token))
status = self.send_email(user_email,"StochSS registration verification", msg)
if status:
return True
else:
return False
@classmethod
def send_password_reset_email(self,user_email, token):
config = db.GqlQuery("SELECT * FROM EmailConfig").get()
if config is None:
return False
msg = "Please click the following link in order to reset your password: {0}".format(str(config.url_prefix)+"/passwordreset?user_email={0}&token={1}".format(user_email, token))
status = self.send_email(user_email,"StochSS: Reset password", msg)
if status:
return True
else:
return False
@@ -19,8 +19,12 @@ class ParameterSweepJobWrapper(db.Model):
output_stored = db.BooleanProperty()
resource = db.StringProperty()
qsubHandle = db.TextProperty()
molnsPID = db.IntegerProperty()
is_simulation = db.BooleanProperty(False)
is_spatial = db.BooleanProperty(False)
def getJSON(self):
return { 'id' : self.key().id(),
'user_id' : self.user_id,
@@ -33,11 +37,13 @@ def getJSON(self):
'status' : self.status,
'zipFileName' : self.zipFileName,
'output_stored' : self.output_stored,
'resource' : self.resource,
'molnsPID' : self.molnsPID }
'molnsPID' : self.molnsPID,
'is_spatial': self.is_spatial,
'is_simulation': self.is_simulation }
def delete(self, handler):
self.stop(handler)
if self.outData is not None and os.path.exists(self.outData):
shutil.rmtree(self.outData)
@@ -56,19 +62,22 @@ def delete(self, handler):
def stop(self, handler):
# TODO: Call the backend to kill and delete the job and all associated files.
service = backendservices(handler.user_data)
if self.resource == "molns":
molnsConfigDb = db.GqlQuery("SELECT * FROM MolnsConfigWrapper WHERE user_id = :1", handler.user.user_id()).get()
if self.status == "Running":
# TODO: Call the backend to kill and delete the job and all associated files.
service = backendservices(handler.user_data)
if self.resource == "local":
if self.pid is not None:
service.stopTaskLocal([int(self.pid)])
elif self.resource == "molns":
molnsConfigDb = db.GqlQuery("SELECT * FROM MolnsConfigWrapper WHERE user_id = :1", handler.user.user_id()).get()
if not molnsConfigDb:
return
if not molnsConfigDb:
return
config = molns.MOLNSConfig(config_dir = molnsConfigDb.folder)
config = molns.MOLNSConfig(config_dir = molnsConfigDb.folder)
# Stopping is deleting cloud data for this job type
try:
molns.MOLNSExec.cleanup_job([self.molnsPID], config)
except Exception as e:
logging.info("Error while deleting cloud data: {0}".format(e))
# Stopping is deleting cloud data for this job type
try:
molns.MOLNSExec.cleanup_job([self.molnsPID], config)
except Exception as e:
logging.info("Error while deleting cloud data: {0}".format(e))
@@ -21,7 +21,12 @@ class SpatialJobWrapper(db.Model):
indata = db.TextProperty()
outData = db.StringProperty() # THis is a path to the output data on the filesystem
status = db.StringProperty()
# TODO delete these maybe?
is_simulation = db.BooleanProperty(False)
is_spatial = db.BooleanProperty(False)
qsubHandle = db.TextProperty()
preprocessed = object_property.ObjectProperty()
preprocessedDir = db.StringProperty() # THis is a path to the output data on the filesystem
@@ -39,6 +39,11 @@ class StochKitJobWrapper(db.Model):
outData = db.StringProperty()
outputURL = db.StringProperty()
result = db.StringProperty()
qsubHandle = db.TextProperty()
# TODO delete these maybe?
is_simulation = db.BooleanProperty(False)
is_spatial = db.BooleanProperty(False)
stdout = db.StringProperty()
stderr = db.StringProperty()
@@ -60,8 +65,12 @@ def stop(self, user_data):
return
else:
service = backendservices(user_data)
if self.resource.lower() == 'local':
if self.resource is None:
return # avoid error on "NoneType.lower()"
elif self.resource.lower() == 'local':
service.stopTaskLocal([self.pid])
elif self.resource.lower() == 'qsub' or self.resource.lower() == 'molns':
return # can't stop batching processing tasks (at least not easily)
else:
service.stopTasks(self)
View
@@ -27,9 +27,13 @@ class UserData(db.Model):
# The user's S3 bucket name used to store simulation results in S3
S3_bucket_name = db.StringProperty()
# Is the amazon db table initalizes
# Is the amazon db table initalized
is_amazon_db_table = db.BooleanProperty()
# Cluster Info
cluster_node_info = db.TextProperty(default="[]")
selected = db.TextProperty(default="0")
# Private Cloud Machine Info
flex_cloud_machine_info = db.TextProperty(default="[]")
valid_flex_cloud_info = db.BooleanProperty(default=False)
@@ -44,7 +48,6 @@ class UserData(db.Model):
env_variables = db.TextProperty()
def setCredentials(self, credentials):
self.ec2_access_key = credentials['EC2_ACCESS_KEY']
self.ec2_secret_key = credentials['EC2_SECRET_KEY']
@@ -61,6 +64,30 @@ def getBucketName(self):
def isTable(self):
return self.is_amazon_db_table
def set_cluster_node_info(self, node_info):
logging.debug("set_cluster_node_info() node_info = {0}".format(node_info))
self.cluster_node_info = json.dumps(node_info, encoding="ascii")
self.put()
def get_cluster_node_info(self):
info = json.loads(self.cluster_node_info, encoding="ascii")
logging.debug("get_cluster_node_info() info = {0}".format(self.cluster_node_info))
return info
def get_selected(self):
try:
val = json.loads(self.selected, encoding="ascii")
logging.debug("get_selected() ascii = {0}".format(val))
return val
except:
logging.error("Could not parse selected resource value {0} to int.".format(self.selected))
return 0
def set_selected(self, val):
self.selected = json.dumps(val, encoding="ascii")
self.put()
logging.debug("set_selected() ascii = {0}".format(self.selected))
def set_flex_cloud_machine_info(self, machine_info):
logging.debug("set_flex_cloud_machine_info() machine_info = {0}".format(machine_info))
self.flex_cloud_machine_info = json.dumps(machine_info, encoding="ascii")
Oops, something went wrong.

0 comments on commit 28ecc3f

Please sign in to comment.