| OLD | NEW |
| 1 # Appengine Frontend for Clovis | 1 # Appengine Frontend for Clovis |
| 2 | 2 |
| 3 [TOC] | 3 [TOC] |
| 4 | 4 |
| 5 ## Usage | 5 ## Usage |
| 6 | 6 |
| 7 Visit the application URL in your browser, and upload a JSON dictionary with the | 7 Visit the application URL in your browser, and upload a JSON dictionary with the |
| 8 following keys: | 8 following keys: |
| 9 | 9 |
| 10 - `action` (string): the action to perform. Only `trace` is supported. | 10 - `action` (string): the action to perform. Only `trace` and `report` are |
| 11 supported. |
| 11 - `action_params` (dictionary): the parameters associated to the action. | 12 - `action_params` (dictionary): the parameters associated to the action. |
| 12 See below for more details. | 13 See below for more details. |
| 13 - `backend_params` (dictionary): the parameters configuring the backend for | 14 - `backend_params` (dictionary): the parameters configuring the backend for |
| 14 this task. See below for more details. | 15 this task. See below for more details. |
| 15 | 16 |
| 16 ### Parameters for `backend_params` | 17 ### Parameters for `backend_params` |
| 17 | 18 |
| 18 - `instance_count` (int): Number of Compute Engine instances that will be | 19 - `instance_count` (int): Number of Compute Engine instances that will be |
| 19 started for this task. | 20 started for this task. |
| 20 - `storage_bucket` (string): Name of the storage bucket used by the backend | 21 - `storage_bucket` (string): Name of the storage bucket used by the backend |
| 21 instances. Backend code and data must have been previously deployed to this | 22 instances. Backend code and data must have been previously deployed to this |
| 22 bucket using the `deploy.sh` [script][4]. | 23 bucket using the `deploy.sh` [script][4]. |
| 23 - `tag` (string, optional): tag internally used to associate tasks to backend | 24 - `tag` (string, optional): tag internally used to associate tasks to backend |
| 24 ComputeEngine instances. This parameter should not be set in general, as it | 25 ComputeEngine instances. This parameter should not be set in general, as it |
| 25 is mostly exposed for development purposes. If this parameter is not | 26 is mostly exposed for development purposes. If this parameter is not |
| 26 specified, a unique tag will be generated. | 27 specified, a unique tag will be generated. |
| 27 - `timeout_hours` (int, optional): if workers are still alive after this | 28 - `timeout_hours` (int, optional): if workers are still alive after this |
| 28 delay, they will be forcibly killed, to avoid wasting Compute Engine | 29 delay, they will be forcibly killed, to avoid wasting Compute Engine |
| 29 resources. Defaults to `5`. | 30 resources. Defaults to `5`. |
| 30 | 31 |
| 31 ### Parameters for the `trace` action | 32 ### Parameters for the `trace` action |
| 32 | 33 |
| 34 The trace action takes a list of URLs as input and generates a list of traces by |
| 35 running Chrome. |
| 36 |
| 33 - `urls` (list of strings): the list of URLs to process. | 37 - `urls` (list of strings): the list of URLs to process. |
| 34 - `repeat_count` (integer, optional): the number of traces to be generated | 38 - `repeat_count` (integer, optional): the number of traces to be generated |
| 35 for each URL. Defaults to 1. | 39 for each URL. Defaults to 1. |
| 36 - `emulate_device` (string, optional): the device to emulate (e.g. `Nexus 4`). | 40 - `emulate_device` (string, optional): the device to emulate (e.g. `Nexus 4`). |
| 37 - `emulate_network` (string, optional): the network to emulate. | 41 - `emulate_network` (string, optional): the network to emulate. |
| 38 | 42 |
| 43 ### Parameters for the `report` action |
| 44 |
| 45 Finds all the traces in the bucket (specified in the backend parameters) and |
| 46 generates a report in BigQuery. |
| 47 |
| 48 This action has no parameters. |
| 49 |
| 39 ## Development | 50 ## Development |
| 40 | 51 |
| 41 ### Design overview | 52 ### Design overview |
| 42 | 53 |
| 43 - Appengine configuration: | 54 - Appengine configuration: |
| 44 - `app.yaml` defines the handlers. There is a static handler for all URLs | 55 - `app.yaml` defines the handlers. There is a static handler for all URLs |
| 45 in the `static/` directory, and all other URLs are handled by the | 56 in the `static/` directory, and all other URLs are handled by the |
| 46 `clovis_frontend.py` script. | 57 `clovis_frontend.py` script. |
| 47 - `queue.yaml` defines the task queues associated with the application. In | 58 - `queue.yaml` defines the task queues associated with the application. In |
| 48 particular, the `clovis-queue` is a pull-queue where tasks are added by | 59 particular, the `clovis-queue` is a pull-queue where tasks are added by |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 # Install dependencies in the lib/ directory. | 109 # Install dependencies in the lib/ directory. |
| 99 pip install -r requirements.txt -t lib | 110 pip install -r requirements.txt -t lib |
| 100 # Deploy. | 111 # Deploy. |
| 101 gcloud preview app deploy app.yaml | 112 gcloud preview app deploy app.yaml |
| 102 ``` | 113 ``` |
| 103 | 114 |
| 104 [1]: https://cloud.google.com/sdk | 115 [1]: https://cloud.google.com/sdk |
| 105 [2]: https://cloud.google.com/appengine/docs/python/taskqueue | 116 [2]: https://cloud.google.com/appengine/docs/python/taskqueue |
| 106 [3]: https://cloud.google.com/appengine/docs/python/config/queue | 117 [3]: https://cloud.google.com/appengine/docs/python/config/queue |
| 107 [4]: ../backend/README.md#Deploy-the-code | 118 [4]: ../backend/README.md#Deploy-the-code |
| OLD | NEW |