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

kit pack error #81

Open
bmicklea opened this issue Mar 7, 2024 · 1 comment · May be fixed by #267
Open

kit pack error #81

bmicklea opened this issue Mar 7, 2024 · 1 comment · May be fixed by #267
Assignees
Labels
bug Something isn't working CLI Topics related to the CLI *Salmon not pink help wanted Extra attention is needed

Comments

@bmicklea
Copy link
Contributor

bmicklea commented Mar 7, 2024

Describe the bug
When trying to run kit pack with the attached Kitfile I get an error:

Failed to pack model kit: error resolving /Users/bmicklea/Documents/GitHub: lstat /Users/bmicklea/Documents/GitHub/Users: no such file or directory

It looks like it's appending a second Users to the path, although that's weird because the path actually has more to it...

kitfile.txt

To Reproduce
Steps to reproduce the behavior:

  1. Run kit pack ./ with the attached kitfile (it'll need to have the .txt extension removed)
  2. See error

Version
Next

@bmicklea bmicklea added help wanted Extra attention is needed CLI Topics related to the CLI *Salmon not pink labels Mar 7, 2024
@gorkem gorkem added the bug Something isn't working label Mar 7, 2024
@amisevsk
Copy link
Contributor

amisevsk commented Mar 8, 2024

The awful error message we're printing is hiding quite a few layers in what's actually going wrong here, which range from very simple to fix to design-level questions:

  1. First and foremost, we're missing some basic validation of Kitfile fields -- if a Kitfile contains an absolute path (as the sample here does), we should report that as the error rather than trying to process it further.
  2. The reason this error is being triggered is because paths in a Kitfile are assumed to be relative to the pack context. For example, if I run
    kit pack <directory>
    
    and have a Kitfile with the model
    model:
      name: my-model
      path: path/to/some/model
    we will look for the model in <directory>/path/to/some/model. For the sample Kitfile, we're assuming the absolute paths are relative, which leads to strange paths in the error message. This is mentioned in the help text for kit pack but should be documented more clearly.
  3. Fixing 1 and 2 above would lead to another issue with paths, where we require all parts of a ModelKit to exist within one "parent" directory (the <directory> in kit pack <directory>). This is necessary to avoid potentially dangerous behavior where packing or unpacking a ModelKit could interact with sensitive files on the system, which we want to prevent. This is also something that should be documented clearly to avoid strange pitfalls.
  4. Finally, the Kitfile is attempting to reference a dataset by remote URL, which we currently don't support -- path is assumed to refer to a local path to some files we want to include in the ModelKit. I think for practical purposes, storing datasets remotely makes a lot of sense, so maybe it makes sense to extend the Kitfile section for datasets to support this explicitly.

The top few we can (and should) fix fairly easily. The question of how we support remotely stored datasets is potentially another matter.

@amisevsk amisevsk linked a pull request Apr 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI Topics related to the CLI *Salmon not pink help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants