Git Product home page Git Product logo

Comments (9)

sparkprime avatar sparkprime commented on May 3, 2024 1

I have a feeling that Nix might do that.

Why not just vendor it into your repo though, using jsonnet-bundler to manage that if you want.

from jsonnet.

jessechahal avatar jessechahal commented on May 3, 2024

Can we get an update on this enhancement? Is it something that will ever be worked on? This is issue #9 from 2014....

from jsonnet.

sparkprime avatar sparkprime commented on May 3, 2024

I don't think so. There is some objection to the idea because although in principle it's no more non-hermetic than regular file I/O and indeed you can use UNIX sockets or whatever to connect to curl and achieve the same thing, nevertheless it makes the config depend on having an internet connection, and URLs don't feel as static as files on disk.

The people who have needed this have implemented it using import callbacks or native callbacks, which works quite well. If you use native callbacks you have to do the cacheing yourself.

from jsonnet.

sparkprime avatar sparkprime commented on May 3, 2024

Feel free to keep asking though, if enough people want it, it would tip the balance.

from jsonnet.

sbarzowski avatar sbarzowski commented on May 3, 2024

(digression)

The people who have needed this have implemented it using import callbacks or native callbacks, which works quite well. If you use native callbacks you have to do the cacheing yourself.

Is there any reason why native callbacks could be preferred over import callbacks for that? I thought that native callbacks are supposed to be for pure functions only.

BTW probably the most mature discussion of jsonnet package management at the moment is ksonnet stuff here:
https://docs.google.com/document/d/1CQ3cQMH0WgoOpnVl_qFWhqMybE0IJIpkbJOu1xH6HFE

from jsonnet.

sparkprime avatar sparkprime commented on May 3, 2024

No, I think they used native callbacks because they didn't realize they could use import callbacks (although I may be mis-remembering this anyway).

from jsonnet.

mkmik avatar mkmik commented on May 3, 2024

What if we force the import string to include a checksum e.g. "https+sum://foo.com/bar#sha256:123456789abcdef..."

It would still suffer from:

nevertheless it makes the config depend on having an internet connection

But it would be hermetic.

Furthermore, a "file+sum:/...." URL would allow you to be stricter for local on-disk imports too.

from jsonnet.

mkmik avatar mkmik commented on May 3, 2024

With explicit hermetic imports, you always get the same thing, regardless of possible diamond dependencies

from jsonnet.

underrun avatar underrun commented on May 3, 2024

i'd like this feature

my use case is to import some external non-jsonnet json data in a secure way

the json data is not available at packaging time but will be available in a containerized environment at runtime (the name of the resource is well known and versioned)

python and shell are not to be included in the container image - ideally as few tools as possible

from jsonnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.