Browse Source

update dubhe-server

tags/v0.3.0
之江实验室 3 years ago
parent
commit
6ec16a8013
100 changed files with 945 additions and 116 deletions
  1. +6
    -1
      dubhe-server/README.md
  2. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/ApiVersion.java
  3. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/DataPermission.java
  4. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/DataPermissionMethod.java
  5. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/EnumValue.java
  6. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/FlagValidator.java
  7. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/annotation/RateLimit.java
  8. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/aspect/PermissionAspect.java
  9. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/BaseDTO.java
  10. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/BaseEntity.java
  11. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/BaseImageDTO.java
  12. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/BaseService.java
  13. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/BaseVO.java
  14. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/DataContext.java
  15. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/DataResponseBody.java
  16. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/MagicNumConstant.java
  17. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/PageQueryBase.java
  18. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/ResponseCode.java
  19. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/base/ScheduleTaskHandler.java
  20. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/K8sNameConfig.java
  21. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/LocalDateTimeSerializerConfig.java
  22. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/MetaHandlerConfig.java
  23. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/MybatisPlusConfig.java
  24. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/NfsConfig.java
  25. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/RecycleConfig.java
  26. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/RedisConfig.java
  27. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/Resources.java
  28. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/SecurityConfig.java
  29. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/SwaggerConfig.java
  30. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/TrainHarborConfig.java
  31. +13
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/TrainJobConfig.java
  32. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/TrainPoolConfig.java
  33. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/WebMvcConfig.java
  34. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/config/WebMvcRegistrationsConfig.java
  35. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/AlgorithmSourceEnum.java
  36. +2
    -2
      dubhe-server/common/src/main/java/org/dubhe/constant/ErrorMessageConstant.java
  37. +128
    -0
      dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptConstant.java
  38. +127
    -0
      dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptErrorEnum.java
  39. +46
    -0
      dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptInstanceStatusEnum.java
  40. +8
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/NumberConstant.java
  41. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/PermissionConstant.java
  42. +9
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/Permissions.java
  43. +48
    -0
      dubhe-server/common/src/main/java/org/dubhe/constant/RedisConstants.java
  44. +33
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/StringConstant.java
  45. +9
    -3
      dubhe-server/common/src/main/java/org/dubhe/constant/SymbolConstant.java
  46. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/TrainAlgorithmConstant.java
  47. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/constant/UserAuxiliaryInfoConstant.java
  48. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/domain/dto/CommonPermissionDataDTO.java
  49. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/domain/entity/LogInfo.java
  50. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/domain/entity/Team.java
  51. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/domain/entity/TeamUserRole.java
  52. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/dto/GlobalRequestRecordDTO.java
  53. +2
    -2
      dubhe-server/common/src/main/java/org/dubhe/dto/StateChangeDTO.java
  54. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/AlgorithmK8sPodCallbackCreateDTO.java
  55. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/AllK8sPodCallbackCreateDTO.java
  56. +82
    -0
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/BaseK8sDeploymentCallbackCreateDTO.java
  57. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/BaseK8sPodCallbackCreateDTO.java
  58. +35
    -0
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/BatchServingK8sPodCallbackCreateDTO.java
  59. +30
    -0
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/ModelOptK8sPodCallbackCreateDTO.java
  60. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/NotebookK8sPodCallbackCreateDTO.java
  61. +34
    -0
      dubhe-server/common/src/main/java/org/dubhe/dto/callback/ServingK8sDeploymentCallbackCreateDTO.java
  62. +42
    -11
      dubhe-server/common/src/main/java/org/dubhe/enums/BizEnum.java
  63. +5
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/BizNfsEnum.java
  64. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/DatasetTypeEnum.java
  65. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/ImageSourceEnum.java
  66. +2
    -2
      dubhe-server/common/src/main/java/org/dubhe/enums/ImageStateEnum.java
  67. +92
    -0
      dubhe-server/common/src/main/java/org/dubhe/enums/ImageTypeEnum.java
  68. +13
    -4
      dubhe-server/common/src/main/java/org/dubhe/enums/LogEnum.java
  69. +66
    -0
      dubhe-server/common/src/main/java/org/dubhe/enums/ModelResourceEnum.java
  70. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/OperationTypeEnum.java
  71. +11
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/RecycleResourceEnum.java
  72. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/SwitchEnum.java
  73. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/enums/TrainJobStatusEnum.java
  74. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/BaseErrorCode.java
  75. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/BusinessException.java
  76. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/CaptchaException.java
  77. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/DataSequenceException.java
  78. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/DockerBizException.java
  79. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/ErrorCode.java
  80. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/NfsBizException.java
  81. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/NotebookBizException.java
  82. +2
    -3
      dubhe-server/common/src/main/java/org/dubhe/exception/StateMachineException.java
  83. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/UnauthorizedException.java
  84. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/exception/handler/GlobalExceptionHandler.java
  85. +3
    -3
      dubhe-server/common/src/main/java/org/dubhe/factory/DataResponseFactory.java
  86. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/filter/BaseLogFilter.java
  87. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/filter/ConsoleLogFilter.java
  88. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/filter/GlobalRequestLogFilter.java
  89. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/handle/ApiVersionCondition.java
  90. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/handle/CustomRequestMappingHandlerMapping.java
  91. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/interceptor/K8sCallBackPodInterceptor.java
  92. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/interceptor/MySqlInterceptor.java
  93. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/interceptor/PaginationInterceptor.java
  94. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/AesUtil.java
  95. +23
    -5
      dubhe-server/common/src/main/java/org/dubhe/utils/DateUtil.java
  96. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/DubheDateUtil.java
  97. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/EncryptUtils.java
  98. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/FileUtil.java
  99. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/HttpClientUtils.java
  100. +1
    -1
      dubhe-server/common/src/main/java/org/dubhe/utils/HttpUtils.java

+ 6
- 1
dubhe-server/README.md View File

@@ -7,7 +7,7 @@
### 准备环境
安装如下软件环境。
- OpenJDK:1.8+
- Redis: 3.0+
- Redis: 5.0+
- Maven: 3.0+
- MYSQL: 5.7.0+

@@ -46,6 +46,9 @@ java -jar ./dubhe-admin/target/dubhe-admin-1.0-exec.jar --spring.profiles.active

## task模块
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-system 系统管理
├── dubhe-task 定时任务模块
├── dubhe-serving 云端serving模块
├── dubhe-serving-gateway 云端serving gateway网关模块
```

## docker服务器


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/ApiVersion.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/DataPermission.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/DataPermissionMethod.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/EnumValue.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/FlagValidator.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/annotation/RateLimit.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/aspect/PermissionAspect.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/BaseDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/BaseEntity.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/BaseImageDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/BaseService.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/BaseVO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/DataContext.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/DataResponseBody.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/MagicNumConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/PageQueryBase.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/ResponseCode.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/base/ScheduleTaskHandler.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/K8sNameConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/LocalDateTimeSerializerConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/MetaHandlerConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/MybatisPlusConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/NfsConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/RecycleConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/RedisConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/Resources.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/SecurityConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/SwaggerConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/TrainHarborConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 13
- 1
dubhe-server/common/src/main/java/org/dubhe/config/TrainJobConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -60,6 +60,18 @@ public class TrainJobConfig {

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 loadValDatasetKey;


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/TrainPoolConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/WebMvcConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/config/WebMvcRegistrationsConfig.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/AlgorithmSourceEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.


dubhe-server/dubhe-data/src/main/java/org/dubhe/data/machine/constant/ErrorMessageConstant.java → dubhe-server/common/src/main/java/org/dubhe/constant/ErrorMessageConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
* =============================================================
*/
package org.dubhe.data.machine.constant;
package org.dubhe.constant;

/**
* @description 状态机异常量类

+ 128
- 0
dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptConstant.java View File

@@ -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 = "基于神经元权重剪枝";

}

+ 127
- 0
dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptErrorEnum.java View File

@@ -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;
}
}

+ 46
- 0
dubhe-server/common/src/main/java/org/dubhe/constant/ModelOptInstanceStatusEnum.java View File

@@ -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;
}
}

+ 8
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/NumberConstant.java View File

@@ -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");
* 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_2 = 2;
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_6 = 6;
public final static int NUMBER_8 = 8;
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_50 = 50;
public final static int NUMBER_60 = 60;
public final static int NUMBER_1024 = 1024;
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 DAY_SECOND = 60 * 60 * 24;
public final static int WEEK_SECOND = 60 * 60 * 24 * 7;
public final static int MAX_PAGE_SIZE = 2000;
public final static int MAX_MESSAGE_LENGTH = 1024 * 1024 * 1024;

}

+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/PermissionConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 9
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/Permissions.java View File

@@ -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");
* 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 = "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_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() {
}
}

+ 48
- 0
dubhe-server/common/src/main/java/org/dubhe/constant/RedisConstants.java View File

@@ -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";
}

+ 33
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/StringConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@

package org.dubhe.constant;

import java.util.regex.Pattern;

/**
* @description 字符串constant
* @date 2020-05-14
@@ -27,6 +29,16 @@ public final class StringConstant {
public static final String MOZILLA = "Mozilla";
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 JSON_REQUEST = "application/json";
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 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";


/**
* 测试环境


+ 9
- 3
dubhe-server/common/src/main/java/org/dubhe/constant/SymbolConstant.java View File

@@ -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");
* 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 GET = "get";
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 BACKSLASH = "\\";
public static final String BACKSLASH_MARK= "\\\"";
public static final String DOUBLE_MARK= "\"\"";
public static final String MARK= "\"";

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() {
}


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/TrainAlgorithmConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/constant/UserAuxiliaryInfoConstant.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/domain/dto/CommonPermissionDataDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/domain/entity/LogInfo.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/domain/entity/Team.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/domain/entity/TeamUserRole.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/dto/GlobalRequestRecordDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


dubhe-server/dubhe-data/src/main/java/org/dubhe/data/machine/dto/StateChangeDTO.java → dubhe-server/common/src/main/java/org/dubhe/dto/StateChangeDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
* =============================================================
*/
package org.dubhe.data.machine.dto;
package org.dubhe.dto;

import lombok.*;
import org.springframework.stereotype.Component;

+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/dto/callback/AlgorithmK8sPodCallbackCreateDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/dto/callback/AllK8sPodCallbackCreateDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 82
- 0
dubhe-server/common/src/main/java/org/dubhe/dto/callback/BaseK8sDeploymentCallbackCreateDTO.java View File

@@ -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
- 1
dubhe-server/common/src/main/java/org/dubhe/dto/callback/BaseK8sPodCallbackCreateDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 35
- 0
dubhe-server/common/src/main/java/org/dubhe/dto/callback/BatchServingK8sPodCallbackCreateDTO.java View File

@@ -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();
}
}

+ 30
- 0
dubhe-server/common/src/main/java/org/dubhe/dto/callback/ModelOptK8sPodCallbackCreateDTO.java View File

@@ -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
- 1
dubhe-server/common/src/main/java/org/dubhe/dto/callback/NotebookK8sPodCallbackCreateDTO.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 34
- 0
dubhe-server/common/src/main/java/org/dubhe/dto/callback/ServingK8sDeploymentCallbackCreateDTO.java View File

@@ -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();
}
}

+ 42
- 11
dubhe-server/common/src/main/java/org/dubhe/enums/BizEnum.java View File

@@ -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");
* 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;

BizEnum(String bizName,String bizCode, Integer createResource) {
BizEnum(String bizName, String bizCode, Integer createResource) {
this.createResource = createResource;
this.bizName = bizName;
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
* @param createResource
* @return
* @param createResource 业务源代号
* @return 枚举对象
*/
public static BizEnum getByCreateResource(int createResource){
public static BizEnum getByCreateResource(int 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;
}

}

+ 5
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/BizNfsEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,10 @@ public enum BizNfsEnum {
* 模型管理 NFS 路径命名
*/
MODEL(BizEnum.MODEL, "model"),
/**
* 模型优化 NFS 路径命名
*/
MODEL_OPT(BizEnum.MODEL_OPT, "model-opt"),
;

BizNfsEnum(BizEnum bizEnum, String bizNfsPath) {


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/DatasetTypeEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.


dubhe-server/dubhe-admin/src/main/java/org/dubhe/enums/ImageSourceEnum.java → dubhe-server/common/src/main/java/org/dubhe/enums/ImageSourceEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.

dubhe-server/dubhe-admin/src/main/java/org/dubhe/enums/ImageStateEnum.java → dubhe-server/common/src/main/java/org/dubhe/enums/ImageStateEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
* =============================================================
*/
package org.dubhe.enums;

/**

+ 92
- 0
dubhe-server/common/src/main/java/org/dubhe/enums/ImageTypeEnum.java View File

@@ -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;
}
}

+ 13
- 4
dubhe-server/common/src/main/java/org/dubhe/enums/LogEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,8 @@ public enum LogEnum {
BIZ_SYS,
// 模型模块
BIZ_MODEL,
// 模型优化
MODEL_OPT,
// 数据集模块
BIZ_DATASET,
// k8s模块
@@ -50,19 +52,26 @@ public enum LogEnum {
LOCAL_FILE_UTIL,
//FILE UTILS
FILE_UTIL,
// 云端Serving模块
SERVING,
//FILE UTILS
UPLOAD_TEMP,
//STATE MACHINE
STATE_MACHINE,
//全局垃圾回收
GARBAGE_RECYCLE,
//DATA_SEQUENCE
DATA_SEQUENCE,
//IO UTIL
IO_UTIL,
//DATA_SEQUENCE
DATA_SEQUENCE,
// 日志切面
LOG_ASPECT
LOG_ASPECT,
//镜像
IMAGE,
//度量
MEASURE;
;

/**
* 判断日志类型不能为空
*


+ 66
- 0
dubhe-server/common/src/main/java/org/dubhe/enums/ModelResourceEnum.java View File

@@ -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
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/OperationTypeEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 11
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/RecycleResourceEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -33,10 +33,20 @@ public enum RecycleResourceEnum {
* 数据集文件回收
*/
DATASET_RECYCLE_FILE("datasetRecycleFile", "数据集文件回收"),

/**
* 医学数据集文件回收
*/
DATAMEDICINE_RECYCLE_FILE("dataMedicineRecycleFile", "数据集文件回收"),

/**
* 数据集版本文件回收
*/
DATASET_RECYCLE_VERSION_FILE("datasetRecycleVersionFile", "数据集版本文件回收"),
/**
* 云端Serving输入文件回收
*/
SERVING_RECYCLE_FILE("servingRecycleFile", "云端Serving文件回收"),

;



+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/SwitchEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/enums/TrainJobStatusEnum.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/BaseErrorCode.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/BusinessException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/CaptchaException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/DataSequenceException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/DockerBizException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/ErrorCode.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/NfsBizException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/NotebookBizException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


dubhe-server/dubhe-data/src/main/java/org/dubhe/data/exception/StateMachineException.java → dubhe-server/common/src/main/java/org/dubhe/exception/StateMachineException.java View File

@@ -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");
* you may not use this file except in compliance with the License.
@@ -14,10 +14,9 @@
* limitations under the License.
* =============================================================
*/
package org.dubhe.data.exception;
package org.dubhe.exception;

import lombok.Getter;
import org.dubhe.exception.BusinessException;

/**
* @description 状态机异常类

+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/UnauthorizedException.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/exception/handler/GlobalExceptionHandler.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 3
- 3
dubhe-server/common/src/main/java/org/dubhe/factory/DataResponseFactory.java View File

@@ -18,10 +18,10 @@ package org.dubhe.factory;
import org.dubhe.base.DataResponseBody;
import org.dubhe.base.ResponseCode;


/**
* @desc DataResponseBody 工厂类
*
* @date 2020.05.28
* @description DataResponseBody 工厂类
* @date 2020-03-16
*/
public class DataResponseFactory {



+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/filter/BaseLogFilter.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/filter/ConsoleLogFilter.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/filter/GlobalRequestLogFilter.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/handle/ApiVersionCondition.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/handle/CustomRequestMappingHandlerMapping.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/interceptor/K8sCallBackPodInterceptor.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/interceptor/MySqlInterceptor.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/interceptor/PaginationInterceptor.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/AesUtil.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 23
- 5
dubhe-server/common/src/main/java/org/dubhe/utils/DateUtil.java View File

@@ -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");
* 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.text.DateFormat;
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;

/**
@@ -95,4 +92,25 @@ public class DateUtil {
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
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/DubheDateUtil.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/EncryptUtils.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/FileUtil.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/HttpClientUtils.java View File

@@ -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");
* you may not use this file except in compliance with the License.


+ 1
- 1
dubhe-server/common/src/main/java/org/dubhe/utils/HttpUtils.java View File

@@ -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");
* you may not use this file except in compliance with the License.


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save