Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregator entity: bootstrap global aggregators into divviup-api deployment #198

Closed
tgeoghegan opened this issue Jun 16, 2023 · 6 comments
Closed
Labels
byohelper needed for BYOHelper and self-service task provisioning (#1486)

Comments

@tgeoghegan
Copy link
Contributor

We want Janus instances operated by Divvi Up to be just like any other aggregator, in that they are rows in the database table for aggregators, except that they will be global aggregators, available for use in tasks for any account. Pairing a per-account aggregator is a subscriber's responsibility, but we want to ensure that Divvi Up's Janus is available in divviup-api deployments. Our deploy tools will need a means of registering one or more global aggregators when deploying divviup-api.

@tgeoghegan
Copy link
Contributor Author

This work might end up being in janus-ops, but depending on the solution strategy it could also involve code changes here in divviup-api: maybe we could provide the specifications of global aggregators in configuration and divviup-api would write them into its database at startup if they're not already there?

@tgeoghegan tgeoghegan added the byohelper needed for BYOHelper and self-service task provisioning (#1486) label Jun 16, 2023
@jbr
Copy link
Contributor

jbr commented Jun 16, 2023

How strong is the need to automate this? The simplest thing that could reasonably work is for a human to configure this database state once for each deploy environment, which seems comparable to configuring an admin Account (which similarly is not bootstrapped).

@jbr
Copy link
Contributor

jbr commented Jun 16, 2023

If it is important to automate, I'd lean towards either exposing a protected http api, a binary target, or env variables with insert-on-boot behavior over having another process insert into the database, which should be considered private state of the divviup-api process

@tgeoghegan
Copy link
Contributor Author

I think you're right, this is something that would happen infrequently enough that we could live with having an admin interface to divviup-api -- which could be accessed either through a command line tool or a web UI -- that allows registering global aggregators. We'd need to write a runbook for registering a global aggregator.

Another option would be to make this part of the janus deploy process: after it deploys the aggregator, the janus deploy process could hit the admin-only POST /aggregators endpoint on divviup-api to register the newly deployed aggregator. If we pursue that, then there's probably no work here in divviup-api and all the action would be in janus-ops.

@jbr
Copy link
Contributor

jbr commented Jun 16, 2023

And that could piggyback on the account tokens in #195, in that we could create a token on the admin account. Any such tokens would have to be closely guarded, though, since they are omnipotent. Bootstrapping an admin token from divviup-api to Janus or janus-ops would need to be a clipboard-based configuration, which we've avoided elsewhere, though

@jbr
Copy link
Contributor

jbr commented Jul 10, 2023

Closing tentatively because I believe this has been resolved by manually configuring staging (and in the future, by the existence of #269

@jbr jbr closed this as completed Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
byohelper needed for BYOHelper and self-service task provisioning (#1486)
Projects
None yet
Development

No branches or pull requests

2 participants