kurtosis-tech / kurtosis

A platform for packaging and launching ephemeral backend stacks with a focus on approachability for the average developer.
https://docs.kurtosistech.com/
Apache License 2.0
372 stars 53 forks source link

Ability to render a Starlark dict into JSON or YAML for templating use cases #1491

Open galenmarchetti opened 1 year ago

galenmarchetti commented 1 year ago

Background & motivation

My config files depend on arrays of services: https://github.com/galenmarchetti/basic-service-package/blob/main/service-b-config.json.tmpl <--- for this demo its very important to have it, and I've had this use case in non-demo (but non-kurtosis-things) before as well. In order to render the array I have to do write my own JSON rendering logic in starlark

Desired behaviour

I'd love to have a utility to render a starlark dict to either JSON or YAML so i can use it cleanly in my service config files

How important is this to you?

Painful; the lack of this feature makes using Kurtosis frictionful.

mieubrisse commented 1 year ago

Talked with Galen about this in a user experience session on Friday; notes forthcoming

mieubrisse commented 1 year ago

The render-to-JSON/YAML part is actually very possible; the bit that's missing is a way to write that JSON/YAML to a files artifact

leeederek commented 12 months ago

@galenmarchetti does this package solve your pain point? https://bazel.build/rules/lib/core/json