kuota: add database client and initialization

The database client will self-initialize upon construction and perform
basic health check.

This change also updates some library dependencies.

BUG=b:277121319
TEST=scheduke-staging

Change-Id: Ibc70e4d3e3c371277939be60bc490df1aafe35cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/test-scheduling/scheduke/+/4564514
Auto-Submit: Addison Luh <aluh@chromium.org>
Reviewed-by: Julio Hurtado <juahurta@google.com>
Tested-by: Addison Luh <aluh@chromium.org>
Commit-Queue: Addison Luh <aluh@chromium.org>
5 files changed
tree: cfdc87b1298bb3c7e96689762f2fa37e9c7ca51c
  1. kuota/
  2. request_puller/
  3. scheduling_proto/
  4. scheduling_service/
  5. simulator/
  6. .gitignore
  7. .style.yapf
  8. DIR_METADATA
  9. docker_build
  10. docker_debug
  11. docker_run
  12. Dockerfile.scheduling_service
  13. generate_protos
  14. OWNERS
  15. PRESUBMIT.py
  16. README.md
  17. run_go_unittests.sh
  18. run_simulator_v2.py
README.md

Introduction

Scheduke is the build task scheduler for Chromium OS infrastructure.

Currently this repository contains the scheduling simulator code in simulator/ and scheduler/

Install

This project requires the following python packages:

  • yapf
  • sortedcontainers
  • fnvhash

Common issues

Missing yapf style

If you encounter an issue similar to this:

  File "*/yapf/yapflib/style.py", line 680, in _CreateStyleFromConfigParser
    base_style = _STYLE_NAME_TO_FACTORY[based_on]()
KeyError: 'yapf'

You'll need to update your yapf version to the latest, or at least 0.31 or later. Note that there might be another copy of yapf in depot_tools and the depot_tools should be updated as well.

Run the scheduling service locally

  • Set up sudoless docker if you haven‘t--it’s required for gcloud and docker to work together.

  • Build the image

    ./docker_build
    
  • Launch a container with the image

    ./docker_run
    
    • To send a request to the container
      curl localhost:8080/device_event
      
  • To open a shell into the image

    ./docker_debug