-
Notifications
You must be signed in to change notification settings - Fork 2
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
Per-environment configuration #210
Comments
Is this the job of Zinnia? Node.js is fine without providing environments, since they can be implemented in user land. Solutions use config files and env vars. Do you think Zinnia could provide guidance rather than a solution here? |
Do Deno and Go provide environments? I think if we stand on the shoulders of giants we'll be safer off for now |
Sure, providing guidance is enough as long as we have the lower-level building blocks in place.
Here is the catch: Zinnia modules cannot read environment variables and don't have access to the filesystem except by importing JavaScript source code files from the module's codebase. I am thinking about the following solution:
WDYT about such solution, @juliangruber? Does it feel ergonomic and easy to use? |
I think that will work! I had thought you wanted to support
How do you envision this works? The module author needs some way to tell Zinnia which config to provide inside Station, right? Would repos have Could we rather expose something like So my proposal would be to expose FYI, I personally dislike config templates for projects because they raise the barrier to entry. For security critical projects it's better to get a config from a coworker and be aware of everything that's configured, but for open source modules I don't think that's required. Therefore I'd suggest that if we go with the |
In my vision, there will be no In an ideal world, when the module author wants to deploy a new module version to Stations, they will provide both source code and configuration options to us.
I am not a fan of using environment name or type to decide which config values to use. Quoting from https://12factor.net/config:
12factor recommends using environment variables. We don't have that in Zinnia and Station, and I think such a feature does not belong to our platform. Even if we supported environment variables, we would need to set env vars on a per-module basis inside Station, which would get us back to the config file approach (at least in spirit).
I see your point and I agree with you that config templates are a bit of a pain. I am fine to commit Even when the file is in git, we can still replace it with a different config e.g. when running inside the Station. |
How would Station Core pass the config? I assume like this:
If there is no "station environment", then Station will need to know about all of the configuration for a module. To me Station shouldn't need to know about that, because that's only the module's business. Station can tell a module how much disk space to use, but not which influx endpoint to connect to. As a module author I wouldn't want to give Station control over all settings, some I should own. And for these, it's useful to know whether I'm running inside Station. Playing devil's advocate, I as a module author could just say: "I accept one option in config.json, which is called |
Yes, that's what I had in my mind. We may end up choosing a different location for Ideally, I would like the per-module const ZINNIA_MODULES = [
{
module: 'peer-checker',
repo: 'filecoin-station/mod-peer-checker',
distTag: 'v1.0.0'
}
]
I think see your point. In my mind, the module author is already giving Station full control over everything, both the code and settings. They have to trust us that the code that ends up bundled into Station Core is exactly what they wanted. As a Station maintainer, I don't want to understand details of module configuration. I want the module maintainer to give me both the source code and the configuration values. I think we agree on that. Our opinion seems to differ on the practical implementation of how the module author is going to give use the source code and the configuration, especially whether they are the same thing or two different things. I'd like to make it easier for module authors to keep the configuration (mostly) independent from their source code. Since we don't have env variables, a single config file replacing environment variables seems like a good solution to me. Sure, they can say I accept one option in config.json, which is called At the same time, I think such an approach is not ideal, and we should make it easier for module authors to do better. Hence my proposal from Maybe I was not sure if it was possible to import JSON files in Deno/Zinnia. Since we verified that together today, changing my proposal to use Again, I don't want us to deal with details of module configuration, but I want a way for module authors to give us configuration to be used when their module is deployed to Stations. |
After having integrated Bacalhau, I had wished that the Bacalhau team maintained the config. I needed to get our config reviewed by them, and when there is a change I need to ask them how to properly update the flags. So my experience is the opposite of what you want, but it's also only one example so who knows. If we add |
A typical Zinnia module needs to support at least three different environments:
Each environment usually requires a different configuration.
For example, a module interacting with FVM smart contracts can use one of the testnets for local development, a special-purpose net when running the tests on CI, and the mainnet when deployed to Stations.
Zinnia should provide means for module authors to change this configuration.
The text was updated successfully, but these errors were encountered: