summaryrefslogtreecommitdiffstats
path: root/local-setup/src/main/docker/janusgraph
diff options
context:
space:
mode:
authorkurczews <krzysztof.kurczewski@nokia.com>2019-01-07 07:10:10 +0100
committerkurczews <krzysztof.kurczewski@nokia.com>2019-01-07 07:27:21 +0100
commite64f08ac8242a7db6eb3238ee0ad1a30c8aecf0d (patch)
treed152c7418987fe79260943a6c8b1467d201f69cb /local-setup/src/main/docker/janusgraph
parent57a4c074857c33ba74dcce1ae4818e56ceb6c603 (diff)
Add simplified local setup
Simplify local setup described at: https://wiki.onap.org/display/DW/AAI+Developer+Environment+Setup+-+Casablanca * simplified janus-server setup * simplified haproxy setup * added docker-compose * introduce automatic tests for containers * added run instruction Issue-ID: AAI-2049 Change-Id: I7c033c6a4464f3da94bdf11566060693c0f8b005 Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'local-setup/src/main/docker/janusgraph')
-rw-r--r--local-setup/src/main/docker/janusgraph/Dockerfile37
-rwxr-xr-xlocal-setup/src/main/docker/janusgraph/entrypoint.sh24
2 files changed, 61 insertions, 0 deletions
diff --git a/local-setup/src/main/docker/janusgraph/Dockerfile b/local-setup/src/main/docker/janusgraph/Dockerfile
new file mode 100644
index 0000000..76c3628
--- /dev/null
+++ b/local-setup/src/main/docker/janusgraph/Dockerfile
@@ -0,0 +1,37 @@
+FROM alpine:3.7
+
+WORKDIR app/
+
+RUN apk add --no-cache \
+ bash \
+ openjdk8 \
+ unzip \
+ wget
+
+ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/bin/
+
+ARG JANUS_VERSION=0.2.0
+ARG JANUS_ARTIFACT=janusgraph-${JANUS_VERSION}-hadoop2
+
+RUN wget -q --show-progress --progress=bar:force:noscroll \
+ http://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/${JANUS_ARTIFACT}.zip && \
+ unzip ${JANUS_ARTIFACT}.zip && \
+ rm ${JANUS_ARTIFACT}.zip && \
+ mv ${JANUS_ARTIFACT} janusgraph
+
+# WARN: Instruction above takes long time. Make best effort to insert additional commands below this comment
+
+CMD ["./entrypoint.sh"]
+
+COPY entrypoint.sh .
+
+RUN chmod +x entrypoint.sh
+
+ARG USER=janusz
+ARG GROUP=aai
+
+RUN addgroup ${GROUP} && adduser -D ${USER} ${GROUP} && chown -R ${USER}:${GROUP} .
+
+USER ${USER}:${GROUP}
+
+HEALTHCHECK --interval=40s --timeout=10s --retries=3 CMD janusgraph/bin/janusgraph.sh status \ No newline at end of file
diff --git a/local-setup/src/main/docker/janusgraph/entrypoint.sh b/local-setup/src/main/docker/janusgraph/entrypoint.sh
new file mode 100755
index 0000000..8108866
--- /dev/null
+++ b/local-setup/src/main/docker/janusgraph/entrypoint.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# run short-living command and prevent docker from stopping
+
+JANUS_EXEC="janusgraph/bin/janusgraph.sh"
+
+onStart() {
+ ${JANUS_EXEC} start
+}
+
+onStop() {
+ ${JANUS_EXEC} stop
+}
+
+waitLoop() {
+ tail -f /dev/null &
+ wait $!
+}
+
+trap 'onStop; exit 0' SIGTERM SIGINT
+
+onStart || exit $?
+
+waitLoop \ No newline at end of file