You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

01-Dubhe-DDL.sql 40 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. -- DDL 脚本
  2. create table if not exists data_dataset
  3. (
  4. id bigint auto_increment
  5. primary key,
  6. name varchar(255) not null,
  7. remark varchar(255) null,
  8. type varchar(255) default '0' not null comment '类型 0: private 私有数据, 1:team 团队数据 2:public 公开数据',
  9. team_id bigint null,
  10. uri varchar(255) default '' null comment '数据集存储位置',
  11. create_user_id bigint null,
  12. create_time datetime default CURRENT_TIMESTAMP not null,
  13. update_user_id bigint null,
  14. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP,
  15. deleted bit default b'0' not null,
  16. data_type tinyint default 0 not null comment '数据类型:0图片,1视频',
  17. annotate_type tinyint default 0 not null comment '标注类型:0分类,1目标检测',
  18. labels varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '标签集合,以逗号分隔',
  19. status tinyint default 0 not null comment '0:未标注,1:手动标注中,2:自动标注中,3:自动标注完成,4:标注完成,5:未采样,6:目标跟踪完成,7:采样中',
  20. current_version_name varchar(16) null comment '当前版本号',
  21. `is_import` tinyint(1) DEFAULT '0' COMMENT '是否用户导入',
  22. `archive_url` varchar(255) DEFAULT NULL COMMENT '用户导入数据集压缩包地址',
  23. `decompress_state` tinyint(2) DEFAULT '0' COMMENT '解压状态: 0未解压 1解压中 2解压完成 3解压失败',
  24. `decompress_fail_reason` varchar(255) DEFAULT NULL COMMENT '解压失败原因',
  25. constraint idx_name_unique
  26. unique (name) comment '数据集名称唯一'
  27. )
  28. comment '数据集管理' charset = utf8;
  29. create table if not exists data_dataset_label
  30. (
  31. id bigint unsigned auto_increment
  32. primary key,
  33. dataset_id bigint unsigned not null,
  34. label_id bigint unsigned not null,
  35. constraint dataset_id
  36. unique (dataset_id, label_id)
  37. )
  38. charset = utf8;
  39. create table if not exists data_dataset_version
  40. (
  41. id bigint(19) auto_increment comment '主键'
  42. primary key,
  43. dataset_id bigint(19) null comment '数据集ID',
  44. team_id bigint(19) null comment '团队ID',
  45. create_user_id bigint(19) null comment '创建人',
  46. create_time datetime not null comment '创建时间',
  47. update_user_id bigint(19) null comment '修改人',
  48. update_time datetime null comment '修改时间',
  49. deleted bit default b'0' not null comment '数据集版本删除标记0正常,1已删除',
  50. version_name varchar(8) not null comment '版本号',
  51. version_note varchar(50) not null comment '版本说明',
  52. version_source varchar(32) null comment '来源版本号',
  53. version_url varchar(255) null comment '版本信息存储url',
  54. data_conversion int(1) NOT NULL DEFAULT 0 COMMENT '数据转换;0:未复制;1:已复制;2:转换完成,3:转换失败',
  55. constraint unique_version
  56. unique (dataset_id, version_name) comment '数据集版本号唯一'
  57. )
  58. comment '数据集版本表' charset = utf8mb4;
  59. create table if not exists data_dataset_version_file
  60. (
  61. id bigint auto_increment comment '主键'
  62. primary key,
  63. dataset_id bigint null comment '数据集ID',
  64. version_name varchar(8) null comment '数据集版本',
  65. file_id bigint null comment '文件ID',
  66. status tinyint(1) default 2 not null comment '状态 0: 新增 1:删除 2:正常',
  67. annotation_status tinyint unsigned default 0 not null comment '状态:0-未标注,1-标注中,2-自动标注完成,3-已标注完成,4-目标追踪完成',
  68. backup_status tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '数据集状态备份,版本切换使用',
  69. changed tinyint(1) NULL DEFAULT 0 COMMENT '0-未改变;1-改变'
  70. )
  71. comment '数据集版本文件关系表' charset = utf8mb4;
  72. create table if not exists data_file
  73. (
  74. id bigint unsigned zerofill auto_increment comment 'ID'
  75. primary key,
  76. name varchar(255) default '' not null comment '文件名',
  77. status tinyint unsigned default 0 not null comment '状态:0-未标注,1-标注中,2-自动标注完成,3-已标注完成,4-目标追踪完成',
  78. dataset_id bigint null comment '数据集id',
  79. url varchar(255) default '' not null comment '资源访问路径',
  80. create_user_id bigint null comment '创建用户ID',
  81. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  82. update_user_id bigint null comment '更新用户ID',
  83. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  84. deleted bit default b'0' not null comment '0正常,1已删除',
  85. md5 varchar(255) default '' not null comment '文件md5',
  86. file_type tinyint default 0 null comment '文件类型 0-图片,1-视频',
  87. pid bigint default 0 null comment '父文件id',
  88. frame_interval int default 0 not null comment '帧间隔',
  89. enhance_type smallint(3) NULL DEFAULT NULL COMMENT '增强类型',
  90. constraint name_uniq
  91. unique (name, dataset_id, deleted)
  92. )
  93. comment '文件信息' charset = utf8;
  94. create index dataset_upt_time
  95. on data_file (dataset_id, update_time);
  96. create index deleted
  97. on data_file (deleted);
  98. create index status
  99. on data_file (dataset_id, status, deleted);
  100. create index uuid
  101. on data_file (url, deleted);
  102. create table if not exists data_label
  103. (
  104. id bigint primary key auto_increment,
  105. `name` varchar(255) default '' not null,
  106. color varchar(7) default '#000000' not null,
  107. create_user_id bigint null,
  108. create_time datetime default CURRENT_TIMESTAMP not null,
  109. update_user_id bigint null,
  110. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP,
  111. deleted bit default b'0' not null,
  112. `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '标签类型 0:自定义标签 1:自动标注标签 2:ImageNet 3: MS COCO'
  113. ) auto_increment = 11000
  114. comment '数据集标签' charset = utf8;
  115. create index dataset
  116. on data_label (name, deleted);
  117. create table if not exists data_task
  118. (
  119. id bigint unsigned zerofill auto_increment comment 'ID'
  120. primary key,
  121. total int default 0 not null comment '任务需要处理的文件总数',
  122. status tinyint default 1 not null comment '任务状态,创建即为进行中。1进行中,2已完成',
  123. finished int default 0 not null comment '已完成的文件数',
  124. files varchar(255) default '' null comment '文件id数组',
  125. datasets varchar(255) default '' null comment '数据集id数组',
  126. create_user_id bigint null comment '创建用户ID',
  127. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  128. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  129. deleted bit default b'0' not null comment '0正常,1已删除',
  130. annotate_type tinyint default 0 not null comment '标注类型:0分类,1目标检测',
  131. data_type tinyint default 0 not null comment '数据类型:0图片,1视频',
  132. labels varchar(255) not null comment '该自动标注任务使用的标签数组,json串形式'
  133. )
  134. comment '标注任务信息' charset = utf8;
  135. create index deleted
  136. on data_task (deleted);
  137. create index ds_status
  138. on data_task (datasets, status);
  139. create table if not exists dict
  140. (
  141. id bigint auto_increment primary key,
  142. name varchar(255) not null,
  143. remark varchar(255) null,
  144. create_time datetime default CURRENT_TIMESTAMP null,
  145. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  146. )
  147. charset = utf8;
  148. create table if not exists dict_detail
  149. (
  150. id bigint auto_increment primary key,
  151. dict_id bigint null,
  152. label varchar(255) not null,
  153. value varchar(255) not null,
  154. sort bigint default 999 null,
  155. create_time datetime default CURRENT_TIMESTAMP null,
  156. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  157. )
  158. charset = utf8;
  159. create table harbor_project
  160. (
  161. id bigint unsigned auto_increment comment '主键ID'
  162. primary key,
  163. image_name varchar(100) not null comment '镜像名称',
  164. create_resource tinyint default 0 not null comment '0 - NOTEBOOK模型管理 1- ALGORITHM算法管理',
  165. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
  166. create_user_id bigint null comment '创建用户ID',
  167. update_time timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  168. update_user_id bigint null comment '更新用户ID',
  169. deleted bit default b'0' null comment '0正常,1已删除',
  170. sync_status tinyint(1) default 0 null comment '同步状态(默认为0,同步成功为1)',
  171. constraint image_name
  172. unique (image_name)
  173. )
  174. comment 'harbor project表' charset=utf8;
  175. create table if not exists log
  176. (
  177. id bigint auto_increment
  178. primary key,
  179. browser varchar(255) null,
  180. create_time datetime null,
  181. description varchar(255) null,
  182. exception_detail text null,
  183. log_type varchar(255) null,
  184. method varchar(255) null,
  185. params text null,
  186. request_ip varchar(255) null,
  187. time bigint null,
  188. username varchar(255) null
  189. )
  190. charset = utf8;
  191. create table if not exists menu
  192. (
  193. id bigint auto_increment primary key,
  194. pid bigint default 0 not null COMMENT '上级菜单ID',
  195. type int default 0 not null COMMENT '菜单类型: 0目录,1页面,2权限,3外链' ,
  196. name varchar(255) null COMMENT '名称',
  197. icon varchar(255) null COMMENT '菜单图标',
  198. path varchar(255) null COMMENT '路径或外链URL',
  199. component varchar(255) null COMMENT '组件路径',
  200. component_name varchar(255) null COMMENT '路由名称',
  201. layout varchar(255) null COMMENT '页面布局类型',
  202. permission varchar(255) null COMMENT '权限标识',
  203. hidden bit default b'0' null COMMENT '菜单栏不显示',
  204. cache bit default b'0' null COMMENT '路由缓存 keep-alive',
  205. sort bigint default 999 null COMMENT '菜单排序',
  206. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  207. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  208. create_time datetime default CURRENT_TIMESTAMP null,
  209. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  210. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除'
  211. )
  212. charset = utf8;
  213. create table if not exists `notebook` (
  214. `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  215. `user_id` BIGINT(20) NOT NULL COMMENT '所属用户ID',
  216. `name` VARCHAR(100) NOT NULL COMMENT 'notebook名称(供K8S使用)',
  217. `notebook_name` VARCHAR(100) NOT NULL COMMENT 'notebook名称(供前端使用)',
  218. `description` VARCHAR(255) NULL DEFAULT NULL COMMENT '描述',
  219. `url` VARCHAR(255) NULL DEFAULT NULL COMMENT '访问 notebook 在 Jupyter 里所需的url',
  220. `total_run_min` INT(11) NOT NULL DEFAULT '0' COMMENT '运行总时间(分钟)',
  221. `cpu_num` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'CPU数量',
  222. `gpu_num` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'GPU数量',
  223. `mem_num` INT(11) NOT NULL DEFAULT '0' COMMENT '内存大小(G)',
  224. `disk_mem_num` INT(11) NOT NULL DEFAULT '0' COMMENT '硬盘内存大小(G)',
  225. `create_resource` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '0 - notebook 创建 1- 其它系统创建',
  226. `status` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '0运行中,1停止, 2删除, 3启动中,4停止中,5删除中,6运行异常(暂未启用)',
  227. `last_start_time` TIMESTAMP NULL DEFAULT NULL COMMENT '上次启动执行时间',
  228. `last_operation_timeout` BIGINT(20) NULL DEFAULT NULL COMMENT '上次操作对应超时时间点(20200603121212)',
  229. `k8s_status_code` VARCHAR(100) NULL DEFAULT NULL COMMENT 'k8s响应状态码',
  230. `k8s_status_info` VARCHAR(255) NULL DEFAULT NULL COMMENT 'k8s响应状态信息',
  231. `k8s_namespace` VARCHAR(255) NOT NULL COMMENT 'k8s中namespace',
  232. `k8s_resource_name` VARCHAR(255) NOT NULL COMMENT 'k8s中资源名称',
  233. `k8s_image_name` VARCHAR(255) NOT NULL COMMENT 'k8s中jupyter的镜像名称',
  234. `k8s_pvc_path` VARCHAR(255) NOT NULL COMMENT 'k8s中pvc存储路径',
  235. `k8s_mount_path` VARCHAR(255) NOT NULL DEFAULT '/notebook' COMMENT 'k8s中容器路径',
  236. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  237. `create_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '创建用户ID',
  238. `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  239. `update_user_id` BIGINT(20) NULL DEFAULT NULL COMMENT '更新用户ID',
  240. `deleted` BIT(1) NULL DEFAULT b'0' COMMENT '0正常,1已删除',
  241. `data_source_name` VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集名称',
  242. `data_source_path` VARCHAR(255) NULL DEFAULT NULL COMMENT '数据集路劲',
  243. `algorithm_id` bigint(20) DEFAULT '0' COMMENT '算法ID',
  244. PRIMARY KEY (`id`),
  245. INDEX `status` (`status`),
  246. INDEX `user_id` (`user_id`),
  247. INDEX `name` (`name`),
  248. INDEX `last_operation_timeout` (`last_operation_timeout`),
  249. INDEX `k8s_namespace` (`k8s_namespace`),
  250. INDEX `k8s_resource_name` (`k8s_resource_name`)
  251. )
  252. COMMENT='notebook数据表'
  253. COLLATE='utf8_general_ci'
  254. ENGINE=InnoDB
  255. ;
  256. create table if not exists notebook_model
  257. (
  258. id int auto_increment comment '主键ID'
  259. primary key,
  260. model_type varchar(50) not null comment '模板类型 CPU GPU',
  261. cpu_num int not null comment 'CPU数量',
  262. gpu_num int not null comment 'GPU数量',
  263. mem_num int not null comment '内存大小',
  264. spec varchar(50) null comment 'GPU规格',
  265. deleted int default 0 null comment '0正常,1已删除',
  266. disk_mem_num int null comment '硬盘内存大小',
  267. default_status int(11) DEFAULT '0' COMMENT '默认值,1 为默认 '
  268. )
  269. comment 'notebook模板';
  270. create table if not exists pt_dev_envs
  271. (
  272. id bigint auto_increment comment '主键'
  273. primary key,
  274. name varchar(255) not null comment '名称',
  275. remark varchar(255) null comment '描述',
  276. type varchar(255) not null comment '类型 ',
  277. cpu_num int not null comment 'CPU数量',
  278. gpu_num int not null comment 'GPU数量',
  279. mem_num int not null comment '内存大小单位M',
  280. pod_num int not null comment 'POD数量',
  281. status varchar(255) not null comment '状态 对应k8s的状态',
  282. dataset_id bigint null comment '数据集ID',
  283. image_id bigint null comment '镜像ID',
  284. storage_id bigint null comment '存储ID',
  285. duration int null comment '时长',
  286. start_time datetime null comment '开始时间',
  287. close_time datetime null comment '释放时间',
  288. create_time datetime null comment '创建时间',
  289. update_time datetime null comment '修改时间',
  290. create_user_id bigint null comment '创建人ID',
  291. update_user_id bigint null comment '修改人ID',
  292. team_id bigint null comment '团队ID',
  293. deleted bit default b'0' null comment '0正常,1已删除'
  294. )
  295. charset = utf8;
  296. create table if not exists pt_job_param
  297. (
  298. id bigint auto_increment comment '主键id'
  299. primary key,
  300. train_job_id bigint not null comment '训练作业jobId',
  301. algorithm_id bigint not null comment '算法来源id',
  302. run_params json null comment '运行参数(算法来源为我的算法时为调优参数,算法来源为预置算法时为运行参数)',
  303. param_f1 varchar(255) default '' null comment 'F1值',
  304. param_callback varchar(255) default '' null comment '召回率',
  305. param_precise varchar(255) default '' null comment '精确率',
  306. param_accuracy varchar(255) default '' null comment '准确率',
  307. create_user_id bigint null comment '创建人',
  308. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  309. create_time timestamp null comment '创建时间',
  310. update_user_id bigint null comment '更新人',
  311. update_time timestamp null comment '更新时间',
  312. run_command varchar(255) default '' null COMMENT '运行命令',
  313. image_name varchar(127) default '' null COMMENT '镜像名称'
  314. )
  315. comment 'job运行参数及结果表' charset = utf8mb4;
  316. create table if not exists pt_model_branch
  317. (
  318. id bigint auto_increment comment '主键'
  319. primary key,
  320. parent_id bigint null comment '父ID',
  321. version varchar(8) not null comment '版本号',
  322. url varchar(255) not null comment '模型地址',
  323. model_path varchar(255) not null comment '模型存储地址',
  324. model_source tinyint(3) not null comment '模型来源(用户上传、平台生成、优化后导入)',
  325. create_user_id bigint null comment '创建用户ID',
  326. update_user_id bigint null comment '更新用户ID',
  327. team_id bigint null comment '团队ID',
  328. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  329. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  330. deleted bit default b'0' not null comment '0 正常,1 已删除',
  331. algorithm_id bigint null comment '算法ID',
  332. algorithm_name varchar(255) null comment '算法名称',
  333. algorithm_source tinyint(1) null comment '算法来源(1为我的算法,2为预置算法)',
  334. status tinyint(3) null comment '文件拷贝状态(0文件拷贝中,1文件拷贝成功,2文件拷贝失败)'
  335. )
  336. comment '分支管理' charset = utf8;
  337. create table if not exists pt_model_info
  338. (
  339. id bigint auto_increment comment '主键'
  340. primary key,
  341. name varchar(255) not null comment '模型名称',
  342. frame_type tinyint not null comment '框架类型',
  343. model_format tinyint not null comment '模型文件的格式(后缀名)',
  344. model_description varchar(255) not null comment '模型描述',
  345. model_type varchar(255) not null comment '模型分类',
  346. url varchar(255) null comment '模型地址',
  347. model_version varchar(8) null comment '模型版本',
  348. create_user_id bigint null comment '创建用户ID',
  349. update_user_id bigint null comment '更新用户ID',
  350. team_id bigint null comment '组ID',
  351. deleted bit default b'0' not null comment '0 正常,1 已删除',
  352. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  353. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  354. model_resource tinyint default 0 null comment '模型是否为预置模型(0默认模型,1预置模型)',
  355. total_num bigint default 0 null comment '模型版本总的个数'
  356. )
  357. comment '模型管理' charset = utf8;
  358. create table if not exists pt_project_template
  359. (
  360. id bigint auto_increment comment '主键'
  361. primary key,
  362. name varchar(255) not null comment '名称',
  363. remark varchar(255) null comment '描述',
  364. type varchar(255) not null comment '类型 ',
  365. dataset_id bigint null comment '数据集ID',
  366. image_id bigint null comment '镜像ID',
  367. code_url varchar(255) null comment '代码地址',
  368. cmd varchar(255) not null comment '命令行',
  369. create_time datetime not null comment '创建时间',
  370. update_time datetime null comment '修改时间',
  371. create_user_id bigint null comment '创建人ID',
  372. update_user_id bigint null comment '修改人ID',
  373. team_id bigint null comment '团队ID',
  374. deleted bit default b'0' null comment '0正常,1已删除'
  375. )
  376. charset = utf8;
  377. create table if not exists pt_storage
  378. (
  379. id bigint auto_increment comment '主键'
  380. primary key,
  381. name varchar(255) not null comment '名称',
  382. type varchar(255) not null comment '类型 ',
  383. size int not null comment '存储大小,单位M',
  384. storage_class varchar(255) null comment '对应k8s pvc的 storageClass',
  385. create_time datetime not null comment '创建时间',
  386. create_user_id bigint null comment '创建人ID',
  387. update_user_id bigint null comment '修改人ID',
  388. update_time datetime null comment '修改时间',
  389. team_id bigint null comment '团队ID',
  390. deleted bit default b'0' null comment '0正常,1已删除'
  391. )
  392. charset = utf8;
  393. create table if not exists pt_train
  394. (
  395. id bigint auto_increment comment '主键id'
  396. primary key,
  397. train_name varchar(64) not null comment '训练作业名',
  398. version_num int(8) default 1 not null comment '训练作业job有效版本数量',
  399. total_num int(8) default 1 not null comment '训练作业总版本数',
  400. deleted tinyint(1) default 0 not null comment '删除(0正常,1已删除)',
  401. create_user_id bigint null comment '创建人',
  402. create_time timestamp null comment '创建时间',
  403. update_user_id bigint null comment '更新人',
  404. update_time timestamp null comment '更新时间',
  405. train_key varchar(32) null
  406. )
  407. comment '训练作业主表' charset = utf8mb4;
  408. create index idx_user_id
  409. on pt_train (create_user_id);
  410. create table if not exists pt_train_algorithm
  411. (
  412. id bigint auto_increment comment '主键'
  413. primary key,
  414. algorithm_name varchar(255) not null comment '算法名称',
  415. description varchar(255) default '' null comment '算法描述',
  416. algorithm_source tinyint(1) not null comment '算法来源(1为我的算法,2为预置算法)',
  417. code_dir varchar(255) default '' null comment '代码目录',
  418. run_command varchar(255) default '' null comment '运行命令',
  419. run_params json null comment '运行参数',
  420. algorithm_usage varchar(255) default '' null comment '算法用途',
  421. accuracy varchar(255) default '' null comment '算法精度',
  422. p4_inference_speed int null comment 'P4推理速度(ms)',
  423. create_user_id bigint null comment '创建人',
  424. create_time timestamp null comment '创建时间',
  425. update_user_id bigint null comment '更新人',
  426. update_time timestamp null comment '更新时间',
  427. deleted tinyint(1) default 0 not null comment '删除(0正常,1已删除)',
  428. image_name varchar(127) null,
  429. is_train_out tinyint(1) default 1 null comment '是否输出训练结果:1是,0否',
  430. is_train_log tinyint(1) default 1 null comment '是否输出训练日志:1是,0否',
  431. is_visualized_log tinyint(1) default 0 null comment '是否输出可视化日志:1是,0否'
  432. )
  433. comment '训练算法表' charset = utf8mb4;
  434. create table if not exists pt_train_job
  435. (
  436. id bigint auto_increment comment '主键id'
  437. primary key,
  438. train_id bigint not null comment '训练作业id',
  439. train_version varchar(32) not null comment 'job版本',
  440. parent_train_version varchar(32) null comment 'job父版本',
  441. job_name varchar(64) not null comment '任务名称',
  442. description varchar(255) default '' null comment '描述',
  443. runtime varchar(32) default '' null comment '运行时长',
  444. out_path varchar(128) default '' null comment '训练输出位置',
  445. log_path varchar(128) default '' null comment '作业日志路径',
  446. resources_pool_type tinyint(1) default 0 not null comment '类型(0为CPU,1为GPU)',
  447. resources_pool_specs varchar(128) null comment '规格',
  448. resources_pool_node int(8) default 1 not null comment '节点个数',
  449. train_status tinyint(1) default 0 not null comment '训练作业job状态, 0为待处理,1为运行中,2为运行完成,3为失败,4为停止,5为未知,6为删除,7为创建失败)',
  450. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  451. create_user_id bigint null comment '创建人',
  452. create_time timestamp null comment '创建时间',
  453. update_user_id bigint null comment '更新人',
  454. update_time timestamp null comment '更新时间',
  455. visualized_log_path varchar(128) default '' null comment '可视化日志路径',
  456. data_source_name varchar(127) null comment '数据集名称',
  457. data_source_path varchar(127) null comment '数据集路径',
  458. train_job_specs_id int(6) default null COMMENT '训练规格id',
  459. k8s_job_name varchar(70) null comment 'k8s创建好的job名称',
  460. constraint inx_tran_id_version
  461. unique (train_id, train_version)
  462. )
  463. comment '训练作业job表' charset = utf8mb4;
  464. create index inx_create_user_id
  465. on pt_train_job (create_user_id);
  466. create table if not exists pt_train_job_specs
  467. (
  468. id int(6) auto_increment comment '主键id'
  469. primary key,
  470. specs_name varchar(128) default '' not null comment '规格名称',
  471. specs_info json not null comment '规格信息',
  472. resources_pool_type tinyint(1) default 0 not null comment '规格类型(0为CPU, 1为GPU)',
  473. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  474. create_user_id bigint null comment '创建人',
  475. create_time timestamp null comment '创建时间',
  476. update_user_id bigint null comment '更新人',
  477. update_time timestamp null comment '更新时间'
  478. )
  479. comment '规格表' charset = utf8mb4;
  480. create table if not exists pt_train_param
  481. (
  482. id bigint auto_increment comment '主键id'
  483. primary key,
  484. param_name varchar(128) not null comment '任务参数名称',
  485. description varchar(256) default '' null comment '描述',
  486. algorithm_id bigint not null comment '算法id',
  487. out_path varchar(128) default '' null comment '输出路径',
  488. run_params json null comment '运行参数(算法来源为我的算法时为调优参数,算法来源为预置算法时为运行参数)',
  489. algorithm_source tinyint(1) default 1 not null comment '算法来源(1为我的算法,2为预置算法)',
  490. log_path varchar(128) default '' null comment '日志输出路径',
  491. resources_pool_type tinyint(1) default 0 not null comment '类型(0为CPU,1为GPU)',
  492. resources_pool_specs varchar(128) null comment '规格',
  493. resources_pool_node int(8) default 1 not null comment '节点个数',
  494. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  495. create_user_id bigint null comment '创建人',
  496. create_time timestamp null comment '创建时间',
  497. update_user_id bigint null comment '更新人',
  498. update_time timestamp null comment '更新时间',
  499. data_source_name varchar(127) null comment '数据集名称',
  500. data_source_path varchar(127) null comment '数据集路径',
  501. run_command varchar(255) default '' null COMMENT '运行命令',
  502. image_name varchar(127) default '' null COMMENT '镜像名称',
  503. train_job_specs_id int(6) default null COMMENT '训练规格id'
  504. )
  505. comment '任务参数表' charset = utf8mb4;
  506. create table if not exists role
  507. (
  508. id bigint auto_increment
  509. primary key,
  510. name varchar(255) not null,
  511. permission varchar(255) null,
  512. remark varchar(255) null,
  513. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  514. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  515. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  516. create_time datetime default CURRENT_TIMESTAMP null,
  517. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  518. )
  519. charset = utf8;
  520. create table if not exists roles_menus
  521. (
  522. role_id bigint not null,
  523. menu_id bigint not null,
  524. primary key (role_id, menu_id)
  525. )
  526. charset = utf8;
  527. create table if not exists service
  528. (
  529. id int auto_increment comment '主键'
  530. primary key,
  531. model_id int null comment '模型id',
  532. model_version int null comment '模板版本号',
  533. status int null comment '状态',
  534. config text null comment '配置信息',
  535. yaml_path varchar(255) null comment 'yaml配置信息',
  536. create_user_id int null comment '创建人',
  537. create_time datetime null comment '创建时间',
  538. update_user_id datetime null comment '更新人',
  539. update_time datetime null comment '更新时间'
  540. )
  541. comment '服务管理' charset = utf8;
  542. create table if not exists service_monitor
  543. (
  544. id int auto_increment comment '主键'
  545. primary key,
  546. service_id int null comment '服务id',
  547. system_info text null comment '占用系统信息',
  548. api_info text null comment '接口信息',
  549. create_time datetime null comment '创建时间'
  550. )
  551. comment '服务监控信息' charset = utf8;
  552. create table if not exists team
  553. (
  554. id bigint auto_increment
  555. primary key,
  556. create_time datetime null,
  557. enabled bit not null,
  558. name varchar(255) not null
  559. )
  560. charset = utf8;
  561. create table if not exists teams_users_roles
  562. (
  563. id bigint auto_increment
  564. primary key,
  565. role_id bigint null,
  566. team_id bigint null,
  567. user_id bigint null
  568. )
  569. charset = utf8;
  570. create table if not exists user
  571. (
  572. id bigint auto_increment
  573. primary key,
  574. email varchar(255) null,
  575. enabled bit not null,
  576. last_password_reset_time datetime null,
  577. nick_name varchar(255) null,
  578. password varchar(255) null,
  579. phone varchar(255) null,
  580. sex varchar(255) null,
  581. username varchar(255) null,
  582. remark varchar(255) null,
  583. create_time datetime default CURRENT_TIMESTAMP null,
  584. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
  585. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  586. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  587. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  588. avatar_id bigint null
  589. )
  590. charset = utf8;
  591. create table if not exists user_avatar
  592. (
  593. id bigint auto_increment
  594. primary key,
  595. path varchar(255) null,
  596. real_name varchar(255) null,
  597. size varchar(255) null,
  598. create_user_id bigint(20) DEFAULT NULL COMMENT '创建人id',
  599. update_user_id bigint(20) DEFAULT NULL COMMENT '修改人id',
  600. deleted bit(1) DEFAULT 0 COMMENT '删除标记 0正常,1已删除',
  601. create_time datetime default CURRENT_TIMESTAMP null,
  602. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  603. )
  604. charset = utf8;
  605. create table if not exists users_roles
  606. (
  607. user_id bigint not null comment '用户ID',
  608. role_id bigint not null comment '角色ID',
  609. primary key (user_id, role_id)
  610. )
  611. comment '用户角色关联' charset = utf8;
  612. create table if not exists pt_auxiliary_info (
  613. id bigint(20) not null auto_increment comment '主键id',
  614. user_id bigint(20) not null comment '用户id',
  615. type varchar(20) not null comment '类型',
  616. is_default tinyint(1) not null default '0' comment '是否为默认值',
  617. aux_info varchar(50) null default NULL comment '辅助信息',
  618. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  619. create_user_id bigint null comment '创建人',
  620. create_time timestamp null comment '创建时间',
  621. update_user_id bigint null comment '更新人',
  622. update_time timestamp null comment '更新时间',
  623. primary key (`id`),
  624. index `inx_user_id_type` (`user_id`, `type`) USING BTREE
  625. )
  626. comment='用户的辅助信息表,通过类型进行区分' charset = utf8;
  627. -- 新建镜像表
  628. create table pt_image
  629. (
  630. id int(8) auto_increment comment '主键'
  631. primary key,
  632. project_name varchar(100) not null comment '项目名',
  633. image_resource tinyint(1) not null comment '镜像来源(0:我的镜像,1:预置镜像)',
  634. image_status tinyint(1) not null comment '镜像状态(0:制作中,1:制作成功,2:制作失败)',
  635. image_name varchar(64) not null comment '镜像名称',
  636. image_url varchar(255) null comment '镜像地址',
  637. image_tag varchar(32) not null comment '镜像版本',
  638. remark varchar(1024) null comment '镜像描述',
  639. create_user_id bigint null comment '创建人',
  640. create_time timestamp null comment '创建时间',
  641. update_user_id bigint null comment '更新人',
  642. update_time timestamp null comment '更新时间',
  643. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)'
  644. )
  645. comment '镜像表' charset = utf8mb4;
  646. -- k8s资源表
  647. CREATE TABLE if not exists k8s_resource
  648. (
  649. id bigint auto_increment
  650. primary key,
  651. kind varchar(32) not null comment '资源类型',
  652. namespace varchar(64) not null comment '命名空间',
  653. name varchar(64) not null comment '名称',
  654. resource_name varchar(64) not null comment '资源名称',
  655. env varchar(32) null comment '环境',
  656. business varchar(32) null comment '所属业务模块',
  657. create_user_id bigint null comment '创建人',
  658. create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
  659. update_user_id bigint null comment '更新人',
  660. update_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  661. deleted tinyint(1) default 0 null comment '删除(0正常,1已删除)',
  662. INDEX name (name),
  663. INDEX resource_name (resource_name),
  664. constraint kind_namespace_name_uniq unique (kind,namespace,name) comment '资源唯一'
  665. )
  666. comment 'k8s资源表' charset = utf8mb4;

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能

Contributors (1)