You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2021/01/27 17:33:30 UTC
[lucene-solr] 07/10: SOLR-15001 Docker: require init_var_solr.sh
(#2083)
This is an automated email from the ASF dual-hosted git repository.
houston pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 70c21f066efca4239ef64ddefa52438e2caad6d0
Author: David Smiley <ds...@apache.org>
AuthorDate: Fri Nov 27 14:59:54 2020 -0500
SOLR-15001 Docker: require init_var_solr.sh (#2083)
The Dockerfile should not initialize /var/solr's contents because this is confusing and redundant with init_var_solr.sh.
No need for init_var_solr.sh to echo what it does; VERBOSE can be used to accomplish that.
Separate CHANGES.md for Docker and contrib modules.
---
dev-tools/scripts/addVersion.py | 1 +
solr/CHANGES.txt | 7 ++++++
solr/docker/CHANGES.md | 28 ++++++++++++++++++++++
solr/docker/Dockerfile | 6 +----
solr/docker/include/scripts/docker-entrypoint.sh | 3 +++
solr/docker/include/scripts/init-var-solr | 16 ++++++-------
solr/docker/include/scripts/solr-create | 3 ---
solr/docker/include/scripts/solr-foreground | 3 ---
solr/docker/include/scripts/solr-precreate | 3 ---
.../cases/empty-varsolr-vol-solr-nocopy/test.sh | 1 +
10 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 9fb9182..a520140 100755
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -199,6 +199,7 @@ def parse_properties_file(filename):
def get_solr_init_changes():
return dedent('''
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
+ Docker and contrib modules have separate CHANGES.md files.
''')
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f09e496..3f8f7a4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -7,6 +7,7 @@ https://github.com/apache/lucene-solr/blob/master/solr/solr-ref-guide/src/solr-u
================== 9.0.0 ==================
Consult the lucene/CHANGES.txt file for additional, low level, changes in this release.
+Docker and contrib modules have separate CHANGES.md files.
New Features
---------------------
@@ -136,6 +137,9 @@ Other Changes
* SOLR-14957: Add Prometheus Exporter to docker PATH. Fix classpath issues. (Houston Putman)
+* SOLR-14944: Remove the "spins" metrics - support for detection of spinning disks has been
+ removed in LUCENE-9576. (ab)
+
* SOLR-14912: Clean up solr-extraction contrib to produce solr-extraction-* jar
(instead of solr-cell-*). (Dawid Weiss)
@@ -143,6 +147,9 @@ Other Changes
* SOLR-14949: Ability to customize docker image name/base image (Houston Putman)
+* SOLR-14035: Remove deprecated preferLocalShards=true support in favour of the shards.preference=replica.location:local alternative.
+ (Alex Bulygin via Christine Poerschke)
+
Bug Fixes
---------------------
* SOLR-14546: Fix for a relatively hard to hit issue in OverseerTaskProcessor that could lead to out of order execution
diff --git a/solr/docker/CHANGES.md b/solr/docker/CHANGES.md
new file mode 100644
index 0000000..04a767c
--- /dev/null
+++ b/solr/docker/CHANGES.md
@@ -0,0 +1,28 @@
+This file lists release notes for this module.
+Prior to version 9, the module existed in another repository and changes were not tracked in this manner.
+You could browse the commit history here instead:
+https://github.com/docker-solr/docker-solr
+
+9.0.0
+==================
+
+Improvements
+----------------------
+* SOLR-14001: Removed /var/solr initialization from the Dockerfile; depend on init_var_solr.sh instead.
+ This leads to more consistent behavior no matter how /var/solr is mounted.
+ * init_var_solr.sh is now invoked by docker-entrypoint.sh; not in a bunch of other places.
+ * as before, you can set NO_INIT_VAR_SOLR=1 to short-circuit this.
+ * init_var_solr.sh no longer echo's anything. For verbosity, set VERBOSE=yes.
+ (David Smiley)
+
+* SOLR-14957: Add Prometheus Exporter to docker PATH. Fix classpath issues.
+ (Houston Putman)
+
+* SOLR-14949: Ability to customize the FROM image when building.
+ (Houston Putman)
+
+Other Changes
+------------------
+* SOLR-14789: Migrate docker image creation from docker-solr repo to solr/docker.
+ (Houston Putman, Martijn Koster, Tim Potter, David Smiley, janhoy, Mike Drob)
+
diff --git a/solr/docker/Dockerfile b/solr/docker/Dockerfile
index aef0800..0e7157e 100644
--- a/solr/docker/Dockerfile
+++ b/solr/docker/Dockerfile
@@ -56,11 +56,7 @@ RUN set -ex; \
mv /opt/solr/bin/solr.in.cmd /opt/solr/bin/solr.in.cmd.orig; \
chown root:0 /etc/default/solr.in.sh; \
chmod 0664 /etc/default/solr.in.sh; \
- mkdir -p /var/solr/data /var/solr/logs; \
- (cd /opt/solr/server/solr; cp solr.xml zoo.cfg /var/solr/data/); \
- cp /opt/solr/server/resources/log4j2.xml /var/solr/log4j2.xml; \
- find /var/solr -type d -print0 | xargs -0 chmod 0770; \
- find /var/solr -type f -print0 | xargs -0 chmod 0660; \
+ mkdir -p -m0770 /var/solr; \
sed -i -e "s/\"\$(whoami)\" == \"root\"/\$(id -u) == 0/" /opt/solr/bin/solr; \
sed -i -e 's/lsof -PniTCP:/lsof -t -PniTCP:/' /opt/solr/bin/solr; \
chown -R "0:0" /opt/solr-$SOLR_VERSION /docker-entrypoint-initdb.d /opt/docker-solr; \
diff --git a/solr/docker/include/scripts/docker-entrypoint.sh b/solr/docker/include/scripts/docker-entrypoint.sh
index 38e7c1c..69738a9 100755
--- a/solr/docker/include/scripts/docker-entrypoint.sh
+++ b/solr/docker/include/scripts/docker-entrypoint.sh
@@ -17,6 +17,9 @@ if ! [[ ${SOLR_PORT:-} =~ ^[0-9]+$ ]]; then
export SOLR_PORT
fi
+# Essential for running Solr
+/opt/docker-solr/scripts/init-var-solr
+
# when invoked with e.g.: docker run solr -help
if [ "${1:0:1}" == '-' ]; then
set -- solr-foreground "$@"
diff --git a/solr/docker/include/scripts/init-var-solr b/solr/docker/include/scripts/init-var-solr
index 8a29de1..d1d6325 100755
--- a/solr/docker/include/scripts/init-var-solr
+++ b/solr/docker/include/scripts/init-var-solr
@@ -31,31 +31,29 @@ function check_dir_writability {
}
if [ ! -d "$DIR/data" ]; then
- echo "Creating $DIR/data"
+ #echo "Creating $DIR/data"
check_dir_writability "$DIR"
- mkdir "$DIR/data"
- chmod 0770 "$DIR/data"
+ mkdir -m0770 "$DIR/data"
fi
if [ ! -d "$DIR/logs" ]; then
- echo "Creating $DIR/logs"
+ #echo "Creating $DIR/logs"
check_dir_writability "$DIR"
- mkdir "$DIR/logs"
- chmod 0770 "$DIR/logs"
+ mkdir -m0770 "$DIR/logs"
fi
if [ ! -f "$DIR/data/solr.xml" ]; then
- echo "Copying solr.xml"
+ #echo "Copying solr.xml"
cp -a /opt/solr/server/solr/solr.xml "$DIR/data/solr.xml"
fi
if [ ! -f "$DIR/data/zoo.cfg" ]; then
- echo "Copying zoo.cfg"
+ #echo "Copying zoo.cfg"
cp -a /opt/solr/server/solr/zoo.cfg "$DIR/data/zoo.cfg"
fi
if [ ! -f "$DIR/log4j2.xml" ]; then
- echo "Copying log4j2.xml"
+ #echo "Copying log4j2.xml"
cp -a /opt/solr/server/resources/log4j2.xml "$DIR/log4j2.xml"
fi
diff --git a/solr/docker/include/scripts/solr-create b/solr/docker/include/scripts/solr-create
index e2054a1..d523ce6 100755
--- a/solr/docker/include/scripts/solr-create
+++ b/solr/docker/include/scripts/solr-create
@@ -15,9 +15,6 @@ if [[ "${VERBOSE:-}" == "yes" ]]; then
set -x
fi
-# init script for handling an empty /var/solr
-/opt/docker-solr/scripts/init-var-solr
-
. /opt/docker-solr/scripts/run-initdb
# solr uses "-c corename". Parse the arguments to determine the core name.
diff --git a/solr/docker/include/scripts/solr-foreground b/solr/docker/include/scripts/solr-foreground
index 336104b..aa9fa68 100755
--- a/solr/docker/include/scripts/solr-foreground
+++ b/solr/docker/include/scripts/solr-foreground
@@ -7,9 +7,6 @@ if [[ "$VERBOSE" == "yes" ]]; then
set -x
fi
-# init script for handling an empty /var/solr
-/opt/docker-solr/scripts/init-var-solr
-
. /opt/docker-solr/scripts/run-initdb
exec solr-fg "$@"
diff --git a/solr/docker/include/scripts/solr-precreate b/solr/docker/include/scripts/solr-precreate
index 5248203..91d0a3d 100755
--- a/solr/docker/include/scripts/solr-precreate
+++ b/solr/docker/include/scripts/solr-precreate
@@ -17,9 +17,6 @@ if [[ "${VERBOSE:-}" == "yes" ]]; then
set -x
fi
-# init script for handling an empty /var/solr
-/opt/docker-solr/scripts/init-var-solr
-
. /opt/docker-solr/scripts/run-initdb
/opt/docker-solr/scripts/precreate-core "$@"
diff --git a/solr/docker/tests/cases/empty-varsolr-vol-solr-nocopy/test.sh b/solr/docker/tests/cases/empty-varsolr-vol-solr-nocopy/test.sh
index eaa39ac..0b3bc2f 100755
--- a/solr/docker/tests/cases/empty-varsolr-vol-solr-nocopy/test.sh
+++ b/solr/docker/tests/cases/empty-varsolr-vol-solr-nocopy/test.sh
@@ -17,6 +17,7 @@ docker volume create "$myvarsolr"
docker run \
-v "$myvarsolr:/var/solr:nocopy" \
--rm \
+ -e NO_INIT_VAR_SOLR=yes \
-u "0:0" \
"$tag" bash -c "chown 8983:8983 /var/solr"