Open andrew-edgar opened 6 years ago
Goal: Change CC to interface with Eirini instead of Diego (configurable)
Options we looked at:
AppStart
just writes the desired state into CCDBProcessesSync
and TasksSync
instantiated from VCAP::CloudController::Jobs::Diego::Sync
take care of convergenceTasksSync
and missing tasks are handled there, tooDesireTaskHandler
CloudController::DependencyLocator.instance.bbs_task_client
is used in TaskDelete
in order to get the singleton instance of the BBS client. All task actions like TaskCreate
etc. are similar, as well as the app (LRP) actions.DependencyLocator
is the place to make the BbsClient
wrappers configurable. We can check config and supply an OpiClient
instead, there.DesireAppHandler
which used in the convergence loop. Since it uses the clients anyway, there is no need to change it.Diego::Client
with our e.g. OPI::Client
Diego::Client
already has a pretty domain-specific APIProcessesSync
and TasksSync
use the Diego::Client
already, so this could be an even simpler drop-inDiego::Client
is not used directly, but wrapped by VCAP::CloudController::Diego::BbsAppsClient
and VCAP::CloudController::Diego::BbsTaskClient
. There is also BbsStagerClient
which is similar.Preferred way: #3 as it seems to have the smallest set of changes and there really is no benefit of #1.
In DependencyLocator#bbs_task_client
, return a new OpiClient that just implements
desire_task(task_guid: task_guid, task_definition: task_definition, domain:
cancel_task(guid)
task_by_guid(guid)
tasks(domain: TASKS_DOMAIN)
upsert_domain(domain: TASKS_DOMAIN, ttl: TASKS_DOMAIN_TTL)
In Eirini, implement an HTTP endpoint that takes JSON (?) and implements the aforementioned API calls
AC: Task execution happens in k8s, while staging and LRPs still run in Diego
DependencyLocator#bbs_stager_client
, return the new OpiClient
AC: Staging happens in k8s, while LRPs still run in Diego
DependencyLocator#bbs_apps_client
, return the new (enhanced) OpiClientOpiClient
AC: Staging, tasks and apps (LRP) happen in k8s
sink
would go away from Eirini as wellupsert_domain
being used for?ping
required?
Test and investigate the best way for CAPI to inteface with Eirini and to Diego in the long run.
Output from the story is a design on what would needed to be done in Capi (PR) and what needs to be done Eirini to work