Re: Custermized Docker for janusgraph 1.0.0. rc2


Florian Hockmann
 

1) I assume you mean the ConfigurationManagementGraph. You can enable that by setting this env var:

gremlinserver.graphs.ConfigurationManagementGraph="/etc/opt/janusgraph/janusgraph.properties"

 

To additionally set the required options in the properties file, you can also set these env vars:

 

janusgraph.gremlin.graph="org.janusgraph.core.ConfiguredGraphFactory"

janusgraph.graph.graphname="ConfigurationManagementGraph"

 

You might then want to remove the statically configured graph from the JanusGraph Server YAML file which can be done by also setting this env var:

 

gremlinserver%d.graphs.graph=

 

(without any value as this removes the option from the file).

 

2) JanusGraph 1.0.0 uses Java 11 so it uses a file “jvm-11.options” instead of “jvm-8.options”. The easiest way to replace that file is by mounting it into the container or by creating your own Docker image that uses the JanusGraph image as the base image and then contains a COPY like this:

 

COPY --chown=janusgraph:janusgraph src/jvm-11.options ${JANUS_HOME}/conf/jvm-11.options

 

3) scriptEvaluationTimeout has been replaced by evaluationTimeout. You can set that just like any other JanusGraph Server options through an env var:

 

gremlinserver.evaluationTimeout=30000

 

4) Just mount your script or COPY it into the container, exactly like for the `jvm-11.options` file. The default config of the server already contains a script that will be executed on startup so you can for example just replace that: scripts/empty-sample.groovy

 

 

Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von Yingjie Li
Gesendet: Mittwoch, 15. März 2023 12:39
An: janusgraph-users@...
Betreff: Re: [janusgraph-users] Custermized Docker for janusgraph 1.0.0. rc2

 

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.