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

unable to use arbitrary files from non-package sources #1700

Closed
leeederek opened this issue Nov 6, 2023 · 3 comments · Fixed by #2044
Closed

unable to use arbitrary files from non-package sources #1700

leeederek opened this issue Nov 6, 2023 · 3 comments · Fixed by #2044
Assignees
Labels
cli For bugs relating to the CLI feature request painful Painful bug

Comments

@leeederek
Copy link
Contributor

leeederek commented Nov 6, 2023

Background & motivation

Today, Kurtosis only supports the mounting of files to containers when those files are part of a Kurtosis package. This is painful for when I need to mount files like Grafana dashboard templates to my package for rendering the correct dashboard.

My workarounds today is to store my files in a child/sub package and maintain it. Then, in my main package, import in the child/sub package (via import_module())

Desired behaviour

A Kurtosis package author should be able to specify any local file path or URL to fetch data from & turn into a files artifact to use for the services inside their enclaves, without needing to have the desired data to be part of a Kurtosis package.

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 Nov 6, 2023
@leoporoli leoporoli self-assigned this Nov 15, 2023
@leoporoli leoporoli removed their assignment Nov 29, 2023
@barnabasbusa
Copy link
Collaborator

barnabasbusa commented Dec 2, 2023

It would also be great if the URL specified would recognize if the url points to a file or directory structure, in case its a directory structure, it should create a files artifact off of that directory.

This would enable configuring custom ethereum devnets an ease.

@barnabasbusa
Copy link
Collaborator

Would like to add another comment here:

I have just made a pr to postgres package, but I had no write access to the directory.
In order to be able to locally test if my PR changes are working fine, I have to adjust where I import the postgres package from (which is not a problem)
postgres = import_module("github.com/barnabasbusa/postgres-package/main.star@patch-1")

However, I also have to change the kurtosis.yml for some reason. If I change that in the branch, then the PR will update also, where I would change the default kurtosis.yml (which is obviously not something I want to do). So the only way to make this work, is by changing the kurtosis.yaml to my own repo name, then once the local test is done, revert it, so the PR wouldn't request changes for this file.

There was an error interpreting Starlark code 
Evaluation error: An error occurred while loading the module 'github.com/barnabasbusa/postgres-package/main.star@patch-1'
        Caused by: Error occurred while validating /kurtosis-data/startosis-packages/barnabasbusa/postgres-package/kurtosis.yml
        Caused by: The package name in kurtosis.yml must match the location it is in. Package name is 'github.com/kurtosis-tech/postgres-package' and kurtosis.yml is found here: 'github.com/barnabasbusa/postgres-package'
        at [github.com/kurtosis-tech/ethereum-package/src/blobscan/blobscan_launcher.star:2:25]: <toplevel>
        at [github.com/kurtosis-tech/ethereum-package/main.star:24:25]: <toplevel>

Error encountered running Starlark code.

It would be very good if kurtosis.yaml file would not be required at all, and you could just import any module from anywhere (yolo mode).

@leeederek
Copy link
Contributor Author

Hugobyte had this pain point too today. They wanted to upload a set of files from a directory.

The workaround can be:

  1. Make the remote directory (of files that a user wants to import into their enclave) into a Kurtosis package using a kurtosis.yml
  2. Within plan.run_sh() instruction, git clone the repository and turn those files into files artifacts inside the enclave

@leoporoli leoporoli self-assigned this Jan 9, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 15, 2024
## Description:
allow any GitHub path on the `upload_files` instruction

## Is this change user facing?
YES

## References (if applicable):
Fix #1700
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

Successfully merging a pull request may close this issue.

3 participants