Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _A work in progress. Use at your own discretion._

An unofficial set of lightweight [Docker][docker], and [Docker Compose][docker-compose] files for working with [Apache TinkerPop™][tinkerpop] Gremlin Console, Gremlin Server, and [Neo4j][neo4j].

- `org.apache.tinkerpop neo4j-gremlin` is installed out-of-the-box for both the Gremlin Console, and the Server image (currently version `3.2.1`)
- `org.apache.tinkerpop neo4j-gremlin` is installed out-of-the-box for both the Gremlin Console, and the Server image (currently version `3.4.2`)
- `tinkerpop.neo4j`, and `tinkerpop.gephi` plugins are also enabled for the Gremlin Console image by default (i.e. no `:plugin use` needed)


Expand All @@ -23,11 +23,6 @@ To perform concurrent reads on the same database, Gremlin, and Neo4j must be con

You can ignore this if both services are operating on different databases.

**Neo4j 3:**

At the time of writing, Gremlin has difficulties operating on a database generated by Neo4j 3. As such, the Docker Compose file uses Neo4j 2.3.


## Known Issues

- [ ] Currently databases accessed/created with Gremlin Server. Once opened with Neo4j browser these files become impossible to
Expand Down Expand Up @@ -137,4 +132,4 @@ g.V().count()
[gephi]: https://gephi.org/
[neo4j]: https://neo4j.com/
[tinkerpop]: https://tinkerpop.apache.org/
[travis-ci]: https://travis-ci.org/
[travis-ci]: https://travis-ci.org/
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- ./gremlin-server-neo4j/scripts/neo4j.groovy:/gremlin-server/scripts/neo4j.groovy

neo4j-server:
image: neo4j:2.3
image: neo4j:3.5.8
environment:
# - NEO4J_AUTH=neo4j/pass
- NEO4J_AUTH=none
Expand Down
2 changes: 1 addition & 1 deletion gremlin-console-neo4j/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:8-alpine
MAINTAINER gremlinorm <https://github.com/gremlin-orm>

ARG GREMLIN_VERSION=3.2.6
ARG GREMLIN_VERSION=3.4.2

ARG BUILD_DATE
ARG VCS_REF
Expand Down
4 changes: 2 additions & 2 deletions gremlin-server-neo4j/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:8-alpine
MAINTAINER gremlinorm <https://github.com/gremlin-orm>

ARG GREMLIN_VERSION=3.2.6
ARG GREMLIN_VERSION=3.4.2

ARG BUILD_DATE
ARG VCS_REF
Expand All @@ -19,7 +19,7 @@ RUN apk add --update bash && rm -rf /var/cache/apk/* && \
WORKDIR /gremlin-server/

COPY ./grapeConfig.xml /root/.groovy/grapeConfig.xml
RUN /bin/bash -c "/gremlin-server/bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin $GREMLIN_VERSION"
RUN /bin/bash -c "/gremlin-server/bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin $GREMLIN_VERSION"

COPY ./conf/gremlin-server-custom.yml /gremlin-server/conf/gremlin-server-custom.yml
COPY ./conf/neo4j.properties /gremlin-server/conf/neo4j.properties
Expand Down
41 changes: 22 additions & 19 deletions gremlin-server-neo4j/conf/gremlin-server-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,52 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Note that TinkerPop does not include Neo4j dependencies in its
# distributions. This file cannot be used as a configuration file to
# Gremlin Server unless Neo4j dependencies are installed on the
# Gremlin Server path with:
#
# Adapted from https://github.com/apache/tinkerpop/blob/master/gremlin-server/conf/gremlin-server-min.yaml
# bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin x.y.z
#
# Note that unless under a commercial agreement with Neo4j, Inc.,
# Neo4j is licensed AGPL.

host: 0.0.0.0
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/neo4j.properties}
plugins:
- tinkerpop.neo4j
scriptEngines: {
gremlin-groovy: {
imports: [java.lang.Math],
staticImports: [java.lang.Math.PI],
scripts: [scripts/neo4j.groovy]}}
plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin: {},
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v1.0+gryo-stringd
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+json
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { useMapperFromGraph: graph }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }} # application/vnd.gremlin-v3.0+gryo
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v3.0+gryo-stringd
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }} # application/json
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 } # application/vnd.graphbinary-v1.0
processors:
- { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
- { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
consoleReporter: {enabled: true, interval: 180000},
csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
jmxReporter: {enabled: true},
slf4jReporter: {enabled: true, interval: 180000},
gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
graphiteReporter: {enabled: false, interval: 180000}}
slf4jReporter: {enabled: true, interval: 180000}}
strictTransactionManagement: false
threadPoolBoss: 1
idleConnectionTimeout: 0
keepAliveInterval: 0
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferHighWaterMark: 32768
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
enabled: false}

2 changes: 2 additions & 0 deletions gremlin-server-neo4j/conf/neo4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/data/neo4j/graph.db
gremlin.neo4j.conf.node_auto_indexing=true
gremlin.neo4j.conf.relationship_auto_indexing=true
gremlin.neo4j.multiProperties=true
gremlin.neo4j.metaProperties=true
7 changes: 6 additions & 1 deletion gremlin-server-neo4j/scripts/neo4j.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ globals << [hook : [
] as LifeCycleHook]

// define the default TraversalSource to bind queries to - this one will be named "g".
globals << [g : graph.traversal() ]
// ReferenceElementStrategy converts all graph elements (vertices/edges/vertex properties)
// to "references" (i.e. just id and label without properties). this strategy was added
// in 3.4.0 to make all Gremlin Server results consistent across all protocols and
// serialization formats aligning it with TinkerPop recommended practices for writing
// Gremlin.
globals << [g : graph.traversal().withStrategies(ReferenceElementStrategy.instance())]