top

Package distributor contains all the adaptors for the various supported distributor protocols. At a high level, it works like this:

* Quests specify a distributor configuration by name as part of their
  identity.
* When an Execution for that Quest NeedsExecution, DM reads configuration
  (distributor.proto) from luci-config. This configuration is stored
  as part of the Execution so that for the duration of a given Exectuion,
  DM always interacts with the same distributor in the same way (barring
  code changes in DM's adapter logic itself).
* DM uses the selected distributor implementation to start a task and
  record its Token. Additionally, the distributor SHOULD publish on DM's
  pubsub topic to update DM's state. When publishing updates, the
  distributor MUST include the token returned from PrepareTopic (or else
  the published update will be ignored).
* When DM gets a hit on pubsub, it will load the Execution, load its cached
  distributor configuration, and then call HandleNotification for the
  adapter to parse the notification body and return the state of the task.

Adding a new distributor requires:

* Add a new subdir of protos with the configuration proto for the new
  distributor. Each distributor implementation must have its own unique
  Config message.
* Add a matching subdir of this package for the implementation of the
  distributor.
* In the implementation, add a Register method that registers the
  implementation with this package appropriately.
* In the DM frontend, import your new package implementation and run its
  Register method.

Imports 16 package(s) ΒΆ

  1. github.com/luci/luci-go/appengine/gaemiddleware
  2. github.com/luci/luci-go/common/config
  3. github.com/luci/luci-go/server/router
  4. github.com/luci/gae/service/datastore
  5. github.com/luci/gae/service/info
  6. github.com/luci/gae/service/taskqueue
  7. github.com/luci/luci-go/dm/appengine/model
  8. github.com/luci/luci-go/tumble
  9. github.com/golang/protobuf/proto
  10. github.com/luci/luci-go/common/errors
  11. github.com/luci/luci-go/common/logging
  12. golang.org/x/net/context
  13. github.com/luci/luci-go/common/gcloud/pubsub
  14. github.com/luci/luci-go/dm/api/distributor
  15. github.com/luci/luci-go/dm/api/service/v1
  16. github.com/luci/luci-go/server/tokens