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

Unified Diff: tools/android/loading/gce/startup-script.sh

Issue 1895033002: tools/android/loading Switch the GCE worker to pull queues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appengine
Patch Set: Created 4 years, 8 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
Index: tools/android/loading/gce/startup-script.sh
diff --git a/tools/android/loading/gce/startup-script.sh b/tools/android/loading/gce/startup-script.sh
index 94edb22efc9ed7f8b256804dc6c0c70e9d6fc6ab..a7253303e519f2b0dd14cfd60ca2a12f55f74c52 100644
--- a/tools/android/loading/gce/startup-script.sh
+++ b/tools/android/loading/gce/startup-script.sh
@@ -66,12 +66,14 @@ chown -R pythonapp:pythonapp /opt/app
# Create the configuration file for this deployment.
DEPLOYMENT_CONFIG_PATH=/opt/app/clovis/deployment_config.json
+TASKQUEUE_TAG=`get_instance_metadata taskqueue_tag`
cat >$DEPLOYMENT_CONFIG_PATH << EOF
{
"project_name" : "$PROJECTID",
"cloud_storage_path" : "$CLOUD_STORAGE_PATH",
"chrome_path" : "/opt/app/clovis/binaries/chrome",
- "src_path" : "/opt/app/clovis/src"
+ "src_path" : "/opt/app/clovis/src",
+ "taskqueue_tag" : "$TASKQUEUE_TAG"
}
EOF
@@ -79,17 +81,15 @@ EOF
AUTO_START=`get_instance_metadata auto-start`
# Exit early if auto start is not enabled.
-if [ "$AUTO_START" != "true" ]; then
+if [ "$AUTO_START" == "false" ]; then
exit 1
fi
-# Configure supervisor to start gunicorn inside of our virtualenv and run the
-# applicaiton.
+# Configure supervisor to start the worker inside of our virtualenv.
cat >/etc/supervisor/conf.d/python-app.conf << EOF
[program:pythonapp]
directory=/opt/app/clovis/src/tools/android/loading/gce
-command=/opt/app/clovis/env/bin/gunicorn --workers=1 --bind 0.0.0.0:8080 \
- 'main:StartApp('\"$DEPLOYMENT_CONFIG_PATH\"')'
+command=python worker.py --config $DEPLOYMENT_CONFIG_PATH
autostart=true
autorestart=true
user=pythonapp

Powered by Google App Engine
This is Rietveld 408576698