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

Unified Diff: tools/android/loading/gce/README.md

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: Review comments 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/README.md
diff --git a/tools/android/loading/gce/README.md b/tools/android/loading/gce/README.md
index 2bbd06b7c624175152e8fdb4886606376c959063..825f507841b9a08a8e5e7b9e17d22d762f149b00 100644
--- a/tools/android/loading/gce/README.md
+++ b/tools/android/loading/gce/README.md
@@ -32,15 +32,15 @@ gcloud compute instances create clovis-tracer-1 \
--machine-type n1-standard-1 \
--image ubuntu-14-04 \
--zone europe-west1-c \
- --scopes cloud-platform \
- --metadata cloud-storage-path=$CLOUD_STORAGE_PATH,auto-start=true \
+ --scopes cloud-platform,https://www.googleapis.com/auth/cloud-taskqueue \
+ --metadata cloud-storage-path=$CLOUD_STORAGE_PATH,taskqueue_tag=some_tag \
--metadata-from-file \
startup-script=$CHROMIUM_SRC/tools/android/loading/gce/startup-script.sh
```
**Note:** To start an instance without automatically starting the app on it,
-remove the `--metadata auto-start=true` argument. This can be useful when doing
-iterative development on the instance, to be able to restart the app manually.
+add a `auto-start=false` metadata. This can be useful when doing iterative
+development on the instance, to be able to restart the app manually.
This should output the IP address of the instance.
Otherwise the IP address can be retrieved by doing:
@@ -60,24 +60,9 @@ gcloud compute instances get-serial-port-output clovis-tracer-1
## Use the app
-Check that `http://<instance-ip>:8080/test` prints `hello` when opened in a
-browser.
-
-To send a list of URLs to process:
-
-```shell
-curl -X POST -d @urls.json http://<instance-ip>:8080/set_tasks
-```
-
-where `urls.json` is a JSON dictionary with the keys:
-
-* `urls`: array of URLs
-* `repeat_count`: Number of times each URL will be loaded. Each load of a URL
- generates a separate trace file. Optional.
-* `emulate_device`: Name of the device to emulate. Optional.
-* `emulate_network`: Type of network emulation. Optional.
-
-You can follow the progress at `http://<instance-ip>:8080/status`.
+Create tasks from the associated AppEngine application, see [documentation][3].
+Make sure the `taskqueue_tag` of the AppEngine request matches the one of the
+ComputeEngine instances.
## Stop the app in the cloud
@@ -101,6 +86,14 @@ source env/bin/activate
pip install -r $CHROMIUM_SRC/tools/android/loading/gce/pip_requirements.txt
```
+The first time, you may need to get more access tokens:
+
+```shell
+gcloud beta auth application-default login --scopes \
+ https://www.googleapis.com/auth/cloud-taskqueue \
+ https://www.googleapis.com/auth/cloud-platform
+```
+
Create a JSON file describing the deployment configuration:
```shell
@@ -115,7 +108,8 @@ cat >$CONFIG_FILE << EOF
"project_name" : "$PROJECT_NAME",
"cloud_storage_path" : "$CLOUD_STORAGE_PATH",
"chrome_path" : "$CHROME_PATH",
- "src_path" : "$CHROMIUM_SRC"
+ "src_path" : "$CHROMIUM_SRC",
+ "taskqueue_tag" : "some_tag"
}
EOF
```
@@ -123,12 +117,10 @@ EOF
Launch the app, passing the path to the deployment configuration file:
```shell
-gunicorn --workers=1 --bind 127.0.0.1:8080 \
- --pythonpath $CHROMIUM_SRC/tools/android/loading/gce \
- 'main:StartApp('\"$CONFIG_FILE\"')'
+python $CHROMIUM_SRC/tools/android/loading/gce/worker.py --config $CONFIG_FILE
```
-You can now [use the app][2], which is located at http://localhost:8080.
+You can now [use the app][2].
Tear down the local environment:
@@ -138,3 +130,4 @@ deactivate
[1]: https://cloud.google.com/sdk
[2]: #Use-the-app
+[3]: ../frontend/README.md

Powered by Google App Engine
This is Rietveld 408576698