Skip to content

Commit

Permalink
Enhance the script finding process when launching GIE from locally bu…
Browse files Browse the repository at this point in the history
…ild without installation (#1690)

Signed-off-by: Tao He <sighingnow@gmail.com>
  • Loading branch information
sighingnow committed Jun 8, 2022
1 parent 275547e commit 27e0338
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
22 changes: 20 additions & 2 deletions coordinator/gscoordinator/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,16 @@ def create_interactive_instance(self, config: dict):
"{}:{}".format(key, value) for key, value in engine_params.items()
]
env = os.environ.copy()
env.update({"GRAPHSCOPE_HOME": GRAPHSCOPE_HOME})
if ".install_prefix" in INTERACTIVE_ENGINE_SCRIPT:
env.update(
{
"GRAPHSCOPE_HOME": os.path.dirname(
os.path.dirname(INTERACTIVE_ENGINE_SCRIPT)
)
}
)
else:
env.update({"GRAPHSCOPE_HOME": GRAPHSCOPE_HOME})
cmd = [
INTERACTIVE_ENGINE_SCRIPT,
"create_gremlin_instance_on_local",
Expand Down Expand Up @@ -282,7 +291,16 @@ def create_interactive_instance(self, config: dict):

def close_interactive_instance(self, object_id):
env = os.environ.copy()
env.update({"GRAPHSCOPE_HOME": GRAPHSCOPE_HOME})
if ".install_prefix" in INTERACTIVE_ENGINE_SCRIPT:
env.update(
{
"GRAPHSCOPE_HOME": os.path.dirname(
os.path.dirname(INTERACTIVE_ENGINE_SCRIPT)
)
}
)
else:
env.update({"GRAPHSCOPE_HOME": GRAPHSCOPE_HOME})
cmd = [
INTERACTIVE_ENGINE_SCRIPT,
"close_gremlin_instance_on_local",
Expand Down
12 changes: 8 additions & 4 deletions coordinator/gscoordinator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,18 @@
# INTERACTIVE_ENGINE_SCRIPT
INTERAVTIVE_INSTANCE_TIMEOUT_SECONDS = 600 # 10 mins
INTERACTIVE_ENGINE_SCRIPT = os.path.join(GRAPHSCOPE_HOME, "bin", "giectl")
if not os.path.isfile(INTERACTIVE_ENGINE_SCRIPT):
INTERACTIVE_ENGINE_SCRIPT = os.path.join(
GRAPHSCOPE_HOME, ".install_prefix", "bin", "giectl"
)
if not os.path.isfile(INTERACTIVE_ENGINE_SCRIPT):
INTERACTIVE_ENGINE_SCRIPT = os.path.join(
GRAPHSCOPE_HOME, "interactive_engine", "bin", "giectl"
)
if not os.path.isfile(INTERACTIVE_ENGINE_SCRIPT):
INTERACTIVE_ENGINE_SCRIPT = os.path.join(
GRAPHSCOPE_HOME, "interactive_engine", "assembly", "bin", "giectl"
)
if not os.path.isfile(INTERACTIVE_ENGINE_SCRIPT):
INTERACTIVE_ENGINE_SCRIPT = os.path.join(
GRAPHSCOPE_HOME, "interactive_engine", "assembly", "bin", "giectl"
)

# JAVA SDK related CONSTANTS
LLVM4JNI_HOME = os.environ.get("LLVM4JNI_HOME", None)
Expand Down
4 changes: 2 additions & 2 deletions interactive_engine/assembly/bin/giectl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ start_coordinator() {
${GRAPHSCOPE_HOME}/conf/coordinator.application.properties > ${config_dir}/coordinator.application.properties

java ${java_opt} \
-cp ${GRAPHSCOPE_HOME}/maxgraph-coordinator-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/lib/*: \
-cp "${GRAPHSCOPE_HOME}/maxgraph-coordinator-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/lib/*:" \
com.alibaba.maxgraph.coordinator.CoordinatorMain \
${config_dir}/coordinator.application.properties \
${object_id} 1>${log_dir}/maxgraph-coordinator.out 2>${log_dir}/maxgraph-coordinator.err&
Expand Down Expand Up @@ -191,7 +191,7 @@ start_frontend() {

# maxgraph frontend service hold a handle client of coordinator
java ${java_opt} \
-cp $gaia_frontend_jar:${GRAPHSCOPE_HOME}/maxgraph-frontendservice-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/maxgraph-coordinator-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/lib/*: \
-cp "$gaia_frontend_jar:${GRAPHSCOPE_HOME}/maxgraph-frontendservice-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/maxgraph-coordinator-0.0.1-SNAPSHOT.jar:${GRAPHSCOPE_HOME}/lib/*:" \
$gaia_frontend_mainclass \
${config_dir}/frontend.vineyard.properties \
${object_id} 1>${log_dir}/maxgraph-frontend.out 2>${log_dir}/maxgraph-frontend.err&
Expand Down

0 comments on commit 27e0338

Please sign in to comment.