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
feat(risedev): use jsonnet for profiles and templates #16659
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
risedev-profiles.libsonnet
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where future risedev profiles will reside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrated from the template
section in risedev.yml
.
// Advertise port of MinIO s3 endpoint | ||
port: 9301, | ||
// Listen address of MinIO endpoint | ||
listenAddress: self.address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use DollarExpander
anymore.
|
||
etcd: { | ||
// Id of this instance | ||
id: 'etcd-' + self.port, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use IdExpander
anymore.
// Expand the provided steps. | ||
// The nested `provide-xx` fields will not be used. Prune them. | ||
pruneProvide(otherStep) | ||
for otherStep in steps | ||
if std.startsWith(otherStep.id, std.rstripChars(step[name], '*')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for ProvideExpander
anymore.
src/risedevtool/jsonnet/main.jsonnet
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the entrypoint of the jsonnet program to evaluate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to convert risedev.yml
to the format of risedev-profiles.libsonnet
.
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
#[serde(deny_unknown_fields, rename_all = "camelCase")] | ||
struct Input { | ||
config_path: Option<String>, | ||
steps: Vec<ServiceConfig>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated JSON will be directly deserialized into this struct, then executed by risedev-dev
.
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM (not delved into the details), although I don't see there's any compelling reasons to do the refactoring (risedev config expander works good enough).
Besides, please update src/risedevtool/README.md
. src/risedevtool/risedev-schema.json
may also need update.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Jsonnet is a powerful tool to write reusable and extensible configurations.
In this PR, we introduced jsonnet-based RiseDev profiles and templates. Benefits are:
The compatibility for old
risedev.yml
format is still kept throughcompat.libsonnet
. We can migrate them in the future.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.