Enable support for multiple SOLR cores via Docker build arguments. #499
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adding additional cores for development and testing should be easier. The goal here is to make this easier by utilizing docker arguments.
The solr user is also abstracted into an argument for possible arg-based changes, if ever.
The default core is abstracted into
MAIN_CORE
docker build argument, with a default ofsage-discovery
. The additional cores are abstracted intoEXTRA_CORES
docker build argument. This is done primarily because docker has very poor (non-existent) loop and conditional handling. TheCOPY
command needs to be performed in a loop or in conditions but such support is unavailable.This takes the approach of checking if
EXTRA_CORES
is empty and if not loop over space separated core names. TheMAIN_CORE
must be pre-created so that the configuration can be copied. The copying of the configuration in this way avoids needing to useCOPY
and instead uses the systemcp
command.The loops can continue on even in error so
&&
,||
, andexit 1
are used to guarantee that the loop fails on any error.The two chmod commands are merged into a single command.
Example docker build usage:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: