-
Notifications
You must be signed in to change notification settings - Fork 34
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
IBX-522: Introduced Docker image for Solr standalone #214
base: 3.3
Are you sure you want to change the base?
Conversation
RUN sed --in-place '/<updateRequestProcessorChain name="add-unknown-fields-to-the-schema".*/,/<\/updateRequestProcessorChain>/d' server/solr/configsets/_default/conf/solrconfig.xml | ||
RUN sed --in-place 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:20}/' server/solr/configsets/_default/conf/solrconfig.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why and what are those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They come from:
ezplatform-solr-search-engine/bin/generate-solr-config.sh
Lines 121 to 123 in 90c9eb2
# Adapt autoSoftCommit to have a recommended value, and remove add-unknown-fields-to-the-schema | |
sed -i.bak '/<updateRequestProcessorChain name="add-unknown-fields-to-the-schema".*/,/<\/updateRequestProcessorChain>/d' $DESTINATION_DIR/solrconfig.xml | |
sed -i.bak2 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:20}/' $DESTINATION_DIR/solrconfig.xml |
They are the only commands (other than straight up copying configuration files to the service) that are required to mimic the behavior of host-based Solr (created when init_solr.sh
is executed).
From what I understand first disables automatic field registration as schema, and the second makes Solr commit more often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they really needed in a test environment i.e. not a long-running instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they really needed in a test environment i.e. not a long-running instance?
As described by @adamwojs in a personal conversation with me, they are needed because sometimes we test against field being empty in search engine, and this apparently is required for it to work. I didn't dig deeper tbh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they really needed in a test environment i.e. not a long-running instance?
Yes, these config changes are required for test environment.
Please take a look on: |
Looks good, but the solution ultimately different, on a different level. @alongosz provided a
I feel that images and containers are confused with each other, and the Here is an example of a version: '3'
services:
elasticsearch:
image: elasticsearch:7.12.1
ports:
- '127.0.0.1::9200/tcp'
# use --compatibility flag on non-swarm to prevent docker from claiming all resources, especially on startup
deploy:
resources:
limits:
cpus: '1'
memory: 500M
healthcheck:
test: ["CMD", "curl", "http://localhost:9200/_cluster/health"]
interval: 10s
timeout: 5s
retries: 10
environment:
discovery.type: single-node
elasticsearch-index:
depends_on:
- elasticsearch
build: ./docker/elasticsearch-index
command:
- "elasticsearch:9200"
- "--strict"
- '--timeout=0'
- "--"
- "curl"
- "-X"
- "PUT"
- "-H"
- "Content-Type: application/json"
- "-d"
- "@./es-index-template.json"
- "http://elasticsearch:9200/_template/repository"
solr:
image: ghcr.io/ibexa/product-catalog/solr:latest
healthcheck:
test: [ "CMD", "solr", "status" ]
interval: 10s
timeout: 5s
retries: 10
ports:
- '127.0.0.1::8983/tcp' Note that:
|
Configuration file duplication can be avoided by using project directory as docker build -f docker/solr/Dockerfile . EDIT: Well, it almost works... When copying in the most recent version there seems to be an issue with
|
Kudos, SonarCloud Quality Gate passed! |
v4.0
,v3.3
Note: Target version is irrelevant. It's a docker image for use in CI / local dev.
Note: (:exclamation:) Most of the configuration files are actually copies of existing files (:exclamation:), that are present in
lib
. They have been copied to reduce the Docker context that is copied into Docker engine when doing the build.❗ Warning ❗
Current version of this PR builds an invalid image. Somehow files copied during build time from the extended context differ from the ones that were present when they were copied into
docker/solr
directory.One file has been renamed:
schema.xml
->managed-schema
, as that's the file that is actually loaded in the Solr docker image, apparently.schema.xml
had no effect if left as is.