How to install gremlin-python scriptEngines on gremlin-server 3.4.7?

163 views
Skip to first unread message

wjim0324

unread,
Jun 17, 2020, 10:04:44 AM6/17/20
to Gremlin-users
I would appreciate some guidance on configuring gremlin-server to accept requests from python.

I've installed gremlin-console-3.4.7 and gremlin-server-3.4.7 on my Windows 10 machine.

I can initialize gremlin-server-3.4.7 with gremlin-server-modern.yaml and use gremlin-console-3.4.7 to traverse the graph.

I am not able to initialize gremlin-server-3.4.7 with gremlin-server-modern-py.yaml.

==================================Some Data ========================================

The gremlin-server-modern-py.yaml file has the following comments...

# Note that TinkerPop does not include gremlin-python dependencies in
# its distributions. This file cannot be used as a configuration file
# to Gremlin Server unless those dependencies are installed on the
# Gremlin Server path with:
#
# bin/gremlin-server.sh -i org.apache.tinkerpop gremlin-python x.y.z
#
# The primary change in this file to enable the GremlinJythonScriptEngine
# is the addition of "gremlin-jython" to the "scriptEngines" field.

=======================================================================================

I followed the instruction to install, adapting the shell script to the bat file format for Windows... with an unexpected result. 

PS C:\TinkerPop\gremlin\server-3.4.7> ./bin/gremlin-server.bat install org.apache.tinkerpop gremlin-python 3.4.7
Could not install the dependency: a module with the name gremlin-python is already installed
java.lang.IllegalStateException: a module with the name gremlin-python is already installed
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
        at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.copyDependenciesToPath(DependencyGrabber.groovy:73)
        at org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall.main(GremlinServerInstall.java:42)

=======================================================================================

I tried to initialize gremlin-server with gremlin-server-modern-py.yaml file, with an unexpected result...

C:\TinkerPop\gremlin\server-3.4.7>bin\gremlin-server.bat conf/gremlin-server-modern-py.yaml
[INFO] GremlinServer - 3.4.7
         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----

[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern-py.yaml
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[INFO] DefaultGraphManager - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and preparing GremlinScriptEngines instances.
[INFO] ServerGremlinExecutor - Initialized gremlin-groovy GremlinScriptEngine and registered metrics
[WARN] ServerGremlinExecutor - Could not initialize gremlin-jython GremlinScriptEngine as init script could not be evaluated
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: gremlin-jython is not an available GremlinScriptEngine
        ...
Caused by: java.lang.IllegalArgumentException: gremlin-jython is not an available GremlinScriptEngine
        ...
[WARN] ServerGremlinExecutor - Could not initialize gremlin-python GremlinScriptEngine as init script could not be evaluated
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: gremlin-python is not an available GremlinScriptEngine
        ...
Caused by: java.lang.IllegalArgumentException: gremlin-python is not an available GremlinScriptEngine
        ...
[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
[INFO] OpLoader - Adding the standard OpProcessor.
[INFO] OpLoader - Adding the session OpProcessor.
[INFO] OpLoader - Adding the traversal OpProcessor.
[INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
[INFO] GremlinServer - Executing start up LifeCycleHook
[INFO] Logger$info - Loading 'modern' graph data.
[INFO] GremlinServer - idleConnectionTimeout was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
[INFO] GremlinServer - keepAliveInterval was set to 0 which resolves to 0 seconds when configuring this value - this feature will be disabled
[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[WARN] AbstractChannelizer - The org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 serialization class is deprecated.
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0 with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0-stringd with org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
[INFO] GremlinServer$1 - Channel started at port 8182.
 
===================================================================================

I see the following parameters in the gremlin-server-modern-py.yaml file ...

host: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
evaluationTimeout: 30000
graphs: {
  graph: conf/tinkergraph-empty.properties}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}},
  gremlin-jython: {},
  gremlin-python: {}
}
===================================================================================

At this point, I am looking for suggestions...

1. Is the install command not complete as shown in the yaml comments, or do I need to point to a package?

2. I'm thinking that I need to alter the .yaml file in some way..... I see references in the yaml, and startup error messages for both gremlin-python and gremlin-jython.
   a. do I need both? I don't plan to use jython,
   b. do I need to provide a module reference for either ?

3. Other ?

Thanks.







Stephen Mallette

unread,
Jun 17, 2020, 11:49:57 AM6/17/20
to gremli...@googlegroups.com
Please note that Jython ScriptEngine support was deprecated in 3.3.10 and will be removed for 3.5.0 so relying on it for your development purposes is probably not advisable.

That said, there could be some problems with Windows and the "./bin/gremlin-server.bat install" command. I'd check your GREMLIN_SERVER_HOME/ext directory for a gremlin-python directory. Delete it and then re-run the command to try to re-install it. If that doesn't work, I suppose you could install it manually by copying gremlin-python and all it's relevant dependencies to that directory. I could provide you with a listing if needed.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/a6628bb9-f141-410d-ab5b-df0eb78f45b9o%40googlegroups.com.

wjim0324

unread,
Jun 19, 2020, 8:38:25 AM6/19/20
to Gremlin-users
Thanks. There was a gremlin-python directory, and it was empty. I deleted the directory and reran the bat file as listed in the yaml conf file and files were successfully copied.

I'm thinking that I made an error when I tried to adapt the parameters on the .sh command for use with the .bat file. The first time I just changed the .sh to .bat. Later I found I had to do more... the .sh file has "-i" as a parameter; the .bat file has "install" as a parameter".  My guess is that the directory gets created the first time the command is run. The second time the install process fails... along the way I commented out the @echo off in the bat file to see what was happening. It would be good idea to modify the comments in the yaml file and remove the @echo off .
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages