@@ -7,7 +7,7 @@ | |||||
### 准备环境 | ### 准备环境 | ||||
安装如下软件环境。 | 安装如下软件环境。 | ||||
- OpenJDK:1.8+ | - OpenJDK:1.8+ | ||||
- Redis: 3.0+ | |||||
- Redis: 5.0+ | |||||
- Maven: 3.0+ | - Maven: 3.0+ | ||||
- MYSQL: 5.7.0+ | - MYSQL: 5.7.0+ | ||||
@@ -46,6 +46,9 @@ java -jar ./dubhe-admin/target/dubhe-admin-1.0-exec.jar --spring.profiles.active | |||||
## task模块 | ## task模块 | ||||
java -jar ./dubhe-task/target/dubhe-task-1.0.jar --spring.profiles.active=prod | java -jar ./dubhe-task/target/dubhe-task-1.0.jar --spring.profiles.active=prod | ||||
## serving gateway模块 | |||||
java -jar ./dubhe-serving-gateway/target/dubhe-serving-gateway.jar --spring.profiles.active=prod | |||||
``` | ``` | ||||
## 本地开发 | ## 本地开发 | ||||
@@ -80,6 +83,8 @@ java -jar ./dubhe-task/target/dubhe-task-1.0.jar --spring.profiles.active=prod | |||||
├── dubhe-model 模型管理模块 | ├── dubhe-model 模型管理模块 | ||||
├── dubhe-system 系统管理 | ├── dubhe-system 系统管理 | ||||
├── dubhe-task 定时任务模块 | ├── dubhe-task 定时任务模块 | ||||
├── dubhe-serving 云端serving模块 | |||||
├── dubhe-serving-gateway 云端serving gateway网关模块 | |||||
``` | ``` | ||||
## docker服务器 | ## docker服务器 | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -60,6 +60,18 @@ public class TrainJobConfig { | |||||
private String dockerModelPath; | private String dockerModelPath; | ||||
private String dockerTeacherModelPath; | |||||
private String dockerTeacherModelKey; | |||||
private String dockerStudentModelKey; | |||||
private String dockerStudentModelPath; | |||||
private String atlasAnaconda; | |||||
private String atlasPythonioencoding; | |||||
private String dockerValDatasetPath; | private String dockerValDatasetPath; | ||||
private String loadValDatasetKey; | private String loadValDatasetKey; | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -14,7 +14,7 @@ | |||||
* limitations under the License. | * limitations under the License. | ||||
* ============================================================= | * ============================================================= | ||||
*/ | */ | ||||
package org.dubhe.data.machine.constant; | |||||
package org.dubhe.constant; | |||||
/** | /** | ||||
* @description 状态机异常量类 | * @description 状态机异常量类 |
@@ -0,0 +1,128 @@ | |||||
/** | |||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.constant; | |||||
import lombok.Data; | |||||
import org.springframework.stereotype.Component; | |||||
/** | |||||
* @description 模型优化常量 | |||||
* @date 2020-05-25 | |||||
*/ | |||||
@Component | |||||
@Data | |||||
public class ModelOptConstant { | |||||
/** | |||||
* 模型优化任务结果字典 | |||||
*/ | |||||
public static final String TASK_RESULT_DICT_NAME = "opt_result"; | |||||
/** | |||||
* 数据集挂载路径 | |||||
*/ | |||||
public static final String DATASET_MOUNT_PATH = "/usr/local/dataset"; | |||||
/** | |||||
*算法挂载路径 | |||||
*/ | |||||
public static final String ALGORITHM_MOUNT_PATH = "/usr/local/algorithm"; | |||||
/** | |||||
*输入模型挂载路径 | |||||
*/ | |||||
public static final String INPUT_MODEL_BEFORE_MOUNT_PATH = "/usr/local/input/model"; | |||||
/** | |||||
*输出日志挂载路径 | |||||
*/ | |||||
public static final String OUTPUT_LOG_MOUNT_PATH = "/usr/local/output/log"; | |||||
/** | |||||
*压缩前评估结果挂载路径 | |||||
*/ | |||||
public static final String OUTPUT_RESULT_BEFORE_MOUNT_PATH = "/usr/local/output/result/before"; | |||||
/** | |||||
*输出模型挂载路径 | |||||
*/ | |||||
public static final String OUTPUT_MODEL_MOUNT_PATH = "/usr/local/output/model"; | |||||
/** | |||||
*压缩后评估结果挂载路径 | |||||
*/ | |||||
public static final String OUTPUT_RESULT_AFTER_MOUNT_PATH = "/usr/local/output/result/after"; | |||||
/** | |||||
* 使用的CPU配额 | |||||
*/ | |||||
public static final int CPU_NUM = 2048; | |||||
/** | |||||
* 使用的GPU配额 | |||||
*/ | |||||
public static final int GPU_NUM = 1; | |||||
/** | |||||
* 使用的内存配额 | |||||
*/ | |||||
public static final int MEMORY_NUM = 8000; | |||||
/** | |||||
* CNN剪枝算法启动命令 | |||||
*/ | |||||
public static final String OPT_START_SLIMMING_COMMAND = "cd /usr/local/algorithm && python run.py --prune_method=%s --model=%s --data_type=%s --dataset_dir=%s --model_save_dir=%s --log_dir=%s --before_result_dir=%s --after_result_dir=%s"; | |||||
/** | |||||
* 量化算法启动命令 | |||||
*/ | |||||
public static final String OPT_START_QUANTIFY_COMMAND = "cd /usr/local/algorithm && python3 of_cnn_evaluate.py --model=%s --model_load_dir=%s --val_data_dir=%s --log_dir=%s --result_dir=%s --use_tensorrt=False --use_int8_online=False && python3 of_cnn_evaluate.py --model=%s --model_load_dir=%s --val_data_dir=%s --log_dir=%s --result_dir=%s --use_tensorrt=True --use_int8_online=True"; | |||||
/** | |||||
* 非内置运行命令 | |||||
*/ | |||||
public static final String MY_OPT_COMMAND = "cd %s && %s"; | |||||
/** | |||||
* 模型优化结果日志路径 | |||||
*/ | |||||
public static final String OPTIMIZE_LOG = "/log"; | |||||
/** | |||||
* 模型优化结果保存模型路径 | |||||
*/ | |||||
public static final String OPTIMIZE_MODEL = "/model"; | |||||
/** | |||||
* 模型优化结果保存优化前模型评估参数 | |||||
*/ | |||||
public static final String OPTIMIZE_JSON_BEFORE = "/before"; | |||||
/** | |||||
* 模型优化结果保存优化后模型评估参数 | |||||
*/ | |||||
public static final String OPTIMIZE_JSON_AFTER = "/after"; | |||||
/** | |||||
* 模型优化结果JSON文件名称 | |||||
*/ | |||||
public static final String OPTIMIZE_JSON_NAME = "/results_eval.json"; | |||||
/** | |||||
* 我的压缩算法根路径 | |||||
*/ | |||||
public static final String MY_OPT_ALGORITHM_ROOT_PATH = "/model-opt/myAlgorithms/"; | |||||
/** | |||||
* 我的数据集 | |||||
*/ | |||||
public static final String MY_OPT_DATASET_ROOT_PATH = "/model-opt/myDataset/"; | |||||
/** | |||||
* 算法准确度名称 | |||||
*/ | |||||
public static final String ACCURACY = "accuracy"; | |||||
/** | |||||
* 复制模型后缀文件夹名称 | |||||
*/ | |||||
public static final String COPY_MODEL_POSTFIX = "/model"; | |||||
/** | |||||
* 基于神经元权重剪枝 | |||||
*/ | |||||
public static final String NEURONAL_PRUNING = "基于神经元权重剪枝"; | |||||
} |
@@ -0,0 +1,127 @@ | |||||
/** | |||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.constant; | |||||
import lombok.Getter; | |||||
import org.dubhe.exception.ErrorCode; | |||||
/** | |||||
* @description 模型优化错误码 | |||||
* @date 2020-05-22 | |||||
*/ | |||||
@Getter | |||||
public enum ModelOptErrorEnum implements ErrorCode { | |||||
/** | |||||
* 该模型优化任务不存在 | |||||
*/ | |||||
MODEL_OPT_TASK_ABSENT(1400, "该模型优化任务不存在"), | |||||
/** | |||||
* 该模型优化任务实例不存在 | |||||
*/ | |||||
MODEL_OPT_TASK_INSTANCE_ABSENT(1401, "该模型优化任务实例不存在"), | |||||
/** | |||||
* 模型优化任务实例创建失败 | |||||
*/ | |||||
MODEL_OPT_TASK_INSTANCE_CREATE_FAILED(1402, "模型优化任务实例创建失败"), | |||||
/** | |||||
* 模型优化任务名称已存在 | |||||
*/ | |||||
MODEL_OPT_TASK_NAME_EXIST(1403, "模型优化任务名称已存在"), | |||||
/** | |||||
* 该任务已存在等待或进行中的实例 | |||||
*/ | |||||
MODEL_OPT_TASK_INSTANCE_EXIST(1404, "该任务已存在等待或进行中的实例"), | |||||
/** | |||||
* 请先取消等待或进行中的实例 | |||||
*/ | |||||
MODEL_OPT_TASK_DELETE_ERROR(1405, "请先取消等待或进行中的实例"), | |||||
/** | |||||
* 请先添加模型优化结果字典 | |||||
*/ | |||||
MODEL_OPT_TASK_RESULT_DICT_EMPTY(1406, "请先添加模型优化结果字典"), | |||||
/** | |||||
* 模型压缩算法不存在 | |||||
*/ | |||||
MODEL_OPT_ALGORITHM_NOT_EXIST(1407, "模型压缩算法不存在"), | |||||
/** | |||||
* 任务未完成,不能下载 | |||||
*/ | |||||
MODEL_OPT_TASK_UNFINISHED(1408, "任务未完成,不能下载"), | |||||
/** | |||||
* 数据集不存在,请选择正确的数据集 | |||||
*/ | |||||
MODEL_OPT_DATASET_ABSENT(1409, "数据集不存在,请选择正确的数据集"), | |||||
/** | |||||
* 当前状态不能进行此操作 | |||||
*/ | |||||
MODEL_OPT_TASK_INSTANCE_STATUS_ERROR(1410, "当前状态不能进行此操作"), | |||||
/** | |||||
* 模型不存在 | |||||
*/ | |||||
MODEL_OPT_MODEL_NOT_EXIST(1411, "模型不存在"), | |||||
/** | |||||
* 请先登录 | |||||
*/ | |||||
NO_USER_LOGGED_IN(1412, "请先登录"), | |||||
/** | |||||
* 当前用户无此操作权限 | |||||
*/ | |||||
NO_PERMISSION(1413, "当前用户无此操作权限"), | |||||
/** | |||||
* 内部错误 | |||||
*/ | |||||
INTERNAL_SERVER_ERROR(1414, "内部错误"), | |||||
/** | |||||
* 字典参数不存在,请先添加字典 | |||||
*/ | |||||
PARAM_DICT_NOT_EXIST(1415, "字典参数不存在,请先添加字典"), | |||||
/** | |||||
* 无可用镜像,请先在字典中配置镜像 | |||||
*/ | |||||
IMAGES_DICT_NOT_EXIST(1416, "无可用镜像,请先在字典中配置镜像"), | |||||
/** | |||||
* 容器启动失败 | |||||
*/ | |||||
CONTAINER_START_FAILED(1417, "容器启动失败"), | |||||
/** | |||||
* 数据集名称已存在 | |||||
*/ | |||||
DATASET_NAME_EXIST(1418, "数据集名称已存在"); | |||||
private Integer code; | |||||
private String msg; | |||||
ModelOptErrorEnum(Integer code, String msg) { | |||||
this.code = code; | |||||
this.msg = msg; | |||||
} | |||||
} |
@@ -0,0 +1,46 @@ | |||||
/** | |||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.constant; | |||||
import lombok.Getter; | |||||
/** | |||||
* @description 模型优化常量 | |||||
* @date 2020-05-22 | |||||
*/ | |||||
@Getter | |||||
public enum ModelOptInstanceStatusEnum { | |||||
/** | |||||
* 模型优化任务状态 | |||||
*/ | |||||
WAITING("-1", "等待中"), | |||||
RUNNING("0", "进行中"), | |||||
COMPLETED("1", "已完成"), | |||||
CANCELED("2", "已取消"), | |||||
EXEC_FAILED("3", "执行失败"), | |||||
; | |||||
private String value; | |||||
private String msg; | |||||
ModelOptInstanceStatusEnum(String value, String msg) { | |||||
this.value = value; | |||||
this.msg = msg; | |||||
} | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -27,15 +27,22 @@ public class NumberConstant { | |||||
public final static int NUMBER_1 = 1; | public final static int NUMBER_1 = 1; | ||||
public final static int NUMBER_2 = 2; | public final static int NUMBER_2 = 2; | ||||
public final static int NUMBER_3 = 3; | public final static int NUMBER_3 = 3; | ||||
public final static int NUMBER_4 = 4; | |||||
public final static int NUMBER_5 = 5; | public final static int NUMBER_5 = 5; | ||||
public final static int NUMBER_6 = 6; | |||||
public final static int NUMBER_8 = 8; | |||||
public final static int NUMBER_10 = 10; | public final static int NUMBER_10 = 10; | ||||
public final static int NUMBER_25 = 25; | |||||
public final static int NUMBER_30 = 30; | public final static int NUMBER_30 = 30; | ||||
public final static int NUMBER_50 = 50; | public final static int NUMBER_50 = 50; | ||||
public final static int NUMBER_60 = 60; | public final static int NUMBER_60 = 60; | ||||
public final static int NUMBER_1024 = 1024; | public final static int NUMBER_1024 = 1024; | ||||
public final static int NUMBER_1000 = 1000; | public final static int NUMBER_1000 = 1000; | ||||
public final static int NUMBER_100 = 100; | |||||
public final static int HOUR_SECOND = 60 * 60; | public final static int HOUR_SECOND = 60 * 60; | ||||
public final static int DAY_SECOND = 60 * 60 * 24; | public final static int DAY_SECOND = 60 * 60 * 24; | ||||
public final static int WEEK_SECOND = 60 * 60 * 24 * 7; | public final static int WEEK_SECOND = 60 * 60 * 24 * 7; | ||||
public final static int MAX_PAGE_SIZE = 2000; | public final static int MAX_PAGE_SIZE = 2000; | ||||
public final static int MAX_MESSAGE_LENGTH = 1024 * 1024 * 1024; | |||||
} | } |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -48,6 +48,7 @@ public final class Permissions { | |||||
*/ | */ | ||||
public static final String MODEL = "model"; | public static final String MODEL = "model"; | ||||
public static final String MODEL_MODEL = "model:model"; | public static final String MODEL_MODEL = "model:model"; | ||||
public static final String MODEL_OPTIMIZE = "model:optimize"; | |||||
/** | /** | ||||
* 控制台 | * 控制台 | ||||
@@ -61,6 +62,13 @@ public final class Permissions { | |||||
public static final String SYSTEM_LOG = "system:log"; | public static final String SYSTEM_LOG = "system:log"; | ||||
public static final String SYSTEM_TEAM = "system:team"; | public static final String SYSTEM_TEAM = "system:team"; | ||||
/** | |||||
* 云端Serving | |||||
*/ | |||||
public static final String SERVING = "serving"; | |||||
public static final String SERVING_DEPLOYMENT = "serving:deployment"; | |||||
public static final String SERVING_BATCH = "serving:batch"; | |||||
private Permissions() { | private Permissions() { | ||||
} | } | ||||
} | } |
@@ -0,0 +1,48 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.constant; | |||||
import org.dubhe.base.MagicNumConstant; | |||||
/** | |||||
* @description redis 常量 | |||||
* @date 2020-12-17 | |||||
*/ | |||||
public class RedisConstants { | |||||
/** | |||||
* 分布式锁过期时间 | |||||
*/ | |||||
public static final Long DELAY_CUD_RESOURCE_EXPIRE_TIME = MagicNumConstant.TEN_LONG; | |||||
/** | |||||
* 分布式锁 | |||||
*/ | |||||
public static final String DELAY_CUD_RESOURCE_KEY = "k8sclient:task:k8s_delay_cud_resource"; | |||||
/** | |||||
* 延时启动队列 | |||||
*/ | |||||
public static final String DELAY_APPLY_ZSET_KEY = "k8sclient:task:delay_apply_zset"; | |||||
/** | |||||
* 延时停止队列 | |||||
*/ | |||||
public static final String DELAY_STOP_ZSET_KEY = "k8sclient:task:delay_stop_zset"; | |||||
/** | |||||
* 延时队列值 | |||||
*/ | |||||
public static final String DELAY_ZSET_VALUE = "%s__%s"; | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -17,6 +17,8 @@ | |||||
package org.dubhe.constant; | package org.dubhe.constant; | ||||
import java.util.regex.Pattern; | |||||
/** | /** | ||||
* @description 字符串constant | * @description 字符串constant | ||||
* @date 2020-05-14 | * @date 2020-05-14 | ||||
@@ -27,6 +29,16 @@ public final class StringConstant { | |||||
public static final String MOZILLA = "Mozilla"; | public static final String MOZILLA = "Mozilla"; | ||||
public static final String REQUEST_METHOD_GET = "GET"; | public static final String REQUEST_METHOD_GET = "GET"; | ||||
/** | |||||
* 字母、数字、英文横杠和下划线匹配 | |||||
*/ | |||||
public static final String REGEXP = "^[a-zA-Z0-9\\-\\_\\u4e00-\\u9fa5]+$"; | |||||
/** | |||||
* 整数匹配 | |||||
*/ | |||||
public static final Pattern PATTERN_NUM = Pattern.compile("^[-\\+]?[\\d]*$"); | |||||
/** | /** | ||||
* 公共字段 | * 公共字段 | ||||
*/ | */ | ||||
@@ -39,7 +51,27 @@ public final class StringConstant { | |||||
public static final String UTF8 = "utf-8"; | public static final String UTF8 = "utf-8"; | ||||
public static final String JSON_REQUEST = "application/json"; | public static final String JSON_REQUEST = "application/json"; | ||||
public static final String K8S_CALLBACK_URI = "/api/k8s/callback/pod"; | public static final String K8S_CALLBACK_URI = "/api/k8s/callback/pod"; | ||||
public static final String K8S_CALLBACK_PATH_DEPLOYMENT = "/api/k8s/callback/deployment"; | |||||
public static final String MULTIPART = "multipart/form-data"; | public static final String MULTIPART = "multipart/form-data"; | ||||
/** | |||||
* 分页内容 | |||||
*/ | |||||
public static final String RESULT = "result"; | |||||
/** | |||||
* 排序规则 | |||||
*/ | |||||
public static final String SORT_ASC = "asc"; | |||||
public static final String SORT_DESC = "desc"; | |||||
public static final String QUERY = "query"; | |||||
public static final String NGINX_LOWERCASE = "nginx"; | |||||
public static final String TRUE_LOWERCASE = "true"; | |||||
public static final String GRPC_CAPITALIZE = "GRPC"; | |||||
/** | /** | ||||
* 测试环境 | * 测试环境 | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -33,14 +33,20 @@ public class SymbolConstant { | |||||
public static final String TOKEN = "token"; | public static final String TOKEN = "token"; | ||||
public static final String GET = "get"; | public static final String GET = "get"; | ||||
public static final String SET = "set"; | public static final String SET = "set"; | ||||
public static final String HTTP = "http"; | |||||
public static final String GRPC = "grpc"; | |||||
public static final String BRACKETS = "{}"; | public static final String BRACKETS = "{}"; | ||||
public static final String BACKSLASH = "\\"; | public static final String BACKSLASH = "\\"; | ||||
public static final String BACKSLASH_MARK= "\\\""; | public static final String BACKSLASH_MARK= "\\\""; | ||||
public static final String DOUBLE_MARK= "\"\""; | public static final String DOUBLE_MARK= "\"\""; | ||||
public static final String MARK= "\""; | public static final String MARK= "\""; | ||||
public static final String FLAG_EQUAL = "="; | public static final String FLAG_EQUAL = "="; | ||||
public static final String LEFT_PARENTHESIS = "["; | |||||
public static final String RIGHT_PARENTHESIS = "]"; | |||||
public static final String APOSTROPHE = "'"; | |||||
public static final String HYPHEN = "-"; | |||||
public static final String EVENT_SEPARATOR = "&&"; | |||||
public static final String POST = "POST"; | |||||
private SymbolConstant() { | private SymbolConstant() { | ||||
} | } | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -14,7 +14,7 @@ | |||||
* limitations under the License. | * limitations under the License. | ||||
* ============================================================= | * ============================================================= | ||||
*/ | */ | ||||
package org.dubhe.data.machine.dto; | |||||
package org.dubhe.dto; | |||||
import lombok.*; | import lombok.*; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -0,0 +1,82 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.dto.callback; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
/** | |||||
* @descripton 统一通用参数实现与校验 | |||||
* @date 2020-11-26 | |||||
*/ | |||||
@ApiModel(description = "k8s deployment异步回调基类") | |||||
@Data | |||||
public class BaseK8sDeploymentCallbackCreateDTO { | |||||
@ApiModelProperty(required = true, value = "k8s namespace") | |||||
@NotBlank(message = "namespace 不能为空!") | |||||
private String namespace; | |||||
@ApiModelProperty(required = true, value = "k8s resource name") | |||||
@NotBlank(message = "resourceName 不能为空!") | |||||
private String resourceName; | |||||
@ApiModelProperty(required = true, value = "k8s deployment name") | |||||
@NotBlank(message = "deployment 不能为空!") | |||||
private String deploymentName; | |||||
/** | |||||
* deployment已 Running的pod数 | |||||
*/ | |||||
@ApiModelProperty(required = true, value = "k8s deployment readyReplicas") | |||||
@NotNull(message = "readyReplicas 不能为空!") | |||||
private Integer readyReplicas; | |||||
/** | |||||
* deployment总pod数 | |||||
*/ | |||||
@ApiModelProperty(required = true, value = "k8s deployment replicas") | |||||
@NotNull(message = "replicas 不能为空!") | |||||
private Integer replicas; | |||||
public BaseK8sDeploymentCallbackCreateDTO() { | |||||
} | |||||
public BaseK8sDeploymentCallbackCreateDTO(String namespace, String resourceName, String deploymentName, Integer readyReplicas, Integer replicas) { | |||||
this.namespace = namespace; | |||||
this.resourceName = resourceName; | |||||
this.deploymentName = deploymentName; | |||||
this.readyReplicas = readyReplicas; | |||||
this.replicas = replicas; | |||||
} | |||||
@Override | |||||
public String toString() { | |||||
return "BaseK8sDeploymentCallbackCreateDTO{" + | |||||
"namespace='" + namespace + '\'' + | |||||
", resourceName='" + resourceName + '\'' + | |||||
", deploymentName='" + deploymentName + '\'' + | |||||
", readyReplicas='" + readyReplicas + '\'' + | |||||
", replicas='" + replicas + '\'' + | |||||
'}'; | |||||
} | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -0,0 +1,35 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.dto.callback; | |||||
import io.swagger.annotations.ApiModel; | |||||
import lombok.Data; | |||||
/** | |||||
* @description k8s pod异步回调云端serving | |||||
* @date 2020-11-27 | |||||
*/ | |||||
@ApiModel(description = "k8s pod异步回调云端serving") | |||||
@Data | |||||
public class BatchServingK8sPodCallbackCreateDTO extends BaseK8sPodCallbackCreateDTO { | |||||
@Override | |||||
public String toString() { | |||||
return super.toString(); | |||||
} | |||||
} |
@@ -0,0 +1,30 @@ | |||||
/** | |||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.dto.callback; | |||||
import io.swagger.annotations.ApiModel; | |||||
import lombok.Data; | |||||
/** | |||||
* @description 模型优化自定义回调参数类 | |||||
* @date 2020-06-03 | |||||
*/ | |||||
@ApiModel(description = "k8s pod异步回调Algorithm") | |||||
@Data | |||||
public class ModelOptK8sPodCallbackCreateDTO extends BaseK8sPodCallbackCreateDTO { | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -0,0 +1,34 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.dto.callback; | |||||
import io.swagger.annotations.ApiModel; | |||||
import lombok.Data; | |||||
/** | |||||
* @description k8s deployment异步回调云端serving | |||||
* @date 2020-09-16 | |||||
*/ | |||||
@ApiModel(description = "k8s deployment异步回调云端serving") | |||||
@Data | |||||
public class ServingK8sDeploymentCallbackCreateDTO extends BaseK8sDeploymentCallbackCreateDTO { | |||||
@Override | |||||
public String toString() { | |||||
return super.toString(); | |||||
} | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -32,15 +32,32 @@ public enum BizEnum { | |||||
/** | /** | ||||
* 模型开发 | * 模型开发 | ||||
*/ | */ | ||||
NOTEBOOK("模型开发","notebook",0), | |||||
NOTEBOOK("模型开发", "notebook", 0), | |||||
/** | /** | ||||
* 算法管理 | * 算法管理 | ||||
*/ | */ | ||||
ALGORITHM("算法管理","algorithm",1), | |||||
ALGORITHM("算法管理", "algorithm", 1), | |||||
/** | /** | ||||
* 模型管理 | * 模型管理 | ||||
*/ | */ | ||||
MODEL("模型管理","model",2), | |||||
MODEL("模型管理", "model", 2), | |||||
/** | |||||
* 训练管理 | |||||
*/ | |||||
TRAIN("训练管理", "train", 3), | |||||
/** | |||||
* 云端Serving-在线服务 | |||||
*/ | |||||
SERVING("云端Serving", "serving", 4), | |||||
/** | |||||
* 批量服务 | |||||
*/ | |||||
BATCH_SERVING("批量服务", "batchserving", 5), | |||||
/** | |||||
* 模型优化 | |||||
*/ | |||||
MODEL_OPT("模型优化管理","modelopt",6), | |||||
; | ; | ||||
/** | /** | ||||
@@ -56,28 +73,42 @@ public enum BizEnum { | |||||
*/ | */ | ||||
private Integer createResource; | private Integer createResource; | ||||
BizEnum(String bizName,String bizCode, Integer createResource) { | |||||
BizEnum(String bizName, String bizCode, Integer createResource) { | |||||
this.createResource = createResource; | this.createResource = createResource; | ||||
this.bizName = bizName; | this.bizName = bizName; | ||||
this.bizCode = bizCode; | this.bizCode = bizCode; | ||||
} | } | ||||
private static final Map<Integer,BizEnum> RESOURCE_ENUM_MAP = new HashMap<Integer,BizEnum>(){ | |||||
private static final Map<Integer, BizEnum> RESOURCE_ENUM_MAP = new HashMap<Integer, BizEnum>() { | |||||
{ | { | ||||
for (BizEnum enums:BizEnum.values()){ | |||||
put(enums.getCreateResource(),enums); | |||||
for (BizEnum enums : BizEnum.values()) { | |||||
put(enums.getCreateResource(), enums); | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
* 根据createResource获取BizEnum | * 根据createResource获取BizEnum | ||||
* @param createResource | |||||
* @return | |||||
* @param createResource 业务源代号 | |||||
* @return 枚举对象 | |||||
*/ | */ | ||||
public static BizEnum getByCreateResource(int createResource){ | |||||
public static BizEnum getByCreateResource(int createResource) { | |||||
return RESOURCE_ENUM_MAP.get(createResource); | return RESOURCE_ENUM_MAP.get(createResource); | ||||
} | } | ||||
/** | |||||
* 根据createResource获取code | |||||
* | |||||
* @param createResource 业务源代号 | |||||
* @return String 业务模块名称 | |||||
*/ | |||||
public static String getCodeByResource(Integer createResource) { | |||||
for (BizEnum enums : BizEnum.values()) { | |||||
if (enums.getCreateResource().equals(createResource)) { | |||||
return enums.getBizCode(); | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} | } |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -37,6 +37,10 @@ public enum BizNfsEnum { | |||||
* 模型管理 NFS 路径命名 | * 模型管理 NFS 路径命名 | ||||
*/ | */ | ||||
MODEL(BizEnum.MODEL, "model"), | MODEL(BizEnum.MODEL, "model"), | ||||
/** | |||||
* 模型优化 NFS 路径命名 | |||||
*/ | |||||
MODEL_OPT(BizEnum.MODEL_OPT, "model-opt"), | |||||
; | ; | ||||
BizNfsEnum(BizEnum bizEnum, String bizNfsPath) { | BizNfsEnum(BizEnum bizEnum, String bizNfsPath) { | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -14,7 +14,7 @@ | |||||
* limitations under the License. | * limitations under the License. | ||||
* ============================================================= | * ============================================================= | ||||
*/ | */ | ||||
package org.dubhe.enums; | package org.dubhe.enums; | ||||
/** | /** |
@@ -0,0 +1,92 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.enums; | |||||
import lombok.Getter; | |||||
import java.util.HashMap; | |||||
import java.util.Map; | |||||
/** | |||||
* @description 镜像项目枚举类 | |||||
* @date 2020-12-11 | |||||
*/ | |||||
@Getter | |||||
public enum ImageTypeEnum { | |||||
/** | |||||
* notebook镜像 | |||||
*/ | |||||
NOTEBOOK("notebook镜像", "notebook", 0), | |||||
/** | |||||
* 训练镜像 | |||||
*/ | |||||
TRAIN("训练镜像", "train", 1); | |||||
/** | |||||
* 镜像项目名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 镜像项目代码 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 镜像项目类型 | |||||
*/ | |||||
private Integer type; | |||||
ImageTypeEnum(String name, String code, Integer type) { | |||||
this.name = name; | |||||
this.code = code; | |||||
this.type = type; | |||||
} | |||||
private static final Map<Integer, ImageTypeEnum> RESOURCE_ENUM_MAP = new HashMap<Integer, ImageTypeEnum>() { | |||||
{ | |||||
for (ImageTypeEnum enums : ImageTypeEnum.values()) { | |||||
put(enums.getType(), enums); | |||||
} | |||||
} | |||||
}; | |||||
/** | |||||
* 根据type获取ImageTypeEnum | |||||
* @param type | |||||
* @return 镜像项目枚举对象 | |||||
*/ | |||||
public static ImageTypeEnum getType(int type) { | |||||
return RESOURCE_ENUM_MAP.get(type); | |||||
} | |||||
/** | |||||
* 根据type获取code | |||||
* | |||||
* @param type 镜像项目类型 | |||||
* @return String 镜像项目代码 | |||||
*/ | |||||
public static String getType(Integer type) { | |||||
for (ImageTypeEnum enums : ImageTypeEnum.values()) { | |||||
if (enums.getType().equals(type)) { | |||||
return enums.getCode(); | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -38,6 +38,8 @@ public enum LogEnum { | |||||
BIZ_SYS, | BIZ_SYS, | ||||
// 模型模块 | // 模型模块 | ||||
BIZ_MODEL, | BIZ_MODEL, | ||||
// 模型优化 | |||||
MODEL_OPT, | |||||
// 数据集模块 | // 数据集模块 | ||||
BIZ_DATASET, | BIZ_DATASET, | ||||
// k8s模块 | // k8s模块 | ||||
@@ -50,19 +52,26 @@ public enum LogEnum { | |||||
LOCAL_FILE_UTIL, | LOCAL_FILE_UTIL, | ||||
//FILE UTILS | //FILE UTILS | ||||
FILE_UTIL, | FILE_UTIL, | ||||
// 云端Serving模块 | |||||
SERVING, | |||||
//FILE UTILS | //FILE UTILS | ||||
UPLOAD_TEMP, | UPLOAD_TEMP, | ||||
//STATE MACHINE | //STATE MACHINE | ||||
STATE_MACHINE, | STATE_MACHINE, | ||||
//全局垃圾回收 | //全局垃圾回收 | ||||
GARBAGE_RECYCLE, | GARBAGE_RECYCLE, | ||||
//DATA_SEQUENCE | |||||
DATA_SEQUENCE, | |||||
//IO UTIL | //IO UTIL | ||||
IO_UTIL, | IO_UTIL, | ||||
//DATA_SEQUENCE | |||||
DATA_SEQUENCE, | |||||
// 日志切面 | // 日志切面 | ||||
LOG_ASPECT | |||||
LOG_ASPECT, | |||||
//镜像 | |||||
IMAGE, | |||||
//度量 | |||||
MEASURE; | |||||
; | ; | ||||
/** | /** | ||||
* 判断日志类型不能为空 | * 判断日志类型不能为空 | ||||
* | * | ||||
@@ -0,0 +1,66 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.enums; | |||||
import lombok.Getter; | |||||
/** | |||||
* @description 模型资源枚举类 | |||||
* @date 2020-11-19 | |||||
*/ | |||||
@Getter | |||||
public enum ModelResourceEnum { | |||||
/** | |||||
* 我的模型 | |||||
*/ | |||||
MINE(0, "我的模型"), | |||||
/** | |||||
* 预置模型 | |||||
*/ | |||||
PRESET(1, "预置模型"), | |||||
/** | |||||
* 炼知模型 | |||||
*/ | |||||
ATLAS(2, "炼知模型"); | |||||
private Integer type; | |||||
private String description; | |||||
ModelResourceEnum(Integer type, String description) { | |||||
this.type = type; | |||||
this.description = description; | |||||
} | |||||
/** | |||||
* 根据类型获取枚举类对象 | |||||
* | |||||
* @param type 类型 | |||||
* @return 枚举类对象 | |||||
*/ | |||||
public static ModelResourceEnum getType(Integer type) { | |||||
for (ModelResourceEnum modelResourceEnum : values()) { | |||||
if (modelResourceEnum.getType().compareTo(type) == 0) { | |||||
//获取指定的枚举 | |||||
return modelResourceEnum; | |||||
} | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -33,10 +33,20 @@ public enum RecycleResourceEnum { | |||||
* 数据集文件回收 | * 数据集文件回收 | ||||
*/ | */ | ||||
DATASET_RECYCLE_FILE("datasetRecycleFile", "数据集文件回收"), | DATASET_RECYCLE_FILE("datasetRecycleFile", "数据集文件回收"), | ||||
/** | |||||
* 医学数据集文件回收 | |||||
*/ | |||||
DATAMEDICINE_RECYCLE_FILE("dataMedicineRecycleFile", "数据集文件回收"), | |||||
/** | /** | ||||
* 数据集版本文件回收 | * 数据集版本文件回收 | ||||
*/ | */ | ||||
DATASET_RECYCLE_VERSION_FILE("datasetRecycleVersionFile", "数据集版本文件回收"), | DATASET_RECYCLE_VERSION_FILE("datasetRecycleVersionFile", "数据集版本文件回收"), | ||||
/** | |||||
* 云端Serving输入文件回收 | |||||
*/ | |||||
SERVING_RECYCLE_FILE("servingRecycleFile", "云端Serving文件回收"), | |||||
; | ; | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -14,10 +14,9 @@ | |||||
* limitations under the License. | * limitations under the License. | ||||
* ============================================================= | * ============================================================= | ||||
*/ | */ | ||||
package org.dubhe.data.exception; | |||||
package org.dubhe.exception; | |||||
import lombok.Getter; | import lombok.Getter; | ||||
import org.dubhe.exception.BusinessException; | |||||
/** | /** | ||||
* @description 状态机异常类 | * @description 状态机异常类 |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -18,10 +18,10 @@ package org.dubhe.factory; | |||||
import org.dubhe.base.DataResponseBody; | import org.dubhe.base.DataResponseBody; | ||||
import org.dubhe.base.ResponseCode; | import org.dubhe.base.ResponseCode; | ||||
/** | /** | ||||
* @desc DataResponseBody 工厂类 | |||||
* | |||||
* @date 2020.05.28 | |||||
* @description DataResponseBody 工厂类 | |||||
* @date 2020-03-16 | |||||
*/ | */ | ||||
public class DataResponseFactory { | public class DataResponseFactory { | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -20,10 +20,7 @@ package org.dubhe.utils; | |||||
import java.sql.Timestamp; | import java.sql.Timestamp; | ||||
import java.text.DateFormat; | import java.text.DateFormat; | ||||
import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
import java.time.Instant; | |||||
import java.time.LocalDate; | |||||
import java.time.LocalDateTime; | |||||
import java.time.ZoneId; | |||||
import java.time.*; | |||||
import java.util.Date; | import java.util.Date; | ||||
/** | /** | ||||
@@ -95,4 +92,25 @@ public class DateUtil { | |||||
return dateFormat.format(date); | return dateFormat.format(date); | ||||
} | } | ||||
/** | |||||
* | |||||
* @return 当前字符串时间yyyyMMddHHmmss | |||||
*/ | |||||
public static String getTimestampStr() { | |||||
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS"); | |||||
return df.format(System.currentTimeMillis()); | |||||
} | |||||
/** | |||||
* 获取当前时间与目标时间相差秒数 | |||||
* @param timestamp 目标时间 | |||||
* @return | |||||
*/ | |||||
public static long getSeconds(Timestamp timestamp) { | |||||
LocalDateTime time = timestamp.toLocalDateTime(); | |||||
LocalDateTime now = LocalDateTime.now(); | |||||
Duration duration = Duration.between(time, now); | |||||
return duration.abs().getSeconds(); | |||||
} | |||||
} | } |
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -1,5 +1,5 @@ | |||||
/** | /** | ||||
* Copyright 2020 Zhejiang Lab. All Rights Reserved. | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||