### Steps to reproduce:
- Create data
```
Actually while trying to add more env variables to the janusgraph.env file (posted earlier). I realized that my docker compose of latest Janusgraph (janusgraph/janusgraph:1.0.0-rc2), cassandra:4.1 and openshift2.6 failed. One of the reasons is Cassandra server can not started successfully, so does the Junagarh server. I am attaching the related files and the output of docker-compose --verbose up (Janusgraph-1.0.0-rc2-cassandra-4.1-openshift2.6-out.txt) . Any pointers of how to fix the issue? Thanks
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)
Yingjie
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
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) :
Here you go, in the gremlin console with janusgraph-0.6.3:
```
gremlin> graph = JanusGraphFactory.open('conf/janusgraph-inmemory.properties')
==>standardjanusgraph[inmemory:[127.0.0.1]]
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin> g.addV('v1')
==>v[4112]
gremlin> g.V().order().by("name")
08:00:35 WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [()]. For better performance, use indexes
==>v[4112]
```
Please advise.
Thanks
My two cents: you can look at https://github.com/JanusGraph/janusgraph-docker/blob/master/docker-compose-cql-es.yml and come up with your own docker-compose setting.
Cheers,
Boxuan
Hello Boxuan.
Thanks for the pointers. Will it allow me to run with certain configuration, such as use ConfiguredGraphFactory instead of JanusgraphFactory etc?
To add a little bit of context here. I have been using Janusgraph all in one package with the cql-es backend. In my docker, I first do certain customization to janusgraph-all-in-one package :1) Configure Janusgraph to use ConfiguredGraphFactory instead of JanusgraphFactory 2) change the JVM heap Size 3) change the default evaluationTimeout time for gremlin server, and 4) remove certain extensions/jars that I don't use.
I then initialize it with a default graph with own defined schema (groovy script) if there is no graph defined.
The last part is a flask service that insert data to the graph and query the graph (gremlin-python or gremlin command). The entry point of my docker is the flask service. So basically the user interacts with the graph via flask APIs.
Now I need to split my docker into three separate ones, Janusgraph + flask (can split if necessary), Cassandra (latest docker) OpenSearch(latest docker, replacing Elasticsearch as the ElasticSearch license in Janusgraph all in one is not sspl).
I am looking for pointers/samples that help me to do the above.
Thanks,
Yingjie
janusgraph/janusgraph:1.0.0-rc2 should be available. You can find it here: https://hub.docker.com/layers/janusgraph/janusgraph/1.0.0-rc2/images/sha256-048c7a3470156c3018c58a20674cf2cb2ea1bb58f8bca57684360317e9e92516?context=explore
Cheers,
Boxuan
Similar to an issue in OrientDB https://github.com/orientechnologies/orientdb/issues/9933
Here is a simpler case to reproduce:
g.addV("v1")
g.V().order().by("name")
=> java.lang.IllegalArgumentException
When attempting to order vertices by property value "name" that is not defined for all vertices, we have received an unexpected exception [java.lang.IllegalArgumentException]. We have found that other Graph Databases such as HugeGraph and ArcadeDB are capable of executing similar Gremlin queries without encountering exceptions, which leads us to believe that this functionality should be supported in JanusGraph as well.
Would it be possible for you to further confirm it? It would be highly appreciated.
Best regards,
Joye
The latest janusgraph-1.0.0-rc2 ships with elasticsearch-rest-client 8.6. According to the OpenSearch docs, the latest opensearch versions should be compatible with that. What goes wrong when you try and connect a janusgraph instance with your opensearch-2.5 cluster?
I assume that you do not need to replace the elasticsearch-rest-client, because AFAICS this is still APL2 licensed.
Note that replacing individual jars in a binary distrbution is not a good idea, because the new config was never tested during a build. Even if only applying minor updates in the sense of semantic versioning, things can and will break in practice.
Best wishes, Marc
See https://issues.apache.org/jira/browse/TINKERPOP-2898
Stephen Mallette remarks that in Case 1 and Case 2 the root cause is "in" being a keyword in Groovy. So, implicit anonymous traversals starting with "in" are not possible and need to be explicit anonymous traversals: __.in().
https://github.com/JanusGraph/janusgraph/issues/3656
https://issues.apache.org/jira/browse/TINKERPOP-2897
https://issues.apache.org/jira/browse/TINKERPOP-2895