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 a --args-file flag to kurtosis run #1112

Closed
mieubrisse opened this issue Aug 14, 2023 · 5 comments · Fixed by #1451 or #1453
Closed

Add a --args-file flag to kurtosis run #1112

mieubrisse opened this issue Aug 14, 2023 · 5 comments · Fixed by #1451 or #1453
Assignees
Labels

Comments

@mieubrisse
Copy link
Collaborator

Background & motivation

While reviewing the guidance around how to pass args to run from a file, I realized that the quoting/spaces thing is a hassle, especially for people unfamiliar with Bash. We can make this much easier for folks.

Desired behaviour

We should add an --args-file option, so that the second argument to kurtosis run can be interpreted as a file, and read in as args for the user (no escaping or "$(cat params.json)" nonsense needed)

How important is this to you?

Nice to have; this feature would make using Kurtosis more enjoyable.

@github-actions github-actions bot added the nice to have Nice to have feature label Aug 14, 2023
@mieubrisse
Copy link
Collaborator Author

mieubrisse commented Sep 13, 2023

Extra reason we might want to do this: now that we have typehint comments in Starlark, we can actually allow users to treat Starlark packages like "CLIs", generating arguments.

For example, let's say we had Starlark like so:

def run(plan, image, optional_arg = "default"):
    """
    Args:
        image (string): The image that's needed
        optional_arg (string): Some optional arg

The GUI already uses this type-hinting information to generate a pretty form for users to fill in, and I'd like to do something similar in the CLI (so generating "args" and "flags" for the user). E.g.:

kurtosis run github.com/the-user/the-package "some-new-image" --optional_arg "New value of optional arg"

However, if we do this, we'll need to have a way for the user to say, "I have a JSON/YAML file, and each key of the root-level object is actually an argument"

@galenmarchetti
Copy link
Contributor

+1 to this

@mieubrisse
Copy link
Collaborator Author

Requested again by Barnabas this morning (pain: it's difficult and annoying to remember the syntax)

@mieubrisse
Copy link
Collaborator Author

mieubrisse commented Sep 18, 2023

Also @leeederek had 3 people ask about this at Protocolberg, because the "$(cat ...)" syntax isn't cross-architecture (Windows does something different)

@h4ck3rk3y
Copy link
Contributor

Abhi from web3-labs asked for this on Discord, I am on it

h4ck3rk3y added a commit that referenced this issue Oct 2, 2023
## Description:
To make this change work with previous versions of Kurtosis the argument
takes precedence over value provided by the flag; so if a user provides
a non `{}` for input-args; and a value for flag as well, we will go with
the value for the arg

## Is this change user facing?
YES

## References (if applicable):
Closes #1112
adschwartz added a commit that referenced this issue Oct 2, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.83.16](0.83.15...0.83.16)
(2023-10-02)


### Features

* add font
([#1454](#1454))
([75ce332](75ce332)),
closes [#1386](#1386)
* added --args-file to Kurtosis run
([#1451](#1451))
([fdc6220](fdc6220)),
closes [#1112](#1112)


### Bug Fixes

* Remove mouse wheel capture
([#1452](#1452))
([2d35d77](2d35d77)),
closes [#1438](#1438)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Anders Schwartz <adschwartz@users.noreply.github.com>
leoporoli pushed a commit that referenced this issue Oct 3, 2023
## Description:
To make this change work with previous versions of Kurtosis the argument
takes precedence over value provided by the flag; so if a user provides
a non `{}` for input-args; and a value for flag as well, we will go with
the value for the arg

## Is this change user facing?
YES

## References (if applicable):
Closes #1112
leoporoli pushed a commit that referenced this issue Oct 3, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.83.16](0.83.15...0.83.16)
(2023-10-02)


### Features

* add font
([#1454](#1454))
([75ce332](75ce332)),
closes [#1386](#1386)
* added --args-file to Kurtosis run
([#1451](#1451))
([fdc6220](fdc6220)),
closes [#1112](#1112)


### Bug Fixes

* Remove mouse wheel capture
([#1452](#1452))
([2d35d77](2d35d77)),
closes [#1438](#1438)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Anders Schwartz <adschwartz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants