cromshell
cromshell copied to clipboard
FR: Cromshell support for non-interactive setup
in order to use cromshell, I need to at some point interactively run cromshell to answer a few questions. The only question that actually needs to be answered is what the Cromwell server URL is; the other prompts are simply confirmation dialogs.
It should be possible to call:
cromshell update-server [URL]
For example:
cromshell update-server localhost:8000
Cromshell just creates a dot folder in the user's home directory and stores settings in there.
Is there a reason you can't query and update the dotfile that contains the server info?
We can manually work around this by writing the ~/.cromshell/cromwell_server.config
file. That is what we are doing today.
However cromshell
should either document the file and the format and expressly support people updating it directly (it could be listed in the getting started instructions), or provide a way for setting the value through the tool non-interactively. This feature request is for doing the latter, but either way is fine.
Happy to submit a PR for either approach.
The documentation should definitely be updated.
~~As for the feature, it turns out we already have a command to update the server that I forgot about: update-server
. I think that will do what you need. You can't directly query with it I don't think, but this will let you set it programmatically.~~
I'm a dummy and misunderstood your question. Yeah - this is a good idea.
sounds like a sub-command (e.g. print-config
) could be useful and not so hard to implement, for cromshell 2.0.
@bshifaw thoughts?
cromshell2.0 creates a config file if it doesn't find it and asks the user to update it, which can also be updated via update-server
. Wouldn't be a problem to add that print-config subcommand
We can place that under "community feature requests" then.
I just want to be clear on the original request; I'm unclear how we landed on the print-config
command. I'm not opposed to it, but it wasn't the original request.
The original request is to be able to set the URL for Cromshell programmatically and not interactively. Today with cromshell on the master branch, when you run the "update-server" command, the following gets executed:
# Use the update-server sub-command to modify CROMWELL_NEEDS_SETUP here.
if [[ "${SUB_COMMAND}" == "update-server" ]] ; then
CROMWELL_NEEDS_SETUP=true
fi
# Check if we need to set this up.
# Note: because of how `notify` works, we can't require the setup for the notify action.
if ${CROMWELL_NEEDS_SETUP} && [[ "${SUB_COMMAND}" != "notify" ]] ; then
# We need to setup this install.
# Now let's set it up:
which dialog &> /dev/null
r=$?
if [[ ${r} -eq 0 ]] ; then
setupCromshellDialog
else
setupCromshell
fi
exit 0
fi
I'd like to be able to call:
cromshell update-server localhost:8000
and not go through any prompts.
@mbookman Yup - I got it. I think we need both commands / options.