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

Add params and docstring to run function in main.star #364

Open
tedim52 opened this issue Nov 19, 2023 · 5 comments
Open

Add params and docstring to run function in main.star #364

tedim52 opened this issue Nov 19, 2023 · 5 comments
Assignees

Comments

@tedim52
Copy link
Contributor

tedim52 commented Nov 19, 2023

The main.star should contain a doc string that specifies exactly what the possible input args are, which ones are required and which ones are default, and what their descriptions are types are. This will make it easier for users to get onboarded to the ethereum package as they'll know what's parametrizable via a json/yaml file without having to go to package_io or go off solely example inputs, (author consumer divide)

A good example to go off of is the hyperlane package.

Doing this will also make the package render with a nice form input in Kurtosis Cloud like by parsing docstring

Screen Shot 2023-11-19 at 3 20 07 AM

Whereas the ethereum package one looks like this:
Screen Shot 2023-11-19 at 3 21 01 AM

@tedim52 tedim52 changed the title Add a params ad docstring to run function in main.star Add params and docstring to run function in main.star Nov 19, 2023
@barnabasbusa
Copy link
Contributor

I think if we go down this road, this should be hidden under a group that is collapsable.

And with the default params filled out. And with the option to override all with a single yaml config.

@tedim52
Copy link
Contributor Author

tedim52 commented Nov 21, 2023

Yep. This is all possible with the docstring! Can specify a default that can be overriden very easily with the yaml configs that already exist. I'll create a PR and request ya to demonstrate how it works.

@mieubrisse
Copy link
Contributor

Default params for primitive values are actually already implemented in the newest version of Kurtosis:
Screen Shot 2023-11-21 at 21 45 12

The option to override all with a single YAML config is definitely something we'll have in the near term (though we don't have it yet).

Collapsible groups - what did you have in mind @barnabasbusa ?

@barnabasbusa
Copy link
Contributor

ethereum-package will have tens of different config parameters.

If you have all of them "open" in a non collapsed manner, its gonna take up the whole page.

Would be good to separate them into parts, such as participant group, network config, other configs, additional-tooling.

@mieubrisse
Copy link
Contributor

This is possible simply by making them separate parameters to the run function, e.g.:

def run(plan, participants=[], additional_tools=[], etc.):

This will also allow each of them to have separate documentation, a la: https://github.com/kurtosis-tech/hyperlane-package/blob/main/main.star#L24

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

No branches or pull requests

3 participants