Re: Custermized Docker for janusgraph 1.0.0. rc2


Yingjie Li
 

I was able to create a docker-compose that starts four containers Janusgraph 1.0.0-rc2, Cassandra and OpenSearch  based on a repo https://gist.github.com/Phate334/9fd90ddce0eaea74086c1a2e5d419402   from an earlier discussion in Janusgraph git:  https://github.com/JanusGraph/janusgraph/discussions/2837

The docker-compose  and janusgraph.env files are attached. 

Here are my question is in this new context and apprecaite any pointers. 


1) how can I enable Janusgraph container to use ConfiguredGraphManager but not default JanusgraphFactory. In all-in-one case. I simply do

cp $JANUSGRPH_DIR/conf/gremlin-server/gremlin-server-configuration.yaml $JANUSGRPH_DIR/conf/gremlin-server/gremlin-server-cql-es.yaml

2) how can i change the default Janusgraph JVM heap size. In all-in-one case, I replace the sring in the related file

sed "s/Xmx4096m/$JVM_HEAP_MAX/g" $JANUSGRPH_DIR/conf/jvm-8.options > $JANUSGRPH_DIR/conf/jvm-8.options

3). How to change the scriptEvaluationTime in some of the files, for example, in all-in-one case, I replace the sring in the related files like below

sed "s/evaluationTimeout: 30000/evaluationTimeout: $SCRIPT_EVALUATION_TIMEOUT/g" $JANUSGRPH_DIR/conf/gremlin-server/gremlin-server-cql-es.yaml > $JANUSGRPH_DIR/conf/gremlin-server/gremlin-server-cql-es.yaml

4). How to start my janusgraph docker run with a default graph & schema (groovy), a sample of my groovy as below ( somehow can not attache it) :

//Create a sessioned connection to the Gremlin Server
:remote connect tinkerpop.server conf/remote.yaml session
:remote console

//define graph name
graph_name = "graph1"
map = new HashMap();
map.put("storage.backend", "cql");
map.put("storage.hostname", "127.0.0.1")
map.put("index.search.backend", "elasticsearch")
map.put("index.search.hostname", "127.0.0.1")
map.put("graph.graphname", graph_name)
map.put('query.batch', true)
ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map))
graph = ConfiguredGraphFactory.open(graph_name)
//Creat graph schema
//Close all transactions
graph.getOpenTransactions().forEach { tx -> tx.rollback() }
mgmt = graph.openManagement()
mgmt.getOpenInstances().forEach {
if (it.reverse().take(1) != ")") {
mgmt.forceCloseInstance(it)
}
}
pk_id = mgmt.makePropertyKey('id').dataType(String.class).cardinality(org.janusgraph.core.Cardinality.LIST).make()
pk_name = mgmt.makePropertyKey('name').dataType(String.class).cardinality(org.janusgraph.core.Cardinality.LIST).make()
mgmt.buildIndex('vby_name_m', Vertex.class).addKey(pk_name).buildMixedIndex('search')
mgmt.commit()
ConfiguredGraphFactory.close(graph_name)



 
 

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.