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

Enables toml configs #1320

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Enables toml configs #1320

merged 1 commit into from
Mar 27, 2024

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Mar 26, 2024

Enables toml configs

  • Use file_exact because file searches parent directories automatically for the config, definitely not the behaviour we want.
  • If config file was not found, it silently ignored the supplied --config-file argument, this was fixed
  • Support loading toml files
  • Makes it clear in logs when we are starting with the built-in default config.

Stack created with Sapling. Best reviewed with ReviewStack.

@AhmedSoliman AhmedSoliman changed the title Enable toml configs Enables toml configs Mar 26, 2024
@AhmedSoliman AhmedSoliman marked this pull request as ready for review March 26, 2024 14:28
Copy link

github-actions bot commented Mar 26, 2024

Test Results

 92 files  ±0   92 suites  ±0   10m 28s ⏱️ +5s
 79 tests ±0   77 ✅ ±0  2 💤 ±0  0 ❌ ±0 
205 runs  ±0  199 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 1a47f34. ± Comparison against base commit 21a407f.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR @AhmedSoliman. The changes look good to me. My only question is about which configuration format we want to support long term and in which format are we putting our example configurations in our docs.

Comment on lines +151 to +156
Some(ext) if ext == "yaml" || ext == "yml" => {
figment.merge(Yaml::file_exact(config_file))
}
Some(ext) if ext == "toml" || ext == "tml" => {
figment.merge(Toml::file_exact(config_file))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to support multiple configuration formats for a longer period? I am wondering whether our users will enjoy the freedom to choose a different format or whether it is confusing if different examples use different configuration formats. I guess my question is should we have a single configuration format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need two formats, but I'd like us to standardize on toml. If you don't have objections to using toml, then once I finish the transition to the new config structure, we can remove Yaml support.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's easy enough, I would like to retain json/yaml. This allows to easily integrate with Kube (e.g. think the operator CRD could copy paste the yaml configuration from the Custom Resource to the configuration file).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also when you change this, please update the e2e code to use toml rather than json for serializing the configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference for either format but I have a preference for one official format if possible. Toml seems to be easier to handle/understand compared to yaml from what I have read in some discussions. So I would be fine with it. Maybe let's also check with the cloud team whether they have some concerns about moving away from yaml.

Regarding the Kube scenario, do you envision that one can configure a Restate cluster via specifying some yaml in the operator CRD? Couldn't one also put some toml snippet (e.g. as a json string) that gets copied over?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check with the cloud/kube team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all cases, we need this as a transitional step anyway, a followup PR can address removing yaml support if consensus is reached on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity, no issues about moving completely to TOML were raised from the cloud team.

- Use file_exact because file searches parent directories automatically for the config, definitely not the behaviour we want.
- If config file was not found, it silently ignored the supplied --config-file argument, this was fixed
- Support loading toml files
- Makes it clear in logs when we are starting with the built-in default config.
@AhmedSoliman AhmedSoliman merged commit 1a47f34 into main Mar 27, 2024
6 checks passed
@AhmedSoliman AhmedSoliman deleted the pr1320 branch March 27, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants