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.

dora-schema.json 10 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "title": "dora-rs specification",
  4. "description": "Dataflow description",
  5. "type": "object",
  6. "required": [
  7. "nodes"
  8. ],
  9. "properties": {
  10. "nodes": {
  11. "type": "array",
  12. "items": {
  13. "$ref": "#/definitions/Node"
  14. }
  15. }
  16. },
  17. "additionalProperties": true,
  18. "definitions": {
  19. "CustomNode": {
  20. "type": "object",
  21. "required": [
  22. "source"
  23. ],
  24. "properties": {
  25. "args": {
  26. "description": "Args for the executable.",
  27. "type": [
  28. "string",
  29. "null"
  30. ]
  31. },
  32. "build": {
  33. "type": [
  34. "string",
  35. "null"
  36. ]
  37. },
  38. "envs": {
  39. "description": "Environment variables for the custom nodes\n\nDeprecated, use outer-level `env` field instead.",
  40. "type": [
  41. "object",
  42. "null"
  43. ],
  44. "additionalProperties": {
  45. "$ref": "#/definitions/EnvValue"
  46. }
  47. },
  48. "inputs": {
  49. "description": "Inputs for the nodes as a map from input ID to `node_id/output_id`.\n\ne.g.\n\ninputs:\n\nexample_input: example_node/example_output1",
  50. "default": {},
  51. "type": "object",
  52. "additionalProperties": true
  53. },
  54. "outputs": {
  55. "description": "List of output IDs.\n\ne.g.\n\noutputs:\n\n- output_1\n\n- output_2",
  56. "default": [],
  57. "type": "array",
  58. "items": {
  59. "$ref": "#/definitions/DataId"
  60. },
  61. "uniqueItems": true
  62. },
  63. "send_stdout_as": {
  64. "description": "Send stdout and stderr to another node",
  65. "type": [
  66. "string",
  67. "null"
  68. ]
  69. },
  70. "source": {
  71. "description": "Path of the source code\n\nIf you want to use a specific `conda` environment. Provide the python path within the source.\n\nsource: /home/peter/miniconda3/bin/python\n\nargs: some_node.py\n\nSource can match any executable in PATH.",
  72. "type": "string"
  73. }
  74. }
  75. },
  76. "DataId": {
  77. "type": "string"
  78. },
  79. "Duration": {
  80. "type": "object",
  81. "required": [
  82. "nanos",
  83. "secs"
  84. ],
  85. "properties": {
  86. "nanos": {
  87. "type": "integer",
  88. "format": "uint32",
  89. "minimum": 0.0
  90. },
  91. "secs": {
  92. "type": "integer",
  93. "format": "uint64",
  94. "minimum": 0.0
  95. }
  96. }
  97. },
  98. "EnvValue": {
  99. "anyOf": [
  100. {
  101. "type": "boolean"
  102. },
  103. {
  104. "type": "integer",
  105. "format": "uint64",
  106. "minimum": 0.0
  107. },
  108. {
  109. "type": "string"
  110. }
  111. ]
  112. },
  113. "Input": {
  114. "type": "object",
  115. "required": [
  116. "mapping"
  117. ],
  118. "properties": {
  119. "mapping": {
  120. "$ref": "#/definitions/InputMapping"
  121. },
  122. "queue_size": {
  123. "type": [
  124. "integer",
  125. "null"
  126. ],
  127. "format": "uint",
  128. "minimum": 0.0
  129. }
  130. },
  131. "additionalProperties": true
  132. },
  133. "InputMapping": {
  134. "oneOf": [
  135. {
  136. "type": "object",
  137. "required": [
  138. "Timer"
  139. ],
  140. "properties": {
  141. "Timer": {
  142. "type": "object",
  143. "required": [
  144. "interval"
  145. ],
  146. "properties": {
  147. "interval": {
  148. "$ref": "#/definitions/Duration"
  149. }
  150. }
  151. }
  152. },
  153. "additionalProperties": true
  154. },
  155. {
  156. "type": "object",
  157. "required": [
  158. "User"
  159. ],
  160. "properties": {
  161. "User": {
  162. "$ref": "#/definitions/UserInputMapping"
  163. }
  164. },
  165. "additionalProperties": true
  166. }
  167. ]
  168. },
  169. "Node": {
  170. "description": "Dora Node",
  171. "type": "object",
  172. "required": [
  173. "id"
  174. ],
  175. "properties": {
  176. "args": {
  177. "type": [
  178. "string",
  179. "null"
  180. ]
  181. },
  182. "build": {
  183. "type": [
  184. "string",
  185. "null"
  186. ]
  187. },
  188. "custom": {
  189. "anyOf": [
  190. {
  191. "$ref": "#/definitions/CustomNode"
  192. },
  193. {
  194. "type": "null"
  195. }
  196. ]
  197. },
  198. "description": {
  199. "description": "Description of the node",
  200. "type": [
  201. "string",
  202. "null"
  203. ]
  204. },
  205. "env": {
  206. "description": "Environment variables",
  207. "type": [
  208. "object",
  209. "null"
  210. ],
  211. "additionalProperties": {
  212. "$ref": "#/definitions/EnvValue"
  213. }
  214. },
  215. "id": {
  216. "description": "Node identifier",
  217. "allOf": [
  218. {
  219. "$ref": "#/definitions/NodeId"
  220. }
  221. ]
  222. },
  223. "inputs": {
  224. "default": {},
  225. "type": "object",
  226. "additionalProperties": true
  227. },
  228. "name": {
  229. "description": "Node name",
  230. "type": [
  231. "string",
  232. "null"
  233. ]
  234. },
  235. "operator": {
  236. "anyOf": [
  237. {
  238. "$ref": "#/definitions/SingleOperatorDefinition"
  239. },
  240. {
  241. "type": "null"
  242. }
  243. ]
  244. },
  245. "operators": {
  246. "type": [
  247. "array",
  248. "null"
  249. ],
  250. "items": {
  251. "$ref": "#/definitions/OperatorDefinition"
  252. }
  253. },
  254. "outputs": {
  255. "default": [],
  256. "type": "array",
  257. "items": {
  258. "$ref": "#/definitions/DataId"
  259. },
  260. "uniqueItems": true
  261. },
  262. "path": {
  263. "type": [
  264. "string",
  265. "null"
  266. ]
  267. },
  268. "send_stdout_as": {
  269. "type": [
  270. "string",
  271. "null"
  272. ]
  273. }
  274. },
  275. "additionalProperties": true
  276. },
  277. "NodeId": {
  278. "type": "string"
  279. },
  280. "OperatorDefinition": {
  281. "type": "object",
  282. "oneOf": [
  283. {
  284. "type": "object",
  285. "required": [
  286. "shared-library"
  287. ],
  288. "properties": {
  289. "shared-library": {
  290. "type": "string"
  291. }
  292. },
  293. "additionalProperties": true
  294. },
  295. {
  296. "type": "object",
  297. "required": [
  298. "python"
  299. ],
  300. "properties": {
  301. },
  302. "additionalProperties": true
  303. }
  304. ],
  305. "required": [
  306. "id"
  307. ],
  308. "properties": {
  309. "build": {
  310. "type": [
  311. "string",
  312. "null"
  313. ]
  314. },
  315. "description": {
  316. "type": [
  317. "string",
  318. "null"
  319. ]
  320. },
  321. "id": {
  322. "$ref": "#/definitions/OperatorId"
  323. },
  324. "inputs": {
  325. "default": {},
  326. "type": "object",
  327. "additionalProperties": true
  328. },
  329. "name": {
  330. "type": [
  331. "string",
  332. "null"
  333. ]
  334. },
  335. "outputs": {
  336. "default": [],
  337. "type": "array",
  338. "items": {
  339. "$ref": "#/definitions/DataId"
  340. },
  341. "uniqueItems": true
  342. },
  343. "send_stdout_as": {
  344. "type": [
  345. "string",
  346. "null"
  347. ]
  348. }
  349. }
  350. },
  351. "OperatorId": {
  352. "type": "string"
  353. },
  354. "PythonSource": {
  355. "type": "object",
  356. "required": [
  357. "source"
  358. ],
  359. "properties": {
  360. "conda_env": {
  361. "type": [
  362. "string",
  363. "null"
  364. ]
  365. },
  366. "source": {
  367. "type": "string"
  368. }
  369. },
  370. "additionalProperties": true
  371. },
  372. "SingleOperatorDefinition": {
  373. "type": "object",
  374. "oneOf": [
  375. {
  376. "type": "object",
  377. "required": [
  378. "shared-library"
  379. ],
  380. "properties": {
  381. "shared-library": {
  382. "type": "string"
  383. }
  384. },
  385. "additionalProperties": true
  386. },
  387. {
  388. "type": "object",
  389. "required": [
  390. "python"
  391. ],
  392. "properties": {
  393. },
  394. "additionalProperties": true
  395. }
  396. ],
  397. "properties": {
  398. "build": {
  399. "type": [
  400. "string",
  401. "null"
  402. ]
  403. },
  404. "description": {
  405. "type": [
  406. "string",
  407. "null"
  408. ]
  409. },
  410. "id": {
  411. "description": "ID is optional if there is only a single operator.",
  412. "anyOf": [
  413. {
  414. "$ref": "#/definitions/OperatorId"
  415. },
  416. {
  417. "type": "null"
  418. }
  419. ]
  420. },
  421. "inputs": {
  422. "default": {},
  423. "type": "object",
  424. "additionalProperties": true
  425. },
  426. "name": {
  427. "type": [
  428. "string",
  429. "null"
  430. ]
  431. },
  432. "outputs": {
  433. "default": [],
  434. "type": "array",
  435. "items": {
  436. "$ref": "#/definitions/DataId"
  437. },
  438. "uniqueItems": true
  439. },
  440. "send_stdout_as": {
  441. "type": [
  442. "string",
  443. "null"
  444. ]
  445. }
  446. }
  447. },
  448. "UserInputMapping": {
  449. "type": "object",
  450. "required": [
  451. "output",
  452. "source"
  453. ],
  454. "properties": {
  455. "output": {
  456. "$ref": "#/definitions/DataId"
  457. },
  458. "source": {
  459. "$ref": "#/definitions/NodeId"
  460. }
  461. }
  462. }
  463. }
  464. }