Skip to content

Commit

Permalink
make gie executor can switch read version
Browse files Browse the repository at this point in the history
Signed-off-by: Lei Wang <[email protected]>
  • Loading branch information
doudoubobo committed Jul 9, 2024
1 parent 5b4dbf3 commit 387c678
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
6 changes: 3 additions & 3 deletions converter/binlog_convert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int main(int argc, char** argv) {
}
}
processed_count++;
if (!catch_up_mode) {
if (likely(!catch_up_mode)) {
ostream << LogEntry::bulk_load_end().to_string(processed_count)
<< flush;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ int main(int argc, char** argv) {
}
}
processed_count++;
if (!catch_up_mode) {
if (likely(!catch_up_mode)) {
ostream << log_entry.to_string(processed_count) << flush;
}

Expand All @@ -329,7 +329,7 @@ int main(int argc, char** argv) {
}

processed_count++;
if (!catch_up_mode) {
if (likely(!catch_up_mode)) {
ostream << log_entry.to_string(processed_count) << flush;
}

Expand Down
13 changes: 0 additions & 13 deletions scripts/launch_gie_executor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ export ETCD_PREFIX=$etcd_prefix

APP_NAME="grin_executor"

if pgrep -f $APP_NAME > /dev/null; then
echo "$APP_NAME is running. Terminating..."
pkill -f $APP_NAME

sleep 1
if pgrep -f $APP_NAME > /dev/null; then
echo "$APP_NAME did not terminate, force killing..."
pkill -9 -f $APP_NAME
fi
else
echo "$APP_NAME not running."
fi

# Start the GIE executor
cd /home/graphscope/GraphScope/interactive_engine/executor/assembly/grin_gart
# run backgorund and redirect stdout and stderr to /home/graphscope/gie_executor.log
Expand Down
27 changes: 18 additions & 9 deletions scripts/update_gie_executor_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
engine_service_name = sys.argv[6]
engine_port = sys.argv[7]

is_running = False


with open("/home/graphscope/gie-executor-config.properties", "w") as f:
f.write("rpc.port: " + rpc_port + "\n")
Expand Down Expand Up @@ -51,15 +53,22 @@ def start_gie_executor():
etcd_prefix = request.form.get("etcd_prefix", "gart_meta_")
if etcd_prefix is None:
return "etcd_prefix is required", 400
cmd = f"/home/graphscope/GART/scripts/launch_gie_executor.sh {etcd_endpoint} {etcd_prefix} {read_epoch}"
subprocess.run(
[
"/bin/bash",
"-c",
cmd,
]
)
return "Executor launching sucessfully", 200
global is_running
if not is_running:
is_running = True
cmd = f"/home/graphscope/GART/scripts/launch_gie_executor.sh {etcd_endpoint} {etcd_prefix} {read_epoch}"
subprocess.run(
[
"/bin/bash",
"-c",
cmd,
]
)
return "Executor launching sucessfully", 200
else:
with open ("/tmp/read_epoch", "w") as f:
f.write(read_epoch)
return "Executor is already running", 200


port = int(os.getenv("GIE_EXECUTOR_FLASK_PORT", 5000))
Expand Down

0 comments on commit 387c678

Please sign in to comment.