Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/android/loading/cloud/frontend/clovis_frontend.py

Issue 2027843004: tools/android/loading Prevent gcloud instance leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reportName
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/cloud/frontend/clovis_frontend.py
diff --git a/tools/android/loading/cloud/frontend/clovis_frontend.py b/tools/android/loading/cloud/frontend/clovis_frontend.py
index 3303b5bd32045cec8dae26fe0ae21c022c7ea2fb..01e4699bb63dac6983504258db3e9c6f86a608dc 100644
--- a/tools/android/loading/cloud/frontend/clovis_frontend.py
+++ b/tools/android/loading/cloud/frontend/clovis_frontend.py
@@ -268,10 +268,6 @@ def StartFromJsonString(http_body_str):
task_dir_components.append(task_tag)
task_dir = os.path.join(task.Action(), '_'.join(task_dir_components))
- # Create the instance template if required.
- if not CreateInstanceTemplate(task, task_dir):
- return Render('Template creation failed.', memory_logs)
-
# Build the URL where the result will live.
task_url = None
if task.Action() == 'trace':
@@ -295,10 +291,6 @@ def StartFromJsonString(http_body_str):
if not EnqueueTasks(sub_tasks, task_tag):
return Render('Task creation failed.', memory_logs)
- # Start the instances if required.
- if not CreateInstances(task):
- return Render('Instance creation failed.', memory_logs)
-
# Start polling the progress.
clovis_logger.info('Creating worker polling task.')
first_poll_delay_minutes = 10
@@ -306,6 +298,12 @@ def StartFromJsonString(http_body_str):
deferred.defer(PollWorkers, task_tag, time.time(), timeout_hours, user_email,
task_url, _countdown=(60 * first_poll_delay_minutes))
+ # Start the instances if required.
+ if not CreateInstanceTemplate(task, task_dir):
+ return Render('Instance template creation failed.', memory_logs)
+ if not CreateInstances(task):
+ return Render('Instance creation failed.', memory_logs)
+
return Render(flask.Markup(
'Success!<br>Your task %s has started.<br>'
'You will be notified at %s when completed.') % (task_tag, user_email),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698