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

FR: be able to upload python objects #2430

Open
barnabasbusa opened this issue May 7, 2024 · 2 comments
Open

FR: be able to upload python objects #2430

barnabasbusa opened this issue May 7, 2024 · 2 comments
Labels
cli For bugs relating to the CLI feature request painful Painful bug

Comments

@barnabasbusa
Copy link
Contributor

barnabasbusa commented May 7, 2024

Background & motivation

Currently upload files is limited to files. https://docs.kurtosis.com/api-reference/starlark-reference/plan/#upload_files

artifact_name = plan.upload_files(
    # The file to upload into a files artifact
    # Must be any GitHub URL without the '/blob/main' part.
    # MANDATORY
    src = "github.com/foo/bar/static/example.txt",

    # The name to give the files artifact that will be produced.
    # If not specified, it will be auto-generated.
    # OPTIONAL
    name = "my-artifact",

    # A human friendly description for the end user of the package
    # OPTIONAL (Default: Uploading file 'PATH' to files artifact 'ARTIFACT_NAME')
    description = "uploading file"
)

It would be great if you had a python object, like a python array, dict, it could be directly referenced and uploaded as a files artifact as well.

Desired behaviour

test = [A,B,C]

artifact_name = plan.upload_files(
    src = test
    name = "my-test-artifact",
    description = "uploading file"
)

How important is this to you?

Painful; the lack of this feature makes using Kurtosis frictionful.

What area of the product does this pertain to?

CLI: the Command Line Interface

@github-actions github-actions bot added cli For bugs relating to the CLI painful Painful bug labels May 7, 2024
@h4ck3rk3y
Copy link
Contributor

Some more context - Barnabas wants to create files artifacts from Starlark objects; something like

plan.create_artifact(
    contents = str or list of string,
    target = "filename.txt",
    name = "barnabas-artifact",
    delimiter = "\n", optional value that applies to strings
)

if its a string it can be written out to target which will be at root of barnabas-artifact; if its a list of strings it can be concatenated with "\n" by default or allow the person to give the delimiter

@0xTylerHolmes
Copy link

Any update on this? I think it would be extremely valuable to be able to do this for the package configuration file that you are using. The service context is very limited in terms of getting complete service information. I'm running into some roadblocks that could be alleviated if I had access to the StarlarkRunConfig file used to start the remote packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli For bugs relating to the CLI feature request painful Painful bug
Projects
None yet
Development

No branches or pull requests

3 participants