-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerize gremlin-server.sh with JanusGraph #141
Conversation
This looks good to me, but how about using Maven Docker plugin like https://github.com/fabric8io/docker-maven-plugin to automate the Docker image building? |
@hsaputra I think thats a great idea. I'll put in in the master or dist pom in my next pass. |
@hsaputra I ended up using a different one, but it works now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it out with Docker, and it worked fine. Some small doc updates, then I think this is good to go.
```bash | ||
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should continue this out with some Gremlin Console interaction. The BerkeleyJE backend only allows a single connection, so the users cannot do something like graph = JanusGraphFactory.open('conf/janusgraph-berkeleyje-es.properties')
as described in the Getting Started doc.
They would need to configure a remote connection through the Gremlin Server.
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> GraphOfTheGodsFactory.load(graph)
==>null
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[berkeleyje:db/berkeley], standard]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make these changes now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include:
cd janusgraph-hbase-parent/janusgraph-hbase-core && mvn install
and/or upload to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
@amcp Looks good to me! |
@@ -3,7 +3,7 @@ port: 8182 | |||
scriptEvaluationTimeout: 30000 | |||
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer | |||
graphs: { | |||
graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties} | |||
graph: conf/gremlin-server/janusgraph-berkeleyje-es-server.properties} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will make the Chapter 7 JanusGraph server docs incorrect, since they assume that running bin/janusgraph.sh start
will start up Cassandra, ES, and Gremlin Server with a graph instance configured to use them.
You could make a separate server YAML for the BerkeleyJE-ES configuration that you can pass to the gremlin server CMD in the Dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make a second YAML file and update the instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj I now pass the path to a separate YAML file for berkeleyje
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
|
||
ENV PATH "$JAVA_HOME/bin:$PATH" | ||
RUN apt-get update -y | ||
RUN apt-get install -y zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run these in one line, less layers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always better to make build thinner and faster !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@analytically am I allowed to combine an ENV directive with a RUN directive? I understand that I can write RUN apt-get update -y && apt-get install -y zip
and RUN unzip -q ${server_base}.zip && ln -s ./${server_base} ./janusgraph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No can't do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill batch together what I can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@analytically done!
27650eb
to
b375394
Compare
@pluradj @analytically Look OK? |
f1d62d3
to
3170624
Compare
RUN ln -s ./${server_base} ./janusgraph | ||
WORKDIR /var/janusgraph | ||
EXPOSE 8182 | ||
CMD ["./bin/gremlin-server.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest changing the command here to ./bin/gremlin-server.sh ./conf/gremlin-server/gremlin-server-berkeleyje-es.yaml
and creating the new YAML file.
The change to gremlin-server.yaml
should be reverted so ./bin/janusgraph.sh start
still works as documented with Cassandra and ES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
any updates on this? Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build is currently failing for me due to a missing jar: https://oss.sonatype.org/content/repositories/snapshots/org/janusgraph/janusgraph-hbase-core/0.1.0-SNAPSHOT/janusgraph-hbase-core-0.1.0-SNAPSHOT-tests.jar
Need to make sure to include In order for build to pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed feedback
|
||
ENV PATH "$JAVA_HOME/bin:$PATH" | ||
RUN apt-get update -y | ||
RUN apt-get install -y zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@analytically done!
```bash | ||
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
RUN ln -s ./${server_base} ./janusgraph | ||
WORKDIR /var/janusgraph | ||
EXPOSE 8182 | ||
CMD ["./bin/gremlin-server.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
janusgraph-dist/pom.xml
Outdated
<plugin> | ||
<groupId>com.spotify</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<version>0.4.13</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull tool version up top
@@ -3,7 +3,7 @@ port: 8182 | |||
scriptEvaluationTimeout: 30000 | |||
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer | |||
graphs: { | |||
graph: conf/gremlin-server/janusgraph-cassandra-es-server.properties} | |||
graph: conf/gremlin-server/janusgraph-berkeleyje-es-server.properties} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pluradj done!
1a9dc59
to
6337004
Compare
@pluradj @analytically @hsaputra @taylorsmithgg I've addressed all your feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Really happy to have this available.
```bash | ||
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include:
cd janusgraph-hbase-parent/janusgraph-hbase-core && mvn install
and/or upload to:
I pushed a branch and PR that uses Compose to start both Elasticsearch and the JanusGraph Gremlin Server container linked to same. I think this is preferable to trying to get ES started within the same container and it might offer easier extension points for later efforts (e.g. adding containers for storage backends, persistent data volumes, etc.). |
In the docker image it might be wise to listen on 0.0.0.0 instead of localhost |
@@ -0,0 +1,40 @@ | |||
host: localhost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.0.0.0 would be nice, so you can expose port 8182 to outside docker container, and connect using websockets for testing clients outside the container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't catch this before merging. Will start a new PR to address.
@amcp If you don't mind the added Compose dependency amcp/janusgraph/pull/1 includes all the updates requested above. |
Author of one or more commits is not listed as a CLA signer, either individual or as a member of an organization. |
@hsaputra, @pluradj, @analytically If possible can you confirm all your requested changes are in here or request additional time for review? Otherwise unless there are objections in 48 hours I can review all your requests and confirm the changes are in and then merge if everything looks resolved. |
LGTM |
I can rebase and then ask pluradj to take a look. |
Signed-off-by: Alexander Patrikalakis <[email protected]>
…rch containers Signed-off-by: sjudeng <[email protected]>
@sjudeng 48 hours seem to have passed? Can you merge this please? |
Yep. I'll run through the comments once for good measure and then get it merged later today. |
All requests have been resolved and reviewer has had opportunities to provide additional requests..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to address a comment
@@ -0,0 +1,40 @@ | |||
host: localhost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't catch this before merging. Will start a new PR to address.
Expose gremlin server port by listening on 0.0.0.0 #141
Dockerize gremlin-server.sh with JanusGraph
Expose gremlin server port by listening on 0.0.0.0 JanusGraph#141
Dockerize gremlin-server.sh with JanusGraph
Expose gremlin server port by listening on 0.0.0.0 JanusGraph#141
Fixes #140
Signed-off-by: Alexander Patrikalakis [email protected]