kapitan icon indicating copy to clipboard operation
kapitan copied to clipboard

sjsonnet integration

Open janeklb opened this issue 4 years ago • 6 comments
trafficstars

This issue is raised purely for discovery and discussion purposes.

Databricks have been building a jsonnet implementation that runs on the JVM: sjsonnet. Interestingly, their benchmark advertises a ~200x performance boost over jsonnet, and a ~40x performance boost over go-jsonnet.

Unfortunately, there are no python bindings for sjsonnet and so it wouldn't just be a drop-in replacement into kapitan. Raising this just to highlight the fact that such a thing exists.

A tiny bit of solutionising: a search for python + jvm yields the jvm python module. The docs don't show any examples of how it should/could be used, and there's the fact that it's still beta and does not have a (visible) userbase, so I'm not sure if it even could be a good option... but it is a relatively new project.

janeklb avatar Nov 15 '21 23:11 janeklb

Certainly something worth discussing! There's quite a few implementations out there. While I don't think it's worth supporting them at this stage, perhaps we can think of a generic way of running external commands that's a bit more sophisticated than the external input type.

ramaro avatar Dec 06 '21 15:12 ramaro

There really are quite a few implementations out there... I had no idea.

For example, the rust impl jrsonnet has even more impressive (and more robust!) benchmarking results, and it even has python bindings!

janeklb avatar Dec 08 '21 20:12 janeklb

Looks like jrsonnet works out tof the box as a drop-in replacement (eg. pip install jrsonnet works without needing any special build environment, then import rjsonnet as jsonnet and you're good to go) ; unfortunately, it fails to compile my targets with an error that doesn't arise when using C or Golang jsonnet implementations.

Some quick benchmarking results against the kapitan examples:

example gojsonnet jrsonnet
docker ~2.5s ~2.5s
kubernetes ~3.5s 3.2s
terraform ~2.8s exception

So.. barely faster than gojsonnet, and also incomplete (or incompatible?)

janeklb avatar Dec 08 '21 22:12 janeklb

unfortunately, it fails to compile my targets with an error that doesn't arise when using C or Golang jsonnet implementations.

Can you share the exception information? We can report the issue to jrsonnet project.

messense avatar Feb 16 '22 02:02 messense

unfortunately, it fails to compile my targets with an error that doesn't arise when using C or Golang jsonnet implementations.

Can you share the exception information? We can report the issue to jrsonnet project.

Unfortunately I no longer have access to the inventory anymore (moved to a different company) so I’m unable to replicate.

janeklb avatar Feb 16 '22 09:02 janeklb