|
@@ -57,6 +57,23 @@ class EASClient:
|
|
|
print(error.data.get("Recommend"))
|
|
|
UtilClient.assert_as_string(error.message)
|
|
|
|
|
|
+ @staticmethod
|
|
|
+ def get_online_model_detail():
|
|
|
+ client = EASClient.create_client()
|
|
|
+ runtime = util_models.RuntimeOptions()
|
|
|
+ headers = {}
|
|
|
+ try:
|
|
|
+ # 复制代码运行请自行打印 API 的返回值
|
|
|
+ res = client.describe_service_with_options('cn-hangzhou', SERVICE_NAME, headers, runtime)
|
|
|
+ return res.body.to_map()
|
|
|
+ except Exception as error:
|
|
|
+ # 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
|
|
+ # 错误 message
|
|
|
+ print(error.message)
|
|
|
+ # 诊断地址
|
|
|
+ print(error.data.get("Recommend"))
|
|
|
+ UtilClient.assert_as_string(error.message)
|
|
|
+
|
|
|
|
|
|
def exist_oss_directory_path(directory_path):
|
|
|
if not directory_path.endswith('/'):
|
|
@@ -120,6 +137,11 @@ def update_online_dnn_version(model_name: str, dt: str):
|
|
|
print(json.dumps(model_path_config))
|
|
|
online_model_update_res = EASClient.update_online_model_path(json.dumps(model_path_config))
|
|
|
if online_model_update_res.status_code == 200:
|
|
|
+ time.sleep(60)
|
|
|
+ status = EASClient.get_online_model_detail()['Status']
|
|
|
+ while status != 'Running':
|
|
|
+ time.sleep(60)
|
|
|
+ status = EASClient.get_online_model_detail()['Status']
|
|
|
cid_update_res = update_trained_cids_pointer(model_name, dt)
|
|
|
if cid_update_res.status_code == 200:
|
|
|
print('模型更新成功,cid配置更新成功')
|