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 |