geneontology / minerva

BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

make minerva use a config file instead of command line invocation for server #301

Open goodb opened 4 years ago

goodb commented 4 years ago

Launch configurations can get complex, especially with different ontology setups, catalogs etc. Migrating server settings from command line parameters to a (committed) configuration file will make it easier to manage, share and test work on the server (and work that depends on the server).

dustine32 commented 4 years ago

As @goodb suggested we can add an option to minerva-cli to accept a config file like a YAML that controls all existing option settings like --import-owl-models and --arachne.

But I'm guessing this config-file option should be optional, still allowing folks to manually set options on the command line? If yes, then given the scenario below:

# Snippet of example config file
ARACHNE: False

Running minerva with config and --arachne option:

java minerva-cli.jar --config-file startup.yaml --arachne

How should the minerva-cli option parser handle this conflict? Should the values in the config supersede the options explicitly set on the cmd line? Or the other way around?

kltm commented 4 years ago

CLI supersedes config: the most explicit intent in from of the user should be what's done to improve clarity.

dustine32 commented 4 years ago

@kltm Makes total sense to me. Thanks for clarifying!

goodb commented 4 years ago

I don't know, it seems like it would be cleaner to me to just limit all forms of user input to edits of the config file. This may be less convenient/important for the command line client, but it feels very right for the launch of the server.

kltm commented 4 years ago

What the balance is I'm happy to leave to others, but if there is a CLI, I believe it should override and config--the most explicit thing presented is the truth. That said, having things in a config makes things easy to control and share. In an ideal world, we would have both to suit our in-the-moment needs and desire for convenience...but we only have so much time to work on stuff... [Trivially, there should be at least a CLI flag for controlling the location of the config file. And help (-h).]