Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As an admin and developer, I'd benefit from a simplified configuration mechanism #5293

Closed
poikilotherm opened this issue Nov 8, 2018 · 7 comments

Comments

@poikilotherm
Copy link
Contributor

poikilotherm commented Nov 8, 2018

This is a story to the epic #5292.
Might be of use for solutions of #4765.


Context

When installing Dataverse, you need to use asadmin commands to configure your instance either indirectly via the installation script and maybe directly for advanced options like storage etc.

The installation script and asadmin calls itself are not idempotent. That makes it hard to use for

  • Configuration and DevOp tooling like Ansible, Puppet etc
  • Reuse Kubernetes ConfigMaps and Secrets or other technologies around Docker
  • Switching configuration options later
  • A lot of other scenarios like DB configuration, etc.

This inflexibility is primarily due to the nature of Java EE and application servers.Historically it made sense that the commonly used app servers where maintained by sysadmins and the application just reused the configuration.

Nowadays, times have changed. Kubernetes and Docker are here to stay and even if you use the application server installation approach with classic WAR deployment, chances are high you do not run anything else next to the Dataverse application on it.

In both cases, the configuration should be made simpler. Mangling a domain.xml manually is not an option. Continue to use asadmin is at least error prone due to its nature, but it should still be possible.

Proposed solution

Introduce MicroProfile Config API, which can be used on a lot of application servers, even if you don't take the full "micro" approach. It is inspired and successor to tools like Apache Tamaya and parts of Apache Deltaspike.

Payara 4 contains Config API v1.1, Payara 5 contains Config API 1.3. As we want to go with Payara 5 anyway (see #4172 and kind of #4248), this should be the one to look at.

The database for Java EE app can be configured much easier than via domain.xml since EE 7. See http://dplatz.de/blog/2018/self-contained-jee-app.html for an excellent tutorial. This can be combined with the mentioned Config API. (See also Payara Docs on variables used in annotations and configuration files.)

Things to keep in mind

  • Keep the install script working. Don't blow that up.
  • ...?
@pdurbin
Copy link
Member

pdurbin commented Nov 12, 2018

@poikilotherm it's a holiday today so I'm not in IRC but I wanted to let you know that we got the following answer back from @kenfinnigan (also in Boston, apparently!) at https://gitter.im/eclipse/microprofile-config?at=5be9909c9600d10e649af2ab

"currently MP Config is not part of Jakarta EE, so would not be part of Eclipse Glassfish. There is a new JSR for config to add the equivalent of MP Config to Jakarta EE, but that would be for a future version of the spec"

@poikilotherm
Copy link
Contributor Author

@pdurbin: thanks for sharing! 👍

I'm fine with using Payara as long as it takes to get this inside Eclipse Glassfish :-)

@pameyer
Copy link
Contributor

pameyer commented Dec 10, 2018

Suggestion for an alternative solution - the majority of the asadmin calls that are relevant to configuration are to configure JVM properties. Moving these configuration options to environmental variables would simplify configuration (and avoid the asadmin delete-jvm-option $foo:$bar issue when you don't known $bar but want to delete all $foo options), and is genericly supported by application servers at present.

Other asadmin commands that are not idempotent may be related to glassfish tuning (could be moved to image creation with other images, would not apply directly to other app servers).

Drawbacks of this alternative - possibly less functionality, might need to rename some configuration options that are not valid environmental variable names.

@pdurbin
Copy link
Member

pdurbin commented May 16, 2019

Two days ago @AdamBien recorded a nice video called "MicroProfile and ConfigMaps" that's well worth watching: http://adambien.blog/roller/abien/entry/using_configmaps_to_configure_microprofile

He uses these two repos in the demo:

@poikilotherm
Copy link
Contributor Author

Sounds interesting! Will listen later... But sounds great already... My current construction to map env vars to options is quite clumsy and error prone. :-/

@poikilotherm
Copy link
Contributor Author

@pdurbin I had a look at the demo and recording. What I am missing here: Adam is using a simplistic approach by mapping the ConfigMap values to environment variables.

This is a good start and would make it much easier for my stuff at IQSS/dataverse-kubernetes, but you need to deal with secrets. You can do so with the directory config source in Payara, see https://docs.payara.fish/documentation/microprofile/config.html

It is worth noting that you can use the Microprofile Config API without having to switch to that profile or transition to a microservice. It just is a handy API.

@poikilotherm
Copy link
Contributor Author

This is an old issue. I'm closing this. There is some work going on in this regard, using MPCONFIG. See #7000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants