cnabio / cnab-spec

Cloud Native Application Bundle Specification
https://cnab.io
Other
956 stars 99 forks source link

Interactive command line installs [FEATURE REQUEST] #292

Open cocowalla opened 4 years ago

cocowalla commented 4 years ago

Following on from Slack conversations with Porter and Duffle devs, this is a feature request for the ability to do interactive installations.

As an example, let's say I have a bundle that takes several parameters, and I want to make it easier to install for less Linux-savvy users - an interactive CLI installation would be really beneficial here, prompting the user to enter a value for each parameter.

A bit like Duffle Coat, but for the command line.

At present, this isn't possible using the run tool, because it runs in a container in which STDIN is not attached (I believe this was a conscious decision, because some target runtimes, such as K8s, cannot use STDIN).

If someone wants to do this today, they have to create their own installer that wraps duffle, which is a little ugly.

There are at least 2 ways to go about this feature request:

  1. Allow optionally enabling STDIN for the run tool, so devs can basically do whatever they want in the invocation container. Not sure if it's somehow possible for the run tool to alter parameters at present, but if not a means would need to be added (perhaps by setting environment variables..?)

  2. Some kind of utility that makes it easier to wrap duffle install/upgrade/uninstall with a custom script that is responsible for passing user input to duffle as parameters

technosophos commented 4 years ago

For the CNAB Core 1, I think we are going to not introduce this into the standard. It works for some cases, but introduces a lot of difficulties that we fear would lead to incompatibility between bundles and their runtimes.

Your second option -- supporting this via either library code (e.g. cnab-go or cnab-rust) or a stand-alone wrapping tool -- sounds great to me. That's outside the scope of this particular repository, but I think it is a good idea.