Skip to content

Commit

Permalink
fix root disk path
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzfb committed Oct 12, 2024
1 parent e0c3243 commit 6fffd68
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
9 changes: 8 additions & 1 deletion antgo/framework/helper/runner/hooks/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,16 @@ def before_run(self, runner):
# 设置文件日志存储根目录
if mlogger.is_ready():
self.is_ready = True
backend = 'disk'
if self.out_dir.startswith('ali'):
backend = 'aliyun'
elif self.out_dir.startswith('qiniu'):
backend = 'qiniu'
elif self.out_dir.startswith('htfs'):
backend = 'htfs'
mlogger.FileLogger.root_folder = self.out_dir
self.file_logger = mlogger.Container()
self.file_logger.file = mlogger.FileLogger('file', 'aliyun', True)
self.file_logger.file = mlogger.FileLogger('file', backend, True)

runner.logger.info(
(f'Checkpoints will be saved to {self.out_dir} by '
Expand Down
19 changes: 9 additions & 10 deletions antgo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,11 @@ def main():
logging.error('Only support mode = http, grpc')
return

try:
assert('image_repo' in server_info)
assert('server_port' in server_info)
assert('create_time' in server_info)
assert('update_time' in server_info)
assert('name' in server_info)
except:
logging.error('Server info not complete. Need to antgo package xxx.')
return
assert('image_repo' in server_info)
assert('server_port' in server_info)
assert('create_time' in server_info)
assert('update_time' in server_info)
assert('name' in server_info)

print('Server Info.')
print(server_info)
Expand Down Expand Up @@ -418,7 +414,10 @@ def main():
os.system(deploy_cmd)
elif args.k8s:
logging.error('K8s deploy in comming.')
return

# step 3: 更新平台记录(name, logo, description, address)
# 仅内部团队测试使用

return

# 查看运行设备(本地/远程)
Expand Down
6 changes: 3 additions & 3 deletions antgo/pipeline/extent/op/templates/grpc_proto_code.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ service ${servername} {

rpc ${servername}AsynPush(${servername}AsynPushRequest) returns (${servername}AsynPushReply) {}

rpc ${servername}AsynPushStream(${servername}AsynPushStreamRequest) returns (${servername}AsynPushStreamReply) {}
rpc ${servername}AsynStream(${servername}AsynStreamRequest) returns (${servername}AsynStreamReply) {}

rpc ${servername}AsynMessage(${servername}AsynMessageRequest) returns (stream ${servername}AsynMessageReply) {}
}
Expand Down Expand Up @@ -49,13 +49,13 @@ message ${servername}AsynPushReply{
string data = 3; // 里面是json 见json配置文件
}

message ${servername}AsynPushStreamRequest{
message ${servername}AsynStreamRequest{
string serverkey = 1; // 服务关键字
bytes package_data = 2; // 包数据
int32 package_size = 3; // 包大小
}

message ${servername}AsynPushStreamReply{
message ${servername}AsynStreamReply{
string message = 1; // 返回的消息例如 success
int32 code = 2; // 返回的code 0 成功,非0失败
string data = 3; // 里面是json 见json配置文件
Expand Down
4 changes: 2 additions & 2 deletions antgo/pipeline/extent/op/templates/grpc_server_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ class ${servername}ServiceImpl final : public ${servername}::Service{
response->set_code(0);
return Status::OK;
}
::grpc::Status ${servername}AsynPushStream(::grpc::ServerContext* context, const ::${package}::${servername}AsynPushStreamRequest* request, ::${package}::${servername}AsynPushStreamReply* response){
::grpc::Status ${servername}AsynStream(::grpc::ServerContext* context, const ::${package}::${servername}AsynStreamRequest* request, ::${package}::${servername}AsynStreamReply* response){
// 仅用于对视频流分析
std::string server_key = request->serverkey();

// 推送数据到管线队列
char* package_data = const_cast<char*>(request->package_data().c_str());
eagleeye::eagleeye_pipeline_server_push_stream(server_key, (uint8_t*)package_data, request->package_size());
eagleeye::eagleeye_pipeline_server_stream(server_key, (uint8_t*)package_data, request->package_size());
response->set_code(0);
return Status::OK;
}
Expand Down

0 comments on commit 6fffd68

Please sign in to comment.