buildbucket: refactor build creation

Change service.add_many_async from a giant multi-phase function to a function
with a small body but a few sub-functions

Merge _put_build into add_many_async and create swarming tasks before updating
tag indexes. This means:

* if swarming task creation fails and a client retries results, we won't be
  adding invalid entries to the tag index.
* swarming.create_task_async can add indexed tags to the build and they will be
  added to the tag index.

Remove swarming.is_for_swarming. A build is for swarming if its bucket is 
for swarming. In swarming.create_task_async raise an error if a build is for
a non-swarming bucket, or if task template is not defined for this instance
of buildbucket.

R=vadimsh@chromium.org
BUG=

Change-Id: If55e1c27686834c2672b1e3d07b1956c0e90ee25
Reviewed-on: https://chromium-review.googlesource.com/461239
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
5 files changed
tree: cc39b1a9dc5ff030679f07a1373f44170ef53354
  1. .gitignore
  2. CONTRIBUTING.md
  3. DEPS
  4. LICENSE
  5. OWNERS
  6. PRESUBMIT.py
  7. README.md
  8. WHITESPACE
  9. appengine/
  10. appengine_module/
  11. bootstrap/
  12. build/
  13. cipd/
  14. codereview.settings
  15. config/
  16. crdx/
  17. data/
  18. doc/
  19. docker/
  20. glyco/
  21. go/
  22. infra/
  23. infra_libs/
  24. luci-deploy.cfg
  25. navbar.md
  26. node/
  27. packages/
  28. recipes/
  29. roll-deps.py
  30. run.py
  31. test.py
  32. test/
  33. utils/
README.md

infra.git repository

Welcome to the Chrome Infra repository!

Wondering where to start? Check out General Chrome Infrastructure documentation. In particular, to check out this repo and the rest of the infrastructure code, follow the instructions here. The rest of this page is specific to this repo.

Entry points

  • run.py: wrapper script to run programs contained in subdirectories without having to deal with sys.path modifications.
  • test.py: multi-purpose script to run tests.
  • infra_libs/: generally useful functions and classes
  • infra/services/: standalone programs intended to be run as daemons.
  • infra/tools: command-line tools, intended to be run by developers.
  • appengine/: many Chrome-infra-managed AppEngine applications
  • infra/experimental: for, well, experimental stuff. Once they are stabilized and reviewed, they should be moved in a more permanent place.

Miscellaneous technical stuff

  • bootstrap/: utilities to set up a proper Python virtual environment.
  • infra/path_hacks: submodules of this modules give access to modules in the build/ repository. from infra.path_hacks.common import <stg> is actually getting <stg> from build/scripts/common.
  • utils/: purpose? utils?
  • Need to bump infra/deployed to pick up changes?
    • git push origin <updated hash>:deployed
    • mail chrome-troopers@, include:
      • previously deployed hash (for quick rollback)
      • the hash you just pushed
      • the list of CLs that made this push necessary
      • the output of the git push command