Skip to content

Commit 7e701b9

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

File tree

9 files changed

+99
-7
lines changed

9 files changed

+99
-7
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM openjdk:8
2+
3+
ENV PATH "$JAVA_HOME/bin:$PATH"
4+
RUN apt-get update -y
5+
RUN apt-get install -y zip
6+
WORKDIR /var
7+
8+
ARG server_zip
9+
ARG server_base
10+
ADD ${server_zip} /var
11+
RUN unzip -q ${server_base}.zip
12+
RUN ln -s ./${server_base} ./janusgraph
13+
WORKDIR /var/janusgraph
14+
EXPOSE 8182
15+
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

janusgraph-dist/src/assembly/static/conf/gremlin-server/gremlin-server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ port: 8182
33
scriptEvaluationTimeout: 30000
44
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
55
graphs: {
6-
graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties}
6+
graph: conf/gremlin-server/janusgraph-berkeleyje-es-server.properties}
77
plugins:
88
- janusgraph.imports
99
scriptEngines: {
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>
@@ -345,7 +347,7 @@
345347
</plugin>
346348
<plugin>
347349
<artifactId>maven-javadoc-plugin</artifactId>
348-
<version>2.9.1</version>
350+
<version>${maven.javadoc.version}</version>
349351
</plugin>
350352
<plugin>
351353
<artifactId>maven-assembly-plugin</artifactId>
@@ -369,7 +371,7 @@
369371
</plugin>
370372
<plugin>
371373
<artifactId>maven-gpg-plugin</artifactId>
372-
<version>1.4</version>
374+
<version>${maven.gpg.version}</version>
373375
</plugin>
374376
<plugin>
375377
<groupId>org.codehaus.mojo</groupId>
@@ -1063,7 +1065,7 @@
10631065
<plugin>
10641066
<groupId>org.apache.maven.plugins</groupId>
10651067
<artifactId>maven-javadoc-plugin</artifactId>
1066-
<version>2.7</version>
1068+
<version>${maven.javadoc.version}</version>
10671069
<executions>
10681070
<execution>
10691071
<id>attach-javadocs</id>
@@ -1073,7 +1075,7 @@
10731075
</plugin>
10741076
<plugin>
10751077
<artifactId>maven-gpg-plugin</artifactId>
1076-
<version>1.1</version>
1078+
<version>${maven.gpg.version}</version>
10771079
<executions>
10781080
<execution>
10791081
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)