You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/20 12:22:58 UTC
[lucene-solr] branch reference_impl updated: @242 - Work it out.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl by this push:
new c5f6150 @242 - Work it out.
c5f6150 is described below
commit c5f61506917bcffe16c5c0b334be4b720d38e29d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Jul 20 07:22:38 2020 -0500
@242 - Work it out.
---
solr/reference_branch/{ => dev}/Dockerfile | 0
solr/reference_branch/{ => dev}/start-solr.sh | 7 ++--
solr/reference_branch/prod/Dockerfile | 25 ++++++++++++++
solr/reference_branch/prod/start-solr.sh | 10 ++++++
.../src/java/org/apache/solr/SolrTestCaseJ4.java | 4 +--
.../src/resources/logconf/log4j2-fast.xml | 38 ++++++++++++++++++++++
.../org/apache/solr/TestLogLevelAnnotations.java | 2 ++
7 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/solr/reference_branch/Dockerfile b/solr/reference_branch/dev/Dockerfile
similarity index 100%
rename from solr/reference_branch/Dockerfile
rename to solr/reference_branch/dev/Dockerfile
diff --git a/solr/reference_branch/start-solr.sh b/solr/reference_branch/dev/start-solr.sh
similarity index 74%
rename from solr/reference_branch/start-solr.sh
rename to solr/reference_branch/dev/start-solr.sh
index 388c9de..22a4fb07 100644
--- a/solr/reference_branch/start-solr.sh
+++ b/solr/reference_branch/dev/start-solr.sh
@@ -5,13 +5,11 @@ set -x
hostip=$(ip route show | awk '/default/ {print $3}')
echo "host: $hostip"
-if [ ! -d "lucene-solr" ]; then
+if [ ! -d "/opt/solr/reference_impl" ]; then
apt-get -y update
apt-get -y upgrade
apt-get -y install ant
-
-
git clone https://github.com/apache/lucene-solr.git --branch reference_impl --single-branch reference_impl
cd reference_impl
ant ivy-bootstrap
@@ -22,4 +20,5 @@ if [ ! -d "lucene-solr" ]; then
fi
-bash /opt/solr/reference_impl/solr/bin/solr start -c -m 1g -z "localhost:2181" -p ${SOLR_PORT:-9998} -force -f
+bash /opt/solr/reference_impl/solr/bin/solr start -c -m 1g -z "172.19.0.2:2181" -p ${SOLR_PORT:-9998} -force -f
+
diff --git a/solr/reference_branch/prod/Dockerfile b/solr/reference_branch/prod/Dockerfile
new file mode 100644
index 0000000..9925d5f
--- /dev/null
+++ b/solr/reference_branch/prod/Dockerfile
@@ -0,0 +1,25 @@
+FROM openjdk:11
+
+ENV BUILD_DIR=/build/solr
+ENV INSTALL_DIR=/opt/solr
+
+RUN mkdir -p ${INSTALL_DIR}
+
+ADD start-solr.sh /start-solr.sh
+
+RUN chmod +x /start-solr.sh
+
+RUN apt-get -y update; apt-get -y upgrade; apt-get -y install ant
+
+RUN git clone https://github.com/apache/lucene-solr.git --branch reference_impl --single-branch reference_impl; \
+ cd reference_impl;ant ivy-bootstrap;cd solr;ant package -Dversion=9.0.0-miller_ref_impl; \
+ cp package/*miller_ref_impl/ ${INSTALL_DIR}; \
+ chmod +x ${INSTALL_DIR}/reference_impl/solr/bin/solr
+
+WORKDIR ${BUILD_DIR}
+
+ENV PATH=$PATH:/opt/solr/miller_ref_impl/bin
+
+
+#ENTRYPOINT "/bin/bash"
+ENTRYPOINT "/start-solr.sh"
\ No newline at end of file
diff --git a/solr/reference_branch/prod/start-solr.sh b/solr/reference_branch/prod/start-solr.sh
new file mode 100644
index 0000000..7398026
--- /dev/null
+++ b/solr/reference_branch/prod/start-solr.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -x
+
+hostip=$(ip route show | awk '/default/ {print $3}')
+echo "host: $hostip"
+
+
+bash /opt/solr/reference_impl/solr/bin/solr start -c -m 1g -z "172.19.0.2:2181" -p ${SOLR_PORT:-9998} -force -f
+
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index eccc8ac..3c59129 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -335,8 +335,8 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
IpTables.unblockAllPorts();
-// LogLevel.Configurer.restoreLogLevels(savedClassLogLevels);
-// savedClassLogLevels.clear();
+ // LogLevel.Configurer.restoreLogLevels(savedClassLogLevels);
+ // savedClassLogLevels.clear();
// StartupLoggingUtils.changeLogLevel(initialRootLogLevel);
}
}
diff --git a/solr/test-framework/src/resources/logconf/log4j2-fast.xml b/solr/test-framework/src/resources/logconf/log4j2-fast.xml
new file mode 100644
index 0000000..ff752cc
--- /dev/null
+++ b/solr/test-framework/src/resources/logconf/log4j2-fast.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<!-- Configuration for asynchronous logging -->
+<Configuration>
+ <Appenders>
+
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout>
+ <Pattern>
+ %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n
+ </Pattern>
+ </PatternLayout>
+ </Console>
+
+ </Appenders>
+ <Loggers>
+
+
+ <AsyncRoot level="WARN">
+ <AppenderRef ref="STDOUT"/>
+ </AsyncRoot>
+ </Loggers>
+</Configuration>
diff --git a/solr/test-framework/src/test/org/apache/solr/TestLogLevelAnnotations.java b/solr/test-framework/src/test/org/apache/solr/TestLogLevelAnnotations.java
index bc5b943..da3e304 100644
--- a/solr/test-framework/src/test/org/apache/solr/TestLogLevelAnnotations.java
+++ b/solr/test-framework/src/test/org/apache/solr/TestLogLevelAnnotations.java
@@ -113,6 +113,8 @@ public class TestLogLevelAnnotations extends SolrTestCaseJ4 {
assertEquals(DEFAULT_LOG_LEVEL, LogManager.getLogger(bogus_logger_prefix).getLevel());
assertEquals(Level.ERROR, LogManager.getLogger(bogus_logger_prefix + ".ClassLogLevel").getLevel());
assertEquals(Level.WARN, LogManager.getLogger(bogus_logger_prefix + ".MethodLogLevel").getLevel());
+ LogLevel.Configurer.restoreLogLevels(SolrTestCaseJ4.savedClassLogLevels);
+ savedClassLogLevels.clear();
}
public void testClassLogLevels() {