Skip to content

Commit 27650eb

Browse files
author
Alexander Patrikalakis
committed
Dockerize gremlin-server.sh & JanusGraph with docker plugin
Signed-off-by: Alexander Patrikalakis <[email protected]>
1 parent 4e1b92c commit 27650eb

File tree

9 files changed

+136
-6
lines changed

9 files changed

+136
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ target/
1313
/log/
1414
/output/
1515
/scripts/
16+
/docker/*.zip
1617
# When executing tests in alphabetical order, Maven generates temporary
1718
# files with names like this:
1819
#

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# Please keep the list sorted.
1313

14+
Amazon
1415
DataStax
1516
Dylan Bethune-Waddell <[email protected]>
1617
Expero

BUILDING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,34 @@ To build with only the TinkerPop tests:
3030
mvn clean install -Dtest.skip.tp=false -DskipTests=true
3131
```
3232

33+
To build and run a docker image with JanusGraph and Gremlin Server, configured
34+
to run the berkeleyje backend with an embedded ElasticSearch instance:
35+
36+
```bash
37+
mvn clean package -Pjanusgraph-release -Dgpg.skip=true -DskipTests=true
38+
cd janusgraph-dist && mvn install -Pjanusgraph-docker -DskipTests=true docker:build
39+
docker run -d -p 8182:8182 --name janusgraph janusgraph/server:latest
40+
```
41+
42+
To connect to the server in the same container on the console:
43+
44+
```bash
45+
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh
46+
```
47+
48+
Then you can interact with the graph on the console through the `:remote` interface:
49+
50+
```
51+
gremlin> :remote connect tinkerpop.server conf/remote.yaml
52+
==>Configured localhost/127.0.0.1:8182
53+
gremlin> :remote console
54+
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
55+
gremlin> GraphOfTheGodsFactory.load(graph)
56+
==>null
57+
gremlin> g = graph.traversal()
58+
==>graphtraversalsource[standardjanusgraph[berkeleyje:db/berkeley], standard]
59+
```
60+
3361
## Building on Eclipse IDE
3462
Note that this has only been tested on Eclipse Neon.2 Release (4.6.2) with m2e (1.7.0.20160603-1933) and m2e-wtp (1.3.1.20160831-1005) plugin.
3563

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
![JanusGraph logo](janusgraph.png)
22

3-
JanusGraph is a highly scalable [graph database](http://en.wikipedia.org/wiki/Graph_database) optimized for storing and querying large graphs with billions of vertices and edges distributed across a multi-machine cluster. JanusGraph is a transactional database that can support thousands of concurrent users, complex traversals, and analytic graph queries.
3+
JanusGraph is a highly scalable [graph database](http://en.wikipedia.org/wiki/Graph_database)
4+
optimized for storing and querying large graphs with billions of vertices and edges
5+
distributed across a multi-machine cluster. JanusGraph is a transactional database that
6+
can support thousands of concurrent users, complex traversals, and analytic graph queries.
47

58
[![Build Status](https://travis-ci.org/JanusGraph/janusgraph.svg?branch=master)](https://travis-ci.org/JanusGraph/janusgraph)
69
[![Gitter](https://img.shields.io/gitter/room/janusgraph/janusgraph.svg)](https://gitter.im/janusgraph/janusgraph)
710

811
## Learn More
912

10-
The [project homepage](http://janusgraph.org) contains more information on JanusGraph and provides links to documentation, getting-started guides and release downloads.
13+
The [project homepage](http://janusgraph.org) contains more information on JanusGraph and
14+
provides links to documentation, getting-started guides and release downloads.
1115

1216
## Contact
1317

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM openjdk:8
2+
3+
ENV PATH "$JAVA_HOME/bin:$PATH"
4+
RUN apt-get update -y && apt-get install -y zip
5+
WORKDIR /var
6+
7+
ARG server_zip
8+
ARG server_base
9+
ADD ${server_zip} /var
10+
RUN unzip -q ${server_base}.zip && ln -s ./${server_base} ./janusgraph
11+
WORKDIR /var/janusgraph
12+
EXPOSE 8182
13+
CMD ["./bin/gremlin-server.sh"]

janusgraph-dist/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,33 @@
578578
</build>
579579
</profile>
580580

581+
<profile>
582+
<id>janusgraph-docker</id>
583+
<build>
584+
<pluginManagement>
585+
<plugins>
586+
<plugin>
587+
<groupId>com.spotify</groupId>
588+
<artifactId>docker-maven-plugin</artifactId>
589+
<version>0.4.13</version>
590+
<configuration>
591+
<dockerDirectory>janusgraph-dist-hadoop-2</dockerDirectory>
592+
<buildArgs>
593+
<server_zip>target/janusgraph-${project.version}-hadoop2.zip</server_zip>
594+
<server_base>janusgraph-${project.version}-hadoop2</server_base>
595+
</buildArgs>
596+
<forceTags>true</forceTags>
597+
<imageName>janusgraph/server</imageName>
598+
<imageTags>
599+
<imageTag>${project.version}</imageTag>
600+
</imageTags>
601+
</configuration>
602+
</plugin>
603+
</plugins>
604+
</pluginManagement>
605+
</build>
606+
</profile>
607+
581608
<profile>
582609
<id>janusgraph-release</id>
583610

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
host: localhost
2+
port: 8182
3+
scriptEvaluationTimeout: 30000
4+
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
5+
graphs: {
6+
graph: conf/gremlin-server/janusgraph-berkeleyje-es-server.properties}
7+
plugins:
8+
- janusgraph.imports
9+
scriptEngines: {
10+
gremlin-groovy: {
11+
imports: [java.lang.Math],
12+
staticImports: [java.lang.Math.PI],
13+
scripts: [scripts/empty-sample.groovy]}}
14+
serializers:
15+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
16+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
17+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
18+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
19+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
20+
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
21+
processors:
22+
- { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
23+
- { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
24+
metrics: {
25+
consoleReporter: {enabled: true, interval: 180000},
26+
csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
27+
jmxReporter: {enabled: true},
28+
slf4jReporter: {enabled: true, interval: 180000},
29+
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
30+
graphiteReporter: {enabled: false, interval: 180000}}
31+
maxInitialLineLength: 4096
32+
maxHeaderSize: 8192
33+
maxChunkSize: 8192
34+
maxContentLength: 65536
35+
maxAccumulationBufferComponents: 1024
36+
resultIterationBatchSize: 64
37+
writeBufferLowWaterMark: 32768
38+
writeBufferHighWaterMark: 65536
39+
ssl: {
40+
enabled: false}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# JanusGraph configuration sample: BerkeleyDB JE and embedded Elasticsearch
2+
#
3+
# This file opens a BDB JE instance in the directory
4+
# db/berkeley. It also starts a local Elasticsearch
5+
# service inside the same JVM running JanusGraph, persisted at
6+
# db/es.
7+
8+
gremlin.graph=org.janusgraph.core.JanusGraphFactory
9+
storage.backend=berkeleyje
10+
storage.directory=db/berkeley
11+
index.search.backend=elasticsearch
12+
index.search.directory=db/es
13+
index.search.elasticsearch.client-only=false
14+
index.search.elasticsearch.local-mode=true

pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@
105105
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
106106
<janusgraph.testdir>${project.build.directory}/janusgraph-test</janusgraph.testdir>
107107
<gpg.skip>false</gpg.skip>
108+
<maven.gpg.version>1.4</maven.gpg.version>
108109
<perf.jvm.opts />
109110
<default.test.jvm.opts>-Xms256m -Xmx768m -XX:+HeapDumpOnOutOfMemoryError -ea ${test.extra.jvm.opts}</default.test.jvm.opts>
110111
<mem.jvm.opts>-Xms256m -Xmx256m -ea -XX:+HeapDumpOnOutOfMemoryError ${test.extra.jvm.opts}</mem.jvm.opts>
111112
<test.extra.jvm.opts />
112113
<test.skip.default>false</test.skip.default>
113114
<test.skip.tp>true</test.skip.tp>
114115
<top.level.basedir>${basedir}</top.level.basedir>
116+
<maven.javadoc.version>2.10.4</maven.javadoc.version>
115117
<compiler.source>1.8</compiler.source>
116118
<compiler.target>1.8</compiler.target>
117119
<test.excluded.groups>org.janusgraph.testcategory.MemoryTests,org.janusgraph.testcategory.PerformanceTests,org.janusgraph.testcategory.BrittleTests</test.excluded.groups>
@@ -375,7 +377,7 @@
375377
</plugin>
376378
<plugin>
377379
<artifactId>maven-javadoc-plugin</artifactId>
378-
<version>2.9.1</version>
380+
<version>${maven.javadoc.version}</version>
379381
</plugin>
380382
<plugin>
381383
<artifactId>maven-assembly-plugin</artifactId>
@@ -399,7 +401,7 @@
399401
</plugin>
400402
<plugin>
401403
<artifactId>maven-gpg-plugin</artifactId>
402-
<version>1.4</version>
404+
<version>${maven.gpg.version}</version>
403405
</plugin>
404406
<plugin>
405407
<groupId>org.codehaus.mojo</groupId>
@@ -1093,7 +1095,7 @@
10931095
<plugin>
10941096
<groupId>org.apache.maven.plugins</groupId>
10951097
<artifactId>maven-javadoc-plugin</artifactId>
1096-
<version>2.7</version>
1098+
<version>${maven.javadoc.version}</version>
10971099
<executions>
10981100
<execution>
10991101
<id>attach-javadocs</id>
@@ -1103,7 +1105,7 @@
11031105
</plugin>
11041106
<plugin>
11051107
<artifactId>maven-gpg-plugin</artifactId>
1106-
<version>1.1</version>
1108+
<version>${maven.gpg.version}</version>
11071109
<executions>
11081110
<execution>
11091111
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)