-
Notifications
You must be signed in to change notification settings - Fork 594
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
Conversation
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
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 <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
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.
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.
LGTM since it seems to do no harm to current dev experience and at the same time delete so many LoC
This PR has been open for 60 days with no activity. If it's blocked by code review, feel free to ping a reviewer or ask someone else to review it. If you think it is still relevant today, and have time to work on it in the near future, you can comment to update the status, or just manually remove the You can also confidently close this PR to keep our backlog clean. (If no further action taken, the PR will be automatically closed after 7 days. Sorry! 🙏) |
Close this PR as there's no further actions taken after it is marked as stale for 7 days. Sorry! 🙏 You can reopen it when you have time to continue working on it. |
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.