PhysarumSM / service-manager

LCA and Proxy
Apache License 2.0
0 stars 0 forks source link

Support passing bootstraps via CLI and fallback(s) #31

Closed t-lin closed 4 years ago

t-lin commented 4 years ago

Hard-coded bootstraps has been removed as of v0.5.0 of Multi-Tier-Cloud/common. Should be able to support secifying the bootstrap via CLI for:

@michaelweiyuzhao @hivanco If a CLI bootstrap is not specified, we should fallback to another method. A configuration file setting already exists as one potential fallback. Should we support reading from environment variables as well? If so, what should the prioritization order be? CLI=>File=>Env? Or CLI=>Env=>File?

t-lin commented 4 years ago

Initial CLI bootstrap support for allocator done. Currently falling back to configuration file. No support for environment variable yet (TODO?), need to decide the order of precedence first.

t-lin commented 4 years ago

CLI support in proxy is also done. Falls back to configuration file. No environment variable yet, need to decide order.

mwyzhao commented 4 years ago

I would say most specific to least specific is probably good, ie. CLI (specific to run) => config file (specific to proxy instance) => env variable (specific to machine) Though in the default case it would probably use the configuration in a pre-shipped config file so I wonder what the best way to let the user know that the CLI and env variable options exist.

t-lin commented 4 years ago

What environment variable name to use?

Edit: The new helpler functions introduced via Multi-Tier-Cloud/common#13 should support passing multiple bootstraps via a space-separated environment variables.

t-lin commented 4 years ago

Done for both proxy and allocator. The order of precedance for specifying bootstraps are:

  1. CLI flags
  2. Configuration file
  3. Environment variable

If multiple methods are used, we take only take the bootstraps from the highest ranked method (i.e. we do not take a union of the bootstraps).

mwyzhao commented 4 years ago

Need make sure microservice containers do not have a bootstrap section in their config files for this to work. I'll start a new issue for it.