Skip to content
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

Merged
merged 2 commits into from
Jun 7, 2017
Merged

Conversation

amcp
Copy link

@amcp amcp commented Feb 26, 2017

Fixes #140
Signed-off-by: Alexander Patrikalakis [email protected]

@janusgraph-bot janusgraph-bot added the cla: yes This PR is compliant with the CLA label Feb 26, 2017
@hsaputra
Copy link
Member

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?

@amcp
Copy link
Author

amcp commented Feb 26, 2017

@hsaputra I think thats a great idea. I'll put in in the master or dist pom in my next pass.

@amcp
Copy link
Author

amcp commented Feb 26, 2017

@hsaputra I ended up using a different one, but it works now.

Copy link
Member

@pluradj pluradj left a 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
```

Copy link
Member

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]

Copy link
Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pluradj done!

@hsaputra
Copy link
Member

@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}
Copy link
Member

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.

Copy link
Author

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

Copy link
Author

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

Copy link
Author

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
Copy link
Contributor

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

Copy link
Author

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 !

Copy link
Author

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

Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amcp amcp force-pushed the docker branch 3 times, most recently from 27650eb to b375394 Compare March 3, 2017 15:36
@amcp
Copy link
Author

amcp commented Mar 5, 2017

@pluradj @analytically Look OK?

@amcp amcp force-pushed the docker branch 2 times, most recently from f1d62d3 to 3170624 Compare March 6, 2017 01:16
RUN ln -s ./${server_base} ./janusgraph
WORKDIR /var/janusgraph
EXPOSE 8182
CMD ["./bin/gremlin-server.sh"]
Copy link
Member

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pluradj done!

@janusgraph-bot janusgraph-bot added the cla: yes This PR is compliant with the CLA label Apr 5, 2017
@zifnab87
Copy link

any updates on this? Thanks :)

Copy link

@taylorsmithgg taylorsmithgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taylorsmithgg
Copy link

Need to make sure to include
cd janusgraph-hbase-parent/janusgraph-hbase-core && mvn install

In order for build to pass.

Copy link
Author

@amcp amcp left a 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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```bash
docker exec -i -t janusgraph /var/janusgraph/bin/gremlin.sh
```

Copy link
Author

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"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pluradj done!

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
Copy link
Author

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}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pluradj done!

@amcp amcp force-pushed the docker branch 3 times, most recently from 1a9dc59 to 6337004 Compare April 25, 2017 18:44
@amcp
Copy link
Author

amcp commented Apr 25, 2017

@pluradj @analytically @hsaputra @taylorsmithgg I've addressed all your feedback
@zifnab87 as soon as this is reviewed and approved, I will merge.

Copy link

@taylorsmithgg taylorsmithgg left a 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
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjudeng
Copy link
Contributor

sjudeng commented Apr 29, 2017

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.).

@AndreSteenbergen
Copy link

In the docker image it might be wise to listen on 0.0.0.0 instead of localhost

@@ -0,0 +1,40 @@
host: localhost

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.

Copy link
Author

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.

@sjudeng
Copy link
Contributor

sjudeng commented Jun 1, 2017

@amcp If you don't mind the added Compose dependency amcp/janusgraph/pull/1 includes all the updates requested above.

@janusgraph-bot
Copy link

Author of one or more commits is not listed as a CLA signer, either individual or as a member of an organization.

@janusgraph-bot janusgraph-bot added cla: no This PR is not compliant with the CLA and removed cla: yes This PR is compliant with the CLA labels Jun 3, 2017
@amcp
Copy link
Author

amcp commented Jun 3, 2017

@sjudeng I merged in your commit to my pr.
@hsaputra @pluradj Is the some of our work acceptable now?

@sjudeng
Copy link
Contributor

sjudeng commented Jun 6, 2017

@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.

@hsaputra
Copy link
Member

hsaputra commented Jun 6, 2017

LGTM

@amcp
Copy link
Author

amcp commented Jun 6, 2017

I can rebase and then ask pluradj to take a look.

Alexander Patrikalakis and others added 2 commits June 5, 2017 23:51
@janusgraph-bot janusgraph-bot added cla: yes This PR is compliant with the CLA and removed cla: no This PR is not compliant with the CLA labels Jun 6, 2017
@amcp
Copy link
Author

amcp commented Jun 6, 2017

@pluradj @sjudeng I rebased the branch so we should be all set to go.

@amcp
Copy link
Author

amcp commented Jun 7, 2017

@sjudeng 48 hours seem to have passed? Can you merge this please?

@sjudeng
Copy link
Contributor

sjudeng commented Jun 7, 2017

Yep. I'll run through the comments once for good measure and then get it merged later today.

@sjudeng sjudeng dismissed pluradj’s stale review June 7, 2017 23:58

All requests have been resolved and reviewer has had opportunities to provide additional requests..

@sjudeng sjudeng merged commit 32f468c into JanusGraph:master Jun 7, 2017
@amcp amcp deleted the docker branch June 8, 2017 01:55
Copy link
Author

@amcp amcp left a 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
Copy link
Author

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.

sjudeng added a commit that referenced this pull request Jun 8, 2017
Expose gremlin server port by listening on 0.0.0.0 #141
bwatson-rti-org pushed a commit to bwatson-rti-org/janusgraph that referenced this pull request Mar 9, 2019
Dockerize gremlin-server.sh with JanusGraph
bwatson-rti-org pushed a commit to bwatson-rti-org/janusgraph that referenced this pull request Mar 9, 2019
Expose gremlin server port by listening on 0.0.0.0 JanusGraph#141
micpod pushed a commit to micpod/janusgraph that referenced this pull request Nov 5, 2019
Dockerize gremlin-server.sh with JanusGraph
micpod pushed a commit to micpod/janusgraph that referenced this pull request Nov 5, 2019
Expose gremlin server port by listening on 0.0.0.0 JanusGraph#141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This PR is compliant with the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants