forked from saalfeldlab/render
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use serverProperties API to pull view defaults from server rather tha…
…n rely upon query parameters (from configured/hacked root context)
- Loading branch information
Showing
5 changed files
with
92 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
# ====================================================================================== | ||
# Stage 0: builder | ||
# Stage 0: build_environment | ||
# | ||
# Install library dependencies before actually building source. | ||
# This caches libraries into an image layer that can be reused when only source code has changed. | ||
|
||
FROM openjdk:8-jdk as builder | ||
FROM openjdk:8-jdk as build_environment | ||
LABEL maintainer="Forrest Collman <[email protected]>, Eric Trautman <[email protected]>" | ||
|
||
RUN apt-get update && apt-get install -y maven | ||
|
||
# --------------------------------- | ||
# Install library dependencies before actually building source. | ||
# This caches libraries into an image layer that can be reused when only source code has changed. | ||
|
||
WORKDIR /var/www/render/ | ||
COPY pom.xml . | ||
COPY docs/pom.xml render-app/pom.xml | ||
COPY render-app/pom.xml render-app/pom.xml | ||
COPY render-ws/pom.xml render-ws/pom.xml | ||
COPY render-ws-java-client/pom.xml render-ws-java-client/pom.xml | ||
COPY render-ws-spark-client/pom.xml render-ws-spark-client/pom.xml | ||
COPY render-app/pom.xml render-app/pom.xml | ||
COPY trakem2-scripts/pom.xml trakem2-scripts/pom.xml | ||
COPY docs/pom.xml docs/pom.xml | ||
|
||
# use -T 1C option to multi-thread maven, using 1 thread per available core | ||
RUN mvn -T 1C verify clean --fail-never | ||
|
||
# --------------------------------- | ||
# ====================================================================================== | ||
# Stage 1: builder | ||
# | ||
# Build the source code, save resulting jar and war files, and remove everything else | ||
|
||
FROM build_environment as builder | ||
|
||
COPY . /var/www/render/ | ||
RUN mvn clean | ||
|
||
# use -T 1C maven option to multi-thread process | ||
# use -T 1C option to multi-thread maven, using 1 thread per available core | ||
RUN mvn -T 1C -Dproject.build.sourceEncoding=UTF-8 package && \ | ||
mkdir -p /root/render-lib && \ | ||
mv */target/*.*ar /root/render-lib && \ | ||
|
@@ -38,7 +44,9 @@ RUN mvn -T 1C -Dproject.build.sourceEncoding=UTF-8 package && \ | |
rm -rf /root/.embedmongo | ||
|
||
# ====================================================================================== | ||
# Stage 1: render-ws | ||
# Stage 2: render-ws | ||
# | ||
# Once web service application is built, set up jetty server and deploy application to it. | ||
|
||
# NOTE: jetty version should be kept in sync with values in render/render-ws/pom.xml and render/render-ws/src/main/scripts/install.sh | ||
FROM jetty:9.4.6-jre8-alpine as render-ws | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,63 +158,4 @@ sed -i """ | |
[email protected]=.*@view.renderStackProject=${VIEW_RENDER_STACK_PROJECT}@ | ||
[email protected]=.*@webService.maxTileSpecsToRender=${WEB_SERVICE_MAX_TILE_SPECS_TO_RENDER}@ | ||
[email protected]=.*@webService.maxImageProcessorCacheGb=${WEB_SERVICE_MAX_IMAGE_PROCESSOR_GB}@ | ||
""" "${JETTY_BASE}/resources/render-server.properties" | ||
|
||
# -------------------------------------------------------------- | ||
# Default view query parameters | ||
|
||
appendParameter() { | ||
local PARAMETERS="$1" | ||
local KEY="$2" | ||
local VALUE="$3" | ||
if [ -n "${PARAMETERS}" ]; then | ||
PARAMETERS="${PARAMETERS}\&${KEY}=${VALUE}" | ||
else | ||
PARAMETERS="?${KEY}=${VALUE}" | ||
fi | ||
echo "${PARAMETERS}" | ||
} | ||
|
||
unset VIEW_PARAMETERS | ||
|
||
# NOTE: NDVIZ_URL has already been aggregated from host and port above if necessary | ||
if [ -n "${NDVIZ_URL}" ]; then | ||
VIEW_PARAMETERS="?ndvizHost=${NDVIZ_URL}" | ||
fi | ||
|
||
if [ -n "${VIEW_CATMAID_HOST_AND_PORT}" ]; then | ||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" catmaidHost "${VIEW_CATMAID_HOST_AND_PORT}") | ||
fi | ||
|
||
if [ -n "${VIEW_DYNAMIC_RENDER_HOST_AND_PORT}" ]; then | ||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" dynamicRenderHost "${VIEW_DYNAMIC_RENDER_HOST_AND_PORT}") | ||
fi | ||
|
||
if [ -n "${VIEW_RENDER_STACK_OWNER}" ]; then | ||
|
||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" renderStackOwner "${VIEW_RENDER_STACK_OWNER}") | ||
|
||
if [ -n "${VIEW_RENDER_STACK_PROJECT}" ]; then | ||
|
||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" renderStackProject "${VIEW_RENDER_STACK_PROJECT}") | ||
|
||
if [ -n "${VIEW_RENDER_STACK}" ]; then | ||
|
||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" renderStack "${VIEW_RENDER_STACK}") | ||
|
||
fi | ||
fi | ||
fi | ||
|
||
if [ -n "${VIEW_MATCH_OWNER}" ]; then | ||
|
||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" matchOwner "${VIEW_MATCH_OWNER}") | ||
|
||
if [ -n "${VIEW_MATCH_COLLECTION}" ]; then | ||
|
||
VIEW_PARAMETERS=$(appendParameter "${VIEW_PARAMETERS}" matchCollection "${VIEW_MATCH_COLLECTION}") | ||
|
||
fi | ||
fi | ||
|
||
sed -i "s@render-ws/view/index.html@render-ws/view/index.html${VIEW_PARAMETERS}@" "${JETTY_BASE}/etc/jetty-rewrite.xml" | ||
""" "${JETTY_BASE}/resources/render-server.properties" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters