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 a sysadmin I want to use MicroProfile Config API to configure my installation #7000

Open
poikilotherm opened this issue Jun 18, 2020 · 1 comment
Assignees
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: Admin Guide Type: Feature a feature request User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh

Comments

@poikilotherm
Copy link
Contributor

poikilotherm commented Jun 18, 2020

Now that Payara 5 is actually happening with the release of Dataverse 5 (thank you so much folks!!!), we should re-raise the topic (formerly #5187) of starting to use some of the goodies coming along with this.

As a system admin pushing to cloud, I would greatly benefit from having the possibility to get configuration inside my instance not via mangling with JVM options and database settings. Instead, I would like to see this being more flexible and combined with a hierarchy.

This will also benefit greatly any classic installation, as configuration will be easier than dealing with domain.xml and friends.

Introduce MicroProfile Config API and its support in Payara 5 for code variables and configuration variables, combining 1 & 2.

This will open up the following work items:

  • Replace all the System.getProperty().
  • Look for the database settings and how to replace them
  • Make all of this backward compatible
  • Do solid configuration validation
  • Look into replacing installers/container scripts configuration of JDBC, JMS, etc with annotations, which are then configured via Config API

Things going on:

@poikilotherm poikilotherm added Feature: Admin Guide Component: Code Infrastructure formerly "Feature: Code Infrastructure" Type: Feature a feature request User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh labels Jun 18, 2020
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 18, 2020
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 18, 2020
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 1, 2020
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 4, 2020
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 4, 2020
…ency to enable unit and integration testing without deployments. IQSS#7000
@poikilotherm poikilotherm self-assigned this Jun 24, 2021
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 20, 2022
The microbean implementation of MicroProfile Config
has not been updated to MPCONFIG 2.0. Switching to
the smallrye implementation for testing scope.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 20, 2022
To be able to have more control over JVM settings names,
avoid typos, maybe create lists of settings and so on,
this enum will provide the place to add any old and new
settings that are destined to be made at the JVM level.

Further extensions of this class include adding aliases
when renaming settings, adding predicates for validation
and offering injecting parameters into keys (as used with
the files subsystem).
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 20, 2022
To provide built-time static settings, property files
under src/main/resources are now filtered by maven to
replace any variables ${propertyname} known by Maven
with their values before storing the file under /target.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 20, 2022
To simplify SystemConfig.getVersion, the MicroProfile Config
property dataverse.version is set to the Maven project version
via filtering the variable.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 20, 2022
Instead of trying to read a built time file from Maven,
use MicroProfile Config to retrieve the version and build number.

The version is by default set via microprofile-config.properties
(or overridden by an env var in a container).

The build number is still read from either BuildNumber.properties
or, if not present, from MicroProfile Config, defaulting to empty.

This also avoids copying extra files into containers to retrieve
the version string.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 21, 2022
…#7000

By refactoring SystemConfig.getSolrHostColonPort, the Solr endpoint
is not just configurable via a database setting, but also by all
mechanisms of MicroProfile Config.

- The database setting still has priority over the other mechanisms.
- It's completely backward compatible, no config change necessary.
- Tests have been added to ensure the behaviour
- Default ("localhost:8983") for no setting given is now also done via MPCONFIG
- Default for container usage ("solr:8983") possible via MPCONFIG profile "ct"
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 21, 2022
Describe the new options to set the Solr endpoint, crosslinking
the old way and adding hints about MPCONFIG profiles.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 22, 2022
Retrieving a setting as a simple String is a very often
use case within the codebase. To make these lookups easier
to write and comprehend, adding convenience methods here.

These are simple wrappers around the MicroProfile Config lookup.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 22, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 22, 2022
… MPCONFIG IQSS#7000

- Adding dataverse.files.directory equivalent to JvmSettings
- Remove all System.getPropert("dataverse.files.directory") or similar
- Add default with /tmp/dataverse via microprofile-config.properties as formerly seen at FileUtil and Dataset only
- Refactor SwordConfigurationImpl to reuse the NoSuchElementException thrown by MPCONFIG
- Refactor GoogleCloudSubmitToArchiveCommand to use the JvmSettings.lookup and create file stream in try-with-resources
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 23, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Jun 23, 2022
- When renaming older JVM settings, these should be still retrievable from an old config
- The AliasConfigSource now takes aliased settings from JvmSettings for this
- This is just for pure renaming but could be further extended with data manipulation.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
This commit introduces support for patterned settings, containing
placeholders within names. These patterns allow to read object like
structures from MicroProfile Config Sources, while offering
control over where and how these variable arguments are inserted.

It is also possible to create aliases with these placeholders,
as the AliasConfigSource has support for this included.

Lookups and building old aliases are now checked operations,
avoiding wrong usage.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
…ion IQSS#7000

As of this commit, tests can use the extension together with patterned setting
names by providing the necessary arguments within the annotation.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
Adding the most basic test to ensure the most basic functionality works.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
…7000

To ease lookup when target variable is a String, the convenient lookup()
and lookupOptional() have been added for placeholder-type settings,
too.

Adds JavaDocs for all the varargs lookup functions, too, easing usage in code.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
…QSS#7000

The pattern did not check for the required $ sign after the positional index.
Fixing that here.
poikilotherm pushed a commit to poikilotherm/dataverse that referenced this issue Sep 20, 2022
Emphasize that the change is for devs for now. The idea is to migrate
settings to the new framework over time.
@mreekie mreekie added the bk2211 label Nov 1, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 6, 2022
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Dec 16, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 19, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 19, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 20, 2022
As we are now using JvmSettings everywhere as an abstraction above
MPCONFIG, no need to import on our own.
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 21, 2022
…SS#7000

When an invalid port was set, which cannot be transformed to an integer,
the JSF page would kind of freeze: it leaves the user on the grayed out
"action" screen and if you click on it, shows upload page with no files,
so a silent error.

By defaulting to 6311 also for this case and logging an error, this
should improve the UX, but leave a hint for an admin in the logs.
@mreekie mreekie removed the bk2211 label Jan 11, 2023
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Mar 1, 2023
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Mar 1, 2023
To enable the AliasConfigSource to provide settings that also have a
representation in a microprofile-config.properties file, it needs to have
at least the same ordinal as that source. Thus the ordinal shall not be
minimum integer, but 100. As the name is "Alias", it will likely to be
used first when other sources are present with this ordinal (like that
properties source).
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Mar 1, 2023
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Mar 31, 2023
This adds the missing MPCONFIG option to configure
the base URL for the permalink provider, which has been
added after the initial work for providers happened.
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Mar 31, 2023
pdurbin added a commit to poikilotherm/dataverse that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: Admin Guide Type: Feature a feature request User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants