You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by fg...@apache.org on 2019/01/12 01:18:57 UTC

[incubator-sdap-nexus] 01/04: Now using INIT_SOLR_HOME="yes" option for creating the nexustiles core in singlenode.

This is an automated email from the ASF dual-hosted git repository.

fgreg pushed a commit to branch SDAP-166
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git

commit 49d94ef47df568f5c378303563dbf19d5e49ee34
Author: Frank Greguska <fr...@jpl.nasa.gov>
AuthorDate: Wed Nov 14 15:33:00 2018 -0800

    Now using INIT_SOLR_HOME="yes" option for creating the nexustiles core in singlenode.
---
 README.md                                          |  4 +-
 docker/README.md                                   |  1 -
 docker/Readme.rst                                  |  1 +
 docker/solr-single-node/README.md                  | 10 -----
 docker/solr/Dockerfile                             | 17 ++++----
 docker/solr/README.md                              |  0
 docker/solr/Readme.rst                             | 46 ++++++++++++++++++++++
 .../singlenode}/Dockerfile                         | 14 +++----
 docker/solr/singlenode/Readme.rst                  | 40 +++++++++++++++++++
 .../singlenode}/create-core.sh                     |  0
 docs/conf.py                                       |  7 ++--
 docs/dockerimages.rst                              | 10 +++++
 docs/index.rst                                     |  5 +++
 docs/intro.rst                                     |  3 ++
 14 files changed, 125 insertions(+), 33 deletions(-)

diff --git a/README.md b/README.md
index 88d1aae..e5499d2 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,9 @@ The next generation cloud-based science data service platform. More information
 
 ## Building the Docs
 
-Ensure sphinx and sphinx-autobuild are installed
+Ensure sphinx, sphinx-autobuild, and recommonmark are installed. We use the recommonmark module for parsing Markdown files.
 
-    pip install sphinx sphinx-autobuild
+    pip install sphinx sphinx-autobuild recommonmark
 
 Run sphinx-autobuild to view the docs locally.
 
diff --git a/docker/README.md b/docker/README.md
deleted file mode 100644
index b80ece9..0000000
--- a/docker/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# NEXUS Docker
\ No newline at end of file
diff --git a/docker/Readme.rst b/docker/Readme.rst
new file mode 100644
index 0000000..a305620
--- /dev/null
+++ b/docker/Readme.rst
@@ -0,0 +1 @@
+# NEXUS Docker
diff --git a/docker/solr-single-node/README.md b/docker/solr-single-node/README.md
deleted file mode 100644
index 97043a4..0000000
--- a/docker/solr-single-node/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-This Docker container runs Apache Solr v7.4 as a single node with nexustiles collection.
-
-The easiest way to run it is:
-
-    export SOLR_HOME=/opt/solr/server/solr/
-    docker run -it --name solr -e SOLR_HOME=${SOLR_HOME}-v /home/nexus/solr/data:${SOLR_HOME}/nexustiles sdap/solr-singlenode:${VERSION}
-
-/home/nexus/solr/data is directory on host machine where index files will be written to.
diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile
index caad8bb..fb4a8f0 100644
--- a/docker/solr/Dockerfile
+++ b/docker/solr/Dockerfile
@@ -17,18 +17,21 @@ MAINTAINER Apache SDAP "dev@sdap.apache.org"
 
 USER root
 
-ENV SOLR_HOME=/opt/solr/server/solr
+ENV SOLR_HOME="/usr/local/solrhome"
 
-RUN cd / && \
+WORKDIR /
+RUN set -e; \
+    rm -rf /opt/solr/server/solr/mycores && \
     apt-get update && \
     apt-get -y install git sudo && \
     rm -rf /var/lib/apt/lists/* && \
     git clone https://github.com/apache/incubator-sdap-nexus.git && \
-    cp -r /incubator-sdap-nexus/data-access/config/schemas/solr/nexustiles /tmp/nexustiles && \
+    cp -r /incubator-sdap-nexus/data-access/config/schemas/solr/nexustiles /opt/solr/server/solr/nexustiles && \
     rm -rf /incubator-sdap-nexus && \
-    wget http://central.maven.org/maven2/org/locationtech/jts/jts-core/1.15.0/jts-core-1.15.0.jar && \
-    cp jts-core-1.15.0.jar /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.0.jar && \
-    chown ${SOLR_USER}:${SOLR_GROUP} /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.0.jar && \
-    rm jts-core-1.15.0.jar
+    wget http://central.maven.org/maven2/org/locationtech/jts/jts-core/1.15.1/jts-core-1.15.1.jar && \
+    cp jts-core-1.15.1.jar /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.1.jar && \
+    chown ${SOLR_USER}:${SOLR_GROUP} /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/jts-core-1.15.1.jar && \
+    rm jts-core-1.15.1.jar
 
+WORKDIR /opt/solr
 USER ${SOLR_USER}
diff --git a/docker/solr/README.md b/docker/solr/README.md
deleted file mode 100644
index e69de29..0000000
diff --git a/docker/solr/Readme.rst b/docker/solr/Readme.rst
new file mode 100644
index 0000000..bb88630
--- /dev/null
+++ b/docker/solr/Readme.rst
@@ -0,0 +1,46 @@
+Solr Images
+=====================
+
+All docker builds for the Solr images should happen from this directory. For copy/paste ability, first export the environment variable `BUILD_VERSION` to the version number you would like to tag images as.
+
+Environment Variables
+---------------------
+
+Any environment variable that can be passed to `solr.in.sh <https://github.com/apache/lucene-solr/blob/95d01c6583b825b6b87591e4f27002c285ea25fb/solr/bin/solr.in.sh>`_ and be passed as an environment variable to the docker container and it will be utilized. A few options are called out here:
+
+SOLR_HEAP
+^^^^^^^^^
+
+Increase Java Heap as needed to support your indexing / query needs. Example:
+
+.. code-block:: bash
+
+    SOLR_HEAP="512m"
+
+SOLR_HOME
+^^^^^^^^^
+
+Path to a directory for Solr to store cores and their data. This image by default sets this environment variable to `/usr/local/solrhome` and exposes that directory as a `VOLUME` that can be mounted. You can change this to anything you want to change the location of the configuration/cores/data within the docker container, but it is recommended to simply leave it at the default.
+
+In either case (leave as default or change to custom location) if you want to mount the SOLR_HOME directory to a directory on the host machine, you need to provide the container path to the docker run `-v` option. Doing this allows you to retain the index between start/stop of this container.
+
+sdap/solr
+---------
+
+This is the base image used by both singlenode and cloud versions of the Solr image.
+
+How To Build
+^^^^^^^^^^^^
+
+This image can be built by:
+
+.. code-block:: bash
+
+    docker build -t sdap/solr:${BUILD_VERSION} .
+
+How to Run
+^^^^^^^^^^
+
+This image is not intended to be run directly
+
+.. include:: ../docker/solr/singlenode/Readme.rst
diff --git a/docker/solr-single-node/Dockerfile b/docker/solr/singlenode/Dockerfile
similarity index 68%
rename from docker/solr-single-node/Dockerfile
rename to docker/solr/singlenode/Dockerfile
index 87d4c9a..e514e8b 100644
--- a/docker/solr-single-node/Dockerfile
+++ b/docker/solr/singlenode/Dockerfile
@@ -17,13 +17,9 @@ ARG tag_version=latest
 FROM sdap/solr:${tag_version}
 MAINTAINER Apache SDAP "dev@sdap.apache.org"
 
-USER root
+WORKDIR /opt/solr
+VOLUME ${SOLR_HOME}
+ENV INIT_SOLR_HOME="yes"
 
-COPY create-core.sh /docker-entrypoint-initdb.d/create-core.sh
-RUN echo "${SOLR_USER} ALL=(ALL) NOPASSWD: /usr/bin/cp -r /tmp/nexustiles/* ${SOLR_HOME}/nexustiles/" >> /etc/sudoers && \
-  echo "${SOLR_USER} ALL=(ALL) NOPASSWD: /usr/bin/chown -R ${SOLR_USER}\:${SOLR_GROUP} ${SOLR_HOME}/nexustiles" >> /etc/sudoers
-
-USER ${SOLR_USER}
-VOLUME ${SOLR_HOME}/nexustiles
-
-ENTRYPOINT ["solr-foreground"]
+ENTRYPOINT ["docker-entrypoint.sh"]
+CMD ["solr-foreground"]
diff --git a/docker/solr/singlenode/Readme.rst b/docker/solr/singlenode/Readme.rst
new file mode 100644
index 0000000..e47317d
--- /dev/null
+++ b/docker/solr/singlenode/Readme.rst
@@ -0,0 +1,40 @@
+sdap/solr-singlenode
+--------------------
+
+This is the singlenode version of Solr.
+
+How To Build
+^^^^^^^^^^^^
+
+This image can be built from the incubator/sdap/solr directory:
+
+.. code-block:: bash
+
+    docker build -t sdap/solr-singlenode:${BUILD_VERSION} -f singlenode/Dockerfile --build-arg tag_version=${BUILD_VERSION} .
+
+How to Run
+^^^^^^^^^^
+
+This Docker container runs Apache Solr v7.4 as a single node with the nexustiles collection. The main decision when running this image is wether or not you want data to persist when the container is stopped or if the data should be discarded.
+
+Persist Data
+""""""""""""
+
+To persist the data, we need to provide a volume mount from the host machine to the container path where `SOLR_HOME` is. If you do not provide a custom `SOLR_HOME` location, the default is `/usr/local/solrhome`. Therefore, the easiest way to run this image and persist data to a location on the host machine is:
+
+.. code-block:: bash
+
+    docker run --name solr -v ${PWD}/solrhome:/usr/local/solrhome -p 8083:8083 -d sdap/solr-singlenode:${VERSION}
+
+${PWD}/solrhome is the directory on host machine where `SOLR_HOME` will be created if it does not already exist. If you have run this container before and ${PWD}/solrhome already contains files, those files will not be overwritten and will be used.
+
+Don't Persist Data
+""""""""""""""""""
+
+If you do not need to persist data between runs of this image, just simply run the image without a volume mount.
+
+.. code-block:: bash
+
+    docker run --name solr -p 8083:8083 -d sdap/solr-singlenode:${VERSION}
+
+When the container is removed, the data will be lost.
diff --git a/docker/solr-single-node/create-core.sh b/docker/solr/singlenode/create-core.sh
similarity index 100%
rename from docker/solr-single-node/create-core.sh
rename to docker/solr/singlenode/create-core.sh
diff --git a/docs/conf.py b/docs/conf.py
index 8cca529..d6ac58c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -16,7 +16,6 @@
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
-
 # -- Project information -----------------------------------------------------
 
 project = u'incubator-sdap-nexus'
@@ -24,9 +23,9 @@ copyright = u'2018, Apache SDAP'
 author = u'Apache SDAP'
 
 # The short X.Y version
-version = u''
+version = u'1.0'
 # The full version, including alpha/beta/rc tags
-release = u''
+release = u'1.0.0-SNAPSHOT'
 
 
 # -- General configuration ---------------------------------------------------
@@ -52,7 +51,7 @@ templates_path = ['_templates']
 # You can specify multiple suffix as a list of string:
 #
 # source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
+source_suffix = ['.rst']
 
 # The master toctree document.
 master_doc = 'index'
diff --git a/docs/dockerimages.rst b/docs/dockerimages.rst
new file mode 100644
index 0000000..558f558
--- /dev/null
+++ b/docs/dockerimages.rst
@@ -0,0 +1,10 @@
+.. _dockerimages:
+
+*************
+Docker Images
+*************
+
+incubator-sdap-nexus contains a number of different Docker images for download. All images are available from the `SDAP organization <https://hub.docker.com/u/sdap>`_ on DockerHub.
+
+
+.. include:: ../docker/solr/Readme.rst
diff --git a/docs/index.rst b/docs/index.rst
index 5666094..0db88d4 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,6 +1,10 @@
 Welcome to incubator-sdap-nexus's documentation!
 ================================================
 
+.. warning::
+
+  Apache incubator-sdap-nexus is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the name of Apache TLP sponsor. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does  [...]
+
 .. toctree::
    :maxdepth: 2
    :caption: Contents:
@@ -8,6 +12,7 @@ Welcome to incubator-sdap-nexus's documentation!
    intro
    quickstart
    ningester
+   dockerimages
 
 
 Check out the :ref:`quickstart`.
diff --git a/docs/intro.rst b/docs/intro.rst
index 6914726..5ebe701 100644
--- a/docs/intro.rst
+++ b/docs/intro.rst
@@ -1,5 +1,8 @@
 .. _intro:
 
+.. warning::
+
+  Apache incubator-sdap-nexus is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the name of Apache TLP sponsor. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does  [...]
 
 *******************
 About NEXUS