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

[Idea] Use Pkl for Armeria configuration #5842

Open
Dogacel opened this issue Jul 29, 2024 · 3 comments
Open

[Idea] Use Pkl for Armeria configuration #5842

Dogacel opened this issue Jul 29, 2024 · 3 comments

Comments

@Dogacel
Copy link
Contributor

Dogacel commented Jul 29, 2024

Pkl is a modern, open-source, type-safe configuration language developed and maintained by Apple.

Pkl — pronounced Pickle — is an embeddable configuration language which provides rich support for data templating and validation. It can be used from the command line, integrated in a build pipeline, or embedded in a program. Pkl scales from small to large, simple to complex, ad-hoc to repetitive configuration tasks.

https://github.com/apple/pkl

Pkl has first-class support for JVM languages. Pkl also supports Spring Boot configuration natively: https://pkl-lang.org/spring/current/usage.html

I think Armeria can potentially utilize Pkl as its primary configuration language. It is possible to support Pkl as well as JSON / YAML as the configuration language for the downstream users that create services using Armeria. Having a wider dynamic configuration for Armeria could mean it is possible to ship default configurations for various needs, such as templates for local development, prod, task executors, event loops, xds, k8s etc. This means developers can start using armeria quicker and more confidently.

Some things Pkl can potentially replace:

@trustin
Copy link
Member

trustin commented Jul 29, 2024

I'm somewhat concerned about introducing a new language people are not familiar with. Maybe we should consider YAML, or does Pkl also have YAML support?

@Dogacel
Copy link
Contributor Author

Dogacel commented Jul 29, 2024

I'm somewhat concerned about introducing a new language people are not familiar with. Maybe we should consider YAML, or does Pkl also have YAML support?

Yes, PKL can produce JSON/YAML/XML, it should be also possible to consume from those sources.

I'm just exploring the idea, do you find value in abstracting the configuration out using such language like Pkl?

@trustin
Copy link
Member

trustin commented Aug 1, 2024

I'm just exploring, too. 😄 I think it will be useful to have some official YAML configuration that's loaded by Armeria, which could provide an alternative to Java system properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants