apple / pkl-pantry

Shared Pkl packages
Apache License 2.0
234 stars 31 forks source link

[JSON Schema Contrib] Module not found when run in Docker container #56

Closed nguyen-vo closed 5 months ago

nguyen-vo commented 5 months ago

Hi,

I wrote a simple Docker image that install pkl@0.25.3. When trying it out with the Doker container, I got Cannot find module "package://pkg.pkl-lang.org/pkl-pantry/org.json_schema.contrib@1.0.3#/generate.pkl"

pkl eval package://pkg.pkl-lang.org/pkl-pantry/org.json_schema.contrib@1.0.3#/generate.pkl  \
      -m "output"   \
       -p source=path/to/build-connection-config.model.json

If I execute the command with multiple JSON schema files, then I got

I/O error loading module package://pkg.pkl-lang.org/pkl-pantry/org.json_schema.contrib@1.0.3#/generate.pkl.
FileAlreadyExistsException: ?/.pkl/cache/tmp/?/.pkl/cache/tmp/package-1/pkg.pkl-lang.org/pkl-pantry/org.json_schema.contrib@1.0.3/org.json_schema.contrib@1.0.3.zip

I also noticed that the package got downloaded to the working folder

example gist: https://gist.github.com/nguyen-vo/abba17300366e3f38de759b7ecc6dff9

bioball commented 5 months ago

I think this is because you don't have a home dir set.

You can either try setting a home dir, or run pkl eval --no-cache, or pkl eval --cache-dir <some_dir>

nguyen-vo commented 5 months ago

@bioball ahh nice. It works now thanks you

Closing this thread