Merge "OWNERS: update to include OWNERS.testplatform"
tree: bd765083c0d952e68dd28f0293aaa53800f76819
  1. bin/
  2. configs/
  3. venv/
  4. www/
  5. .gitignore
  6. .style.yapf
  7. __init__.py
  8. analytics.py
  9. analytics_unittest.py
  10. app.yaml
  11. appengine_config.py
  12. base_event.py
  13. base_event_unittest.py
  14. build_event.py
  15. build_event_unittest.py
  16. build_lib.py
  17. build_lib_unittest.py
  18. build_utils.py
  19. build_utils_unittest.py
  20. buildbucket.py
  21. buildbucket_unittest.py
  22. config_reader.py
  23. config_reader_unittest.py
  24. constants.py
  25. cron.py
  26. cron.yaml
  27. datastore_client.py
  28. datastore_client_unittest.py
  29. file_getter.py
  30. gae_import.py
  31. gae_test.py
  32. global_config.py
  33. local_integration_test.py
  34. main.py
  35. OWNERS
  36. PRESUBMIT.cfg
  37. queue.yaml
  38. README.md
  39. requirements.txt
  40. rest_client.py
  41. runner.py
  42. sanity_test.py
  43. setup_environment.py
  44. stackdriver_lib.py
  45. task.py
  46. task_config_reader.py
  47. task_config_reader_unittest.py
  48. task_executor.py
  49. task_executor_unittest.py
  50. task_unittest.py
  51. test.yaml
  52. time_converter.py
  53. time_converter_unittest.py
  54. timed_event.py
  55. timed_event_unittest.py
  56. tot_manager.py
  57. tot_manager_unittest.py
  58. trigger_receiver.py
  59. trigger_receiver_unittest.py
  60. utils.py
  61. utils_unittest.py
README.md

Suite-Scheduler README

Developer Setup

SDK

suite-scheduler is an AppEngine Standard Python Environment V1 application. You need the Google Cloud SDK's AppEngine Python component to develop and deploy this application:

  • Install Google Cloud SDK:
    • Follow the instructions to install the Python App Engine component.
  • Log in to gcloud: gcloud auth login <username>@google.com
  • Install App Engine Python extensions
    • gcloud components install app-engine-python
    • gcloud components install app-engine-python-extras

Developer environment

Suite-scheduler development must be done in the standard Chrome OS source checkout but entirely outside the Chrome OS chroot environment.

suite-scheduler uses infra_virtualenv to provide a stable environment for development and release.

First, make sure you install virtualenv with version at least 20.0.

Then, to (re)initialize developer environment, run

  bin/setup_environment

For testing changes beyond to the configs/ directory, and for deploying suite-scheduler, you must also obtain certain service credentials used by suite-scheduler.

  bin/setup_environment --load-creds

If you get failures when trying to download credentials,

  • Double check you're logged into the Google Cloud SDK by running gcloud auth list.
  • Contact Test Platform team or one of the OWNERS to be whitelisted.

Testing your changes

Changes to configs/* directory can be tested via sanity tests alone:

  bin/run_sanity_tests
  bin/run_sanity_tests --debug  # More verbose

Other changes must be validated with the full test suite:

  bin/run_tests
  bin/run_tests --debug  # More verbose

These tests include some integration tests that can take over 5 minutes to run.

** WARNING: suite-scheduler unittests do not currently run in presubmit. You MUST ensure that unit-tests pass locally for your change. **

Making configuration changes

  • Add or update your job configuration in configs/suite_scheduler.ini.
  • Update configs/lab_config.ini, if the suite test relies on new board or model. Note, suite scheduler does not automatically catch the new boards or models added to the lab.
  • Test your changes.
  • Submit the change and ping/file bug to infra team. Test platform deputy will rollout your change to the production. Once this is done, you may find the scheduling status of the new suite via our dashboard.

Running an instance locally

If you want to verify any APIs locally, you can run suite scheduler v2 as a local development server (https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server):

a. Finally, start dev_appserver.py in a window:

    dev_appserver.py app.yaml \
    --port=8888 \
    --admin_port=8001 \
    --log_level=debug

b. Test it:

    curl 'http://localhost:8888/cron/trigger_event', or open it in chrome.

Please note that once a dev_appserver is started, it simulates data_store & task_queue, which means:

a. The datastore doesn‘t contain any previous cron run’s information, so the first round of cron/trigger_event won't trigger any event.

b. The task queue is newly created with 0 tasks in it unless cron/trigger_event adds tasks in it. Dev_appserver restart will cause the local task queue to get purged.

Releasing to production

There are two instances of suite-scheduler:

All releases must follow the following process:

Run bin/deploy -h for more usage information.

If there are issues discovered in prod after release, rollback to the previous version.

  gcloud app versions migrate --project=google.com:suite-scheduler ${VERSION}