Introducing podenv configuration powered by Dhall


I would like to introduce a container wrapper named podenv that is powered by Dhall. Thanks to the Haskell library, I have been able to work with the Dhall.Core representation to provide an ergonomic configuration. In particular:

  • The configuration contains a collection of Application schemas similar to a package set, but using Dhall records. Podenv lets you select the desired application by it’s attribute name.

  • The configuration can also contain Dhall functions, and in that case the parameter is managed by the command line.

So for example, this configuration:

{ ssh =
  { agent = (env:PODENV).Application::{=}
  , client = \(host : Text) ->
      (env:PODENV).Application::{ command = [ "ssh", host ] }

… can be used like this: $ podenv ssh.client server-name. When listing the available applications, podenv also displays the name of function parameters.

The main difficulty I had with Dhall is to keep the types in sync with the runtime to avoid errors between different versions. The solution I found is to embed the record completion schemas in the program and inject them in the environment so that user defined configuration uses env:PODENV.


1 Like