@grnsft/if 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CONTRIBUTING.md +4 -5
  2. package/README.md +14 -33
  3. package/Refactor-migration-guide.md +5 -6
  4. package/build/builtins/coefficient/index.d.ts +1 -2
  5. package/build/builtins/coefficient/index.js +18 -4
  6. package/build/builtins/copy-param/index.d.ts +2 -0
  7. package/build/builtins/copy-param/index.js +68 -0
  8. package/build/builtins/csv-lookup/index.d.ts +1 -1
  9. package/build/builtins/csv-lookup/index.js +44 -37
  10. package/build/builtins/divide/index.d.ts +1 -1
  11. package/build/builtins/divide/index.js +22 -11
  12. package/build/builtins/exponent/index.d.ts +1 -2
  13. package/build/builtins/exponent/index.js +9 -23
  14. package/build/builtins/export-csv-raw.d.ts +4 -2
  15. package/build/builtins/export-csv-raw.js +7 -7
  16. package/build/builtins/export-csv.js +8 -11
  17. package/build/builtins/export-log.js +1 -1
  18. package/build/builtins/export-yaml.js +6 -6
  19. package/build/builtins/group-by.d.ts +1 -1
  20. package/build/builtins/group-by.js +5 -5
  21. package/build/builtins/index.d.ts +1 -0
  22. package/build/builtins/index.js +4 -2
  23. package/build/builtins/interpolation/index.d.ts +1 -1
  24. package/build/builtins/interpolation/index.js +10 -8
  25. package/build/builtins/mock-observations/helpers/common-generator.d.ts +2 -2
  26. package/build/builtins/mock-observations/helpers/common-generator.js +10 -13
  27. package/build/builtins/mock-observations/helpers/rand-int-generator.d.ts +2 -2
  28. package/build/builtins/mock-observations/helpers/rand-int-generator.js +14 -24
  29. package/build/builtins/mock-observations/index.d.ts +1 -2
  30. package/build/builtins/mock-observations/index.js +2 -4
  31. package/build/builtins/multiply/index.d.ts +1 -2
  32. package/build/builtins/multiply/index.js +10 -16
  33. package/build/builtins/regex/index.d.ts +1 -2
  34. package/build/builtins/regex/index.js +8 -12
  35. package/build/builtins/sci/index.d.ts +1 -2
  36. package/build/builtins/sci/index.js +23 -22
  37. package/build/builtins/sci-embodied/index.d.ts +1 -1
  38. package/build/builtins/sci-embodied/index.js +16 -17
  39. package/build/builtins/shell/index.d.ts +1 -2
  40. package/build/builtins/shell/index.js +4 -4
  41. package/build/builtins/subtract/index.d.ts +1 -2
  42. package/build/builtins/subtract/index.js +7 -23
  43. package/build/builtins/sum/index.d.ts +1 -2
  44. package/build/builtins/sum/index.js +14 -11
  45. package/build/builtins/time-sync.d.ts +1 -2
  46. package/build/builtins/time-sync.js +62 -67
  47. package/build/check.d.ts +2 -0
  48. package/build/check.js +95 -0
  49. package/build/config/config.d.ts +13 -1
  50. package/build/config/config.js +61 -1
  51. package/build/config/params.js +1 -6
  52. package/build/config/strings.d.ts +45 -5
  53. package/build/config/strings.js +50 -9
  54. package/build/diff.js +2 -2
  55. package/build/env.d.ts +2 -0
  56. package/build/env.js +38 -0
  57. package/build/lib/aggregate.js +1 -1
  58. package/build/lib/compute.js +1 -1
  59. package/build/lib/exhaust.js +4 -4
  60. package/build/lib/initialize.js +20 -24
  61. package/build/lib/load.js +4 -4
  62. package/build/types/compute.d.ts +1 -1
  63. package/build/types/compute.js +1 -1
  64. package/build/types/if-env.d.ts +8 -0
  65. package/build/types/if-env.js +3 -0
  66. package/build/types/interface.d.ts +1 -19
  67. package/build/types/interface.js +1 -1
  68. package/build/types/npm.d.ts +9 -0
  69. package/build/types/npm.js +3 -0
  70. package/build/types/process-args.d.ts +9 -0
  71. package/build/types/process-args.js +1 -1
  72. package/build/util/aggregation-helper.d.ts +1 -1
  73. package/build/util/aggregation-helper.js +5 -5
  74. package/build/util/args.d.ts +23 -1
  75. package/build/util/args.js +91 -14
  76. package/build/util/debug-logger.js +8 -7
  77. package/build/util/fs.d.ts +20 -0
  78. package/build/util/fs.js +94 -0
  79. package/build/util/helpers.d.ts +25 -5
  80. package/build/util/helpers.js +111 -15
  81. package/build/util/npm.d.ts +28 -0
  82. package/build/util/npm.js +152 -0
  83. package/build/util/plugin-storage.js +4 -4
  84. package/build/util/validations.js +4 -4
  85. package/jest.config.js +1 -1
  86. package/manifests/{plugins → examples/builtins/csv-lookup}/cloud-metadata/failure-invalid-instance-type.yaml +9 -3
  87. package/manifests/examples/builtins/csv-lookup/cloud-metadata/failure-invalid-vendor.yaml +27 -0
  88. package/manifests/{plugins → examples/builtins/csv-lookup}/cloud-metadata/failure-missing-cloud-vendor.yml +9 -3
  89. package/manifests/{plugins → examples/builtins/csv-lookup}/cloud-metadata/success.yml +8 -2
  90. package/manifests/{plugins/csv-lookup → examples/builtins/csv-lookup/region-metadata}/failure-missing-column.yml +1 -2
  91. package/manifests/{plugins/csv-lookup → examples/builtins/csv-lookup/region-metadata}/failure-missing-output.yml +1 -2
  92. package/manifests/{plugins/csv-lookup → examples/builtins/csv-lookup/region-metadata}/success-renaming.yml +1 -2
  93. package/manifests/{plugins/csv-lookup → examples/builtins/csv-lookup/region-metadata}/success.yml +2 -3
  94. package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-missing-input-param.yml +23 -0
  95. package/manifests/examples/builtins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yml +24 -0
  96. package/manifests/examples/builtins/csv-lookup/tdp-finder/success.yml +24 -0
  97. package/manifests/{plugins → examples/builtins}/divide/failure-denominator-equal-zero.yml +8 -9
  98. package/manifests/{plugins → examples/builtins}/divide/failure-invalid-config-denominator.yml +8 -9
  99. package/manifests/{plugins → examples/builtins}/divide/failure-missing-numerator.yml +8 -9
  100. package/manifests/{plugins → examples/builtins}/divide/success.yml +9 -10
  101. package/manifests/examples/builtins/exponent/success.yml +25 -0
  102. package/manifests/{plugins → examples/builtins}/groupby/success.yml +1 -1
  103. package/manifests/examples/builtins/interpolation/success.yml +23 -0
  104. package/manifests/{plugins → examples/builtins}/sci/failure-missing-input-param.yml +2 -6
  105. package/manifests/{plugins → examples/builtins}/sci/success.yml +0 -3
  106. package/manifests/examples/builtins/subtract/success.yml +24 -0
  107. package/manifests/{plugins → examples/builtins}/sum/success.yml +1 -1
  108. package/manifests/examples/{generics.yml → pipelines/generics.yml} +49 -13
  109. package/manifests/examples/{nesting.yml → pipelines/nesting.yml} +82 -35
  110. package/manifests/examples/{pipeline-teads-sci.yml → pipelines/pipeline-teads-sci.yml} +54 -18
  111. package/manifests/examples/{pipeline-with-aggregate.yml → pipelines/pipeline-with-aggregate.yml} +67 -25
  112. package/manifests/examples/{pipeline-with-mocks.yml → pipelines/pipeline-with-mocks.yml} +65 -22
  113. package/manifests/examples/pipelines/zeros.yml +130 -0
  114. package/manifests/outputs/bugs/aggregation-error-wrong-metric.yaml +243 -0
  115. package/manifests/outputs/bugs/initialize-error-no-config.yaml +78 -0
  116. package/manifests/outputs/bugs/initialize-error-no-path.yaml +91 -0
  117. package/manifests/outputs/bugs/initialize-error-no-plugins.yaml +74 -0
  118. package/manifests/outputs/bugs/input-error-missing-duration.yaml +84 -0
  119. package/manifests/outputs/bugs/mock-observations-failure-duration-is-zero.yaml +81 -0
  120. package/manifests/outputs/bugs/pipeline-error-naming-mismatch.yaml +91 -0
  121. package/manifests/outputs/bugs/pipeline-error-uninitialized-plugin.yaml +92 -0
  122. package/manifests/outputs/bugs/pipeline-ordering-error.yaml +155 -0
  123. package/manifests/outputs/bugs/sci-embodied-missing-resources-total.yaml +73 -0
  124. package/manifests/outputs/divide.yaml +93 -0
  125. package/manifests/outputs/features/aggregate-failure-invalid-metrics.yaml +101 -0
  126. package/manifests/outputs/features/aggregate-failure-missing-metric-in-inputs.yaml +100 -0
  127. package/manifests/outputs/features/aggregate-horizontal.yaml +128 -0
  128. package/manifests/outputs/features/aggregate-vertical.yaml +151 -0
  129. package/manifests/outputs/features/aggregate.yaml +155 -0
  130. package/manifests/outputs/pipelines/cloud-metadata-divide.yaml +95 -0
  131. package/manifests/outputs/pipelines/mock-obs-group-by-cloud-meta.yaml +645 -0
  132. package/manifests/outputs/pipelines/mock-obs-groupby.yaml +178 -0
  133. package/manifests/outputs/pipelines/mock-obs-time-sync.yaml +350 -0
  134. package/manifests/outputs/plugins/coefficient/failure-invalid-config-input-param.yaml +73 -0
  135. package/manifests/outputs/plugins/coefficient/failure-output-param-is-null.yaml +73 -0
  136. package/manifests/outputs/plugins/coefficient/success.yaml +75 -0
  137. package/manifests/outputs/plugins/csv-lookup/cloud-metadata/failure-invalid-instance-type.yaml +27 -0
  138. package/manifests/{plugins → outputs/plugins/csv-lookup}/cloud-metadata/failure-invalid-vendor.yaml +8 -2
  139. package/manifests/outputs/plugins/csv-lookup/cloud-metadata/failure-missing-cloud-vendor.yaml +77 -0
  140. package/manifests/outputs/plugins/csv-lookup/cloud-metadata/success.yaml +82 -0
  141. package/manifests/outputs/plugins/csv-lookup/region-metadata/failure-missing-column.yaml +76 -0
  142. package/manifests/outputs/plugins/csv-lookup/region-metadata/failure-missing-output.yaml +75 -0
  143. package/manifests/outputs/plugins/csv-lookup/region-metadata/success-renaming.yaml +80 -0
  144. package/manifests/outputs/plugins/csv-lookup/region-metadata/success.yaml +92 -0
  145. package/manifests/outputs/plugins/csv-lookup/tdp-finder/failure-missing-input-param.yaml +74 -0
  146. package/manifests/outputs/plugins/csv-lookup/tdp-finder/failure-unsupported-physical-processor.yaml +75 -0
  147. package/manifests/outputs/plugins/csv-lookup/tdp-finder/success.yaml +76 -0
  148. package/manifests/outputs/plugins/divide/failure-invalid-config-denominator.yaml +73 -0
  149. package/manifests/outputs/plugins/divide/failure-missing-numerator.yaml +77 -0
  150. package/manifests/outputs/plugins/divide/success-denominator-equal-zero.yaml +95 -0
  151. package/manifests/outputs/plugins/divide/success.yaml +95 -0
  152. package/manifests/outputs/plugins/exponent/success.yaml +77 -0
  153. package/manifests/outputs/plugins/groupby/failure-invalid-config-group.yaml +96 -0
  154. package/manifests/outputs/plugins/groupby/failure-missing-cloud-instance-type.yaml +95 -0
  155. package/manifests/outputs/plugins/groupby/success.yaml +101 -0
  156. package/manifests/outputs/plugins/interpolation/interpolation.yaml +83 -0
  157. package/manifests/outputs/plugins/interpolation/success.yaml +83 -0
  158. package/manifests/outputs/plugins/mock-observations/failure-invalid-config-cpu-range.yaml +86 -0
  159. package/manifests/outputs/plugins/mock-observations/failure-invalid-memory-utilization-range.yaml +84 -0
  160. package/manifests/outputs/plugins/mock-observations/failure-missing-timestamp-from-param.yaml +83 -0
  161. package/manifests/outputs/plugins/mock-observations/success.yaml +220 -0
  162. package/manifests/outputs/plugins/multiply/failure-input-parameter-is-missing.yaml +75 -0
  163. package/manifests/outputs/plugins/multiply/success-with-multiple-inputs.yaml +96 -0
  164. package/manifests/outputs/plugins/multiply/success.yaml +78 -0
  165. package/manifests/outputs/plugins/regex/failure-missing-input-param.yaml +75 -0
  166. package/manifests/outputs/plugins/regex/failure-not-matching-with-regex.yaml +76 -0
  167. package/manifests/outputs/plugins/regex/success.yaml +81 -0
  168. package/manifests/outputs/plugins/sci/failure-invalid-config-value.yaml +72 -0
  169. package/manifests/outputs/plugins/sci/failure-missing-input-param.yaml +72 -0
  170. package/manifests/outputs/plugins/sci/success.yml.yaml +80 -0
  171. package/manifests/outputs/plugins/sci-embodied/failure-invalid-default-emission-value.yaml +75 -0
  172. package/manifests/outputs/plugins/sci-embodied/failure-missing-expected-lifespan.yaml +71 -0
  173. package/manifests/outputs/plugins/sci-embodied/success.yaml +78 -0
  174. package/manifests/outputs/plugins/shell/failure-invalid-command.yaml +70 -0
  175. package/manifests/outputs/plugins/shell/success.yaml +68 -0
  176. package/manifests/outputs/plugins/subtract/success.yaml +78 -0
  177. package/manifests/outputs/plugins/sum/failure-missing-input-param.yaml +75 -0
  178. package/manifests/outputs/plugins/sum/failure-missing-output-param.yaml +78 -0
  179. package/manifests/outputs/plugins/sum/success.yaml +78 -0
  180. package/manifests/outputs/plugins/time-sync/failure-config-start-later-end.yaml +82 -0
  181. package/manifests/outputs/plugins/time-sync/failure-missing-global-config.yaml +78 -0
  182. package/manifests/outputs/plugins/time-sync/success.yaml +119 -0
  183. package/package.json +10 -4
  184. package/src/__mocks__/mock-manifest.yaml +72 -0
  185. package/src/builtins/README.md +1 -1
  186. package/src/builtins/coefficient/README.md +19 -1
  187. package/src/builtins/copy-param/README.md +104 -0
  188. package/src/builtins/csv-lookup/README.md +39 -1
  189. package/src/builtins/divide/README.md +29 -3
  190. package/src/builtins/exponent/README.md +21 -1
  191. package/src/builtins/interpolation/README.md +29 -1
  192. package/src/builtins/mock-observations/README.md +1 -1
  193. package/src/builtins/multiply/README.md +16 -1
  194. package/src/builtins/regex/README.md +32 -2
  195. package/src/builtins/sci/README.md +24 -1
  196. package/src/builtins/sci-embodied/README.md +15 -1
  197. package/src/builtins/shell/README.md +12 -1
  198. package/src/builtins/subtract/README.md +12 -1
  199. package/src/builtins/sum/README.md +28 -1
  200. package/src/config/env-template.yml +24 -0
  201. package/build/builtins/coefficient/types.d.ts +0 -5
  202. package/build/builtins/coefficient/types.js +0 -3
  203. package/build/builtins/exponent/types.d.ts +0 -5
  204. package/build/builtins/exponent/types.js +0 -3
  205. package/build/builtins/interpolation/types.d.ts +0 -5
  206. package/build/builtins/interpolation/types.js +0 -10
  207. package/build/builtins/mock-observations/types.d.ts +0 -13
  208. package/build/builtins/mock-observations/types.js +0 -3
  209. package/build/builtins/multiply/types.d.ts +0 -4
  210. package/build/builtins/multiply/types.js +0 -3
  211. package/build/builtins/subtract/types.d.ts +0 -4
  212. package/build/builtins/subtract/types.js +0 -3
  213. package/build/builtins/sum/types.d.ts +0 -4
  214. package/build/builtins/sum/types.js +0 -3
  215. package/build/types/common.d.ts +0 -4
  216. package/build/types/common.js +0 -3
  217. package/build/types/group-by.d.ts +0 -3
  218. package/build/types/group-by.js +0 -3
  219. package/build/types/helpers.d.ts +0 -4
  220. package/build/types/helpers.js +0 -3
  221. package/build/util/errors.d.ts +0 -6
  222. package/build/util/errors.js +0 -33
  223. package/manifests/bugs/aggregation-error-wrong-metric.yml +0 -128
  224. package/manifests/bugs/azure-importer-ignoring-defaults.yml +0 -61
  225. package/manifests/bugs/azure-importer-incorrect-calculation.yml +0 -56
  226. package/manifests/bugs/initialize-error-no-config.yml +0 -27
  227. package/manifests/bugs/initialize-error-no-path.yml +0 -28
  228. package/manifests/bugs/initialize-error-no-plugins.yml +0 -23
  229. package/manifests/bugs/input-error-missing-duration.yml +0 -21
  230. package/manifests/bugs/mock-observations-failure-duration-is-zero.yml +0 -34
  231. package/manifests/bugs/pipeline-error-naming-mismatch.yml +0 -28
  232. package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +0 -29
  233. package/manifests/bugs/pipeline-ordering-error.yml +0 -82
  234. package/manifests/bugs/sci-embodied-missing-resources-total.yml +0 -23
  235. package/manifests/examples/basic.yml +0 -28
  236. package/manifests/examples/mock-cpu-util-to-carbon.yml +0 -70
  237. package/manifests/features/aggregate-failure-inalid-metrics.yml +0 -43
  238. package/manifests/features/aggregate-failure-missing-metric-in-inputs.yml +0 -43
  239. package/manifests/features/aggregate-horizontal.yml +0 -44
  240. package/manifests/features/aggregate-vertical.yml +0 -44
  241. package/manifests/features/aggregate.yml +0 -44
  242. package/manifests/integrations/cloud-metadata-divide-boavizta.yml +0 -38
  243. package/manifests/integrations/mock-obs-group-by-cloud-meta.yml +0 -51
  244. package/manifests/integrations/mock-obs-groupby.yml +0 -39
  245. package/manifests/integrations/mock-obs-time-sync.yml +0 -65
  246. package/manifests/plugins/tdp-finder/failure-missing-input-param.yml +0 -18
  247. package/manifests/plugins/tdp-finder/failure-unsupported-physical-processor.yml +0 -19
  248. package/manifests/plugins/tdp-finder/success.yml +0 -19
  249. /package/manifests/{plugins → examples/builtins}/coefficient/failure-invalid-config-input-param.yml +0 -0
  250. /package/manifests/{plugins → examples/builtins}/coefficient/failure-output-param-is-null.yaml +0 -0
  251. /package/manifests/{plugins → examples/builtins}/coefficient/success.yml +0 -0
  252. /package/manifests/{plugins → examples/builtins}/groupby/failure-invalid-config-group.yml +0 -0
  253. /package/manifests/{plugins → examples/builtins}/groupby/failure-missing-cloud-instance-type.yml +0 -0
  254. /package/manifests/{plugins → examples/builtins}/interpolation/interpolation.yml +0 -0
  255. /package/manifests/{plugins → examples/builtins}/mock-observations/failure-invalid-config-cpu-range.yml +0 -0
  256. /package/manifests/{plugins → examples/builtins}/mock-observations/failure-invalid-memory-utilization-range.yml +0 -0
  257. /package/manifests/{plugins → examples/builtins}/mock-observations/failure-missing-timestamp-from-param.yml +0 -0
  258. /package/manifests/{plugins → examples/builtins}/mock-observations/success.yml +0 -0
  259. /package/manifests/{plugins → examples/builtins}/multiply/failure-input-parameter-is-missing.yml +0 -0
  260. /package/manifests/{plugins → examples/builtins}/multiply/success-with-multiple-inputs.yml +0 -0
  261. /package/manifests/{plugins → examples/builtins}/multiply/success.yml +0 -0
  262. /package/manifests/{plugins → examples/builtins}/regex/failure-missing-input-param.yml +0 -0
  263. /package/manifests/{plugins → examples/builtins}/regex/failure-not-matching-with-regex.yml +0 -0
  264. /package/manifests/{plugins → examples/builtins}/regex/success.yml +0 -0
  265. /package/manifests/{plugins → examples/builtins}/sci/failure-invalid-config-value.yml +0 -0
  266. /package/manifests/{plugins → examples/builtins}/sci-embodied/failure-invalid-default-emission-value.yml +0 -0
  267. /package/manifests/{plugins → examples/builtins}/sci-embodied/failure-missing-expected-lifespan.yml +0 -0
  268. /package/manifests/{plugins → examples/builtins}/sci-embodied/success.yml +0 -0
  269. /package/manifests/{plugins → examples/builtins}/shell/failure-invalid-command.yml +0 -0
  270. /package/manifests/{plugins → examples/builtins}/shell/success.yml +0 -0
  271. /package/manifests/{plugins → examples/builtins}/sum/failure-missing-input-param.yml +0 -0
  272. /package/manifests/{plugins → examples/builtins}/sum/failure-missing-output-param.yml +0 -0
  273. /package/manifests/{plugins → examples/builtins}/time-sync/failure-config-start-later-end.yml +0 -0
  274. /package/manifests/{plugins → examples/builtins}/time-sync/failure-missing-global-config.yml +0 -0
  275. /package/manifests/{plugins → examples/builtins}/time-sync/success.yml +0 -0
  276. /package/manifests/examples/{instance-metadata.yml → pipelines/instance-metadata.yml} +0 -0
  277. /package/manifests/examples/{sci.yml → pipelines/sci.yml} +0 -0
  278. /package/manifests/examples/{teads-curve.yml → pipelines/teads-curve.yml} +0 -0
@@ -0,0 +1,75 @@
1
+ name: sum
2
+ description: failure with `inputs[0]` misses one of `global-config.input-parameters`
3
+ tags: null
4
+ initialize:
5
+ outputs:
6
+ - yaml
7
+ plugins:
8
+ sum:
9
+ method: Sum
10
+ path: builtin
11
+ global-config:
12
+ input-parameters:
13
+ - cpu/energy
14
+ - network/energy
15
+ output-parameter: energy
16
+ execution:
17
+ status: fail
18
+ command: >-
19
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
20
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
21
+ manifests/outputs/plugins/sum/failure-missing-input-param.yml -o
22
+ manifests/outputs/plugins/sum/failure-missing-input-param
23
+ environment:
24
+ if-version: 0.4.0
25
+ os: macOS
26
+ os-version: '13.2'
27
+ node-version: 18.14.2
28
+ date-time: 2024-07-02T20:55:20.733Z (UTC)
29
+ dependencies:
30
+ - '@babel/core@7.22.10'
31
+ - '@babel/preset-typescript@7.23.3'
32
+ - '@commitlint/cli@18.6.0'
33
+ - '@commitlint/config-conventional@18.6.0'
34
+ - '@grnsft/if-core@0.0.10'
35
+
36
+ - '@jest/globals@29.7.0'
37
+ - '@types/jest@29.5.8'
38
+ - '@types/js-yaml@4.0.9'
39
+ - '@types/luxon@3.4.2'
40
+ - '@types/node@20.9.0'
41
+ - axios-mock-adapter@1.22.0
42
+ - axios@1.7.2
43
+ - cross-env@7.0.3
44
+ - csv-parse@5.5.6
45
+ - csv-stringify@6.4.6
46
+ - fixpack@4.0.0
47
+ - gts@5.2.0
48
+ - husky@8.0.3
49
+ - jest@29.7.0
50
+ - js-yaml@4.1.0
51
+ - lint-staged@15.2.2
52
+ - luxon@3.4.4
53
+ - release-it@16.3.0
54
+ - rimraf@5.0.5
55
+ - ts-command-line-args@2.5.1
56
+ - ts-jest@29.1.1
57
+ - typescript-cubic-spline@1.0.1
58
+ - typescript@5.2.2
59
+ - winston@3.11.0
60
+ - zod@3.22.4
61
+ error: >-
62
+ InputValidationError: "cpu/energy" parameter is required. Error code:
63
+ invalid_type.
64
+ tree:
65
+ children:
66
+ child:
67
+ pipeline:
68
+ - sum
69
+ config:
70
+ sum: null
71
+ inputs:
72
+ - timestamp: 2023-08-06T00:00
73
+ duration: 3600
74
+ cpu: 0.001
75
+ network/energy: 0.001
@@ -0,0 +1,78 @@
1
+ name: sum
2
+ description: missing `output-parameter` in global-config
3
+ tags: null
4
+ initialize:
5
+ outputs:
6
+ - yaml
7
+ plugins:
8
+ sum:
9
+ method: Sum
10
+ path: builtin
11
+ global-config:
12
+ input-parameters:
13
+ - cpu/energy
14
+ - network/energy
15
+ execution:
16
+ status: fail
17
+ command: >-
18
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
19
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
20
+ manifests/outputs/plugins/sum/failure-missing-output-param.yml -o
21
+ manifests/outputs/plugins/sum/failure-missing-output-param
22
+ environment:
23
+ if-version: 0.4.0
24
+ os: macOS
25
+ os-version: '13.2'
26
+ node-version: 18.14.2
27
+ date-time: 2024-07-02T20:54:23.422Z (UTC)
28
+ dependencies:
29
+ - '@babel/core@7.22.10'
30
+ - '@babel/preset-typescript@7.23.3'
31
+ - '@commitlint/cli@18.6.0'
32
+ - '@commitlint/config-conventional@18.6.0'
33
+ - '@grnsft/if-core@0.0.10'
34
+
35
+ - '@jest/globals@29.7.0'
36
+ - '@types/jest@29.5.8'
37
+ - '@types/js-yaml@4.0.9'
38
+ - '@types/luxon@3.4.2'
39
+ - '@types/node@20.9.0'
40
+ - axios-mock-adapter@1.22.0
41
+ - axios@1.7.2
42
+ - cross-env@7.0.3
43
+ - csv-parse@5.5.6
44
+ - csv-stringify@6.4.6
45
+ - fixpack@4.0.0
46
+ - gts@5.2.0
47
+ - husky@8.0.3
48
+ - jest@29.7.0
49
+ - js-yaml@4.1.0
50
+ - lint-staged@15.2.2
51
+ - luxon@3.4.4
52
+ - release-it@16.3.0
53
+ - rimraf@5.0.5
54
+ - ts-command-line-args@2.5.1
55
+ - ts-jest@29.1.1
56
+ - typescript-cubic-spline@1.0.1
57
+ - typescript@5.2.2
58
+ - winston@3.11.0
59
+ - zod@3.22.4
60
+ error: >-
61
+ InputValidationError: "output-parameter" parameter is required. Error code:
62
+ invalid_type.
63
+ tree:
64
+ children:
65
+ child:
66
+ pipeline:
67
+ - sum
68
+ config:
69
+ sum: null
70
+ inputs:
71
+ - timestamp: 2023-08-06T00:00
72
+ duration: 3600
73
+ cpu/energy: 0.001
74
+ network/energy: 0.001
75
+ - timestamp: 2023-08-06T00:00
76
+ duration: 3600
77
+ cpu/energy: 0.001
78
+ network/energy: e
@@ -0,0 +1,78 @@
1
+ name: sum
2
+ description: successful path
3
+ tags: null
4
+ initialize:
5
+ plugins:
6
+ sum:
7
+ path: builtin
8
+ method: Sum
9
+ global-config:
10
+ input-parameters:
11
+ - cpu/energy
12
+ - network/energy
13
+ output-parameter: energy
14
+ outputs:
15
+ - yaml
16
+ execution:
17
+ command: >-
18
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
19
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
20
+ manifests/outputs/plugins/sum/success.yml -o
21
+ manifests/outputs/plugins/sum/success
22
+ environment:
23
+ if-version: 0.4.0
24
+ os: macOS
25
+ os-version: '13.2'
26
+ node-version: 18.14.2
27
+ date-time: 2024-07-02T20:53:35.496Z (UTC)
28
+ dependencies:
29
+ - '@babel/core@7.22.10'
30
+ - '@babel/preset-typescript@7.23.3'
31
+ - '@commitlint/cli@18.6.0'
32
+ - '@commitlint/config-conventional@18.6.0'
33
+ - '@grnsft/if-core@0.0.10'
34
+
35
+ - '@jest/globals@29.7.0'
36
+ - '@types/jest@29.5.8'
37
+ - '@types/js-yaml@4.0.9'
38
+ - '@types/luxon@3.4.2'
39
+ - '@types/node@20.9.0'
40
+ - axios-mock-adapter@1.22.0
41
+ - axios@1.7.2
42
+ - cross-env@7.0.3
43
+ - csv-parse@5.5.6
44
+ - csv-stringify@6.4.6
45
+ - fixpack@4.0.0
46
+ - gts@5.2.0
47
+ - husky@8.0.3
48
+ - jest@29.7.0
49
+ - js-yaml@4.1.0
50
+ - lint-staged@15.2.2
51
+ - luxon@3.4.4
52
+ - release-it@16.3.0
53
+ - rimraf@5.0.5
54
+ - ts-command-line-args@2.5.1
55
+ - ts-jest@29.1.1
56
+ - typescript-cubic-spline@1.0.1
57
+ - typescript@5.2.2
58
+ - winston@3.11.0
59
+ - zod@3.22.4
60
+ status: success
61
+ tree:
62
+ children:
63
+ child:
64
+ pipeline:
65
+ - sum
66
+ config:
67
+ sum: null
68
+ inputs:
69
+ - timestamp: 2023-08-06T00:00
70
+ duration: 3600
71
+ cpu/energy: 0.001
72
+ network/energy: 0.001
73
+ outputs:
74
+ - timestamp: 2023-08-06T00:00
75
+ duration: 3600
76
+ cpu/energy: 0.001
77
+ network/energy: 0.001
78
+ energy: 0.002
@@ -0,0 +1,82 @@
1
+ name: time-sync
2
+ description: >-
3
+ failure with `global-config.start-time` being later than
4
+ `global-config.end-time`
5
+ tags: null
6
+ initialize:
7
+ outputs:
8
+ - yaml
9
+ plugins:
10
+ time-sync:
11
+ method: TimeSync
12
+ path: builtin
13
+ global-config:
14
+ start-time: '2023-12-12T00:01:00.000Z'
15
+ end-time: '2023-12-12T00:00:00.000Z'
16
+ interval: 5
17
+ allow-padding: true
18
+ execution:
19
+ status: fail
20
+ command: >-
21
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
22
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
23
+ manifests/outputs/plugins/time-sync/failure-config-start-later-end.yml -o
24
+ manifests/outputs/plugins/time-sync/failure-config-start-later-end
25
+ environment:
26
+ if-version: 0.4.0
27
+ os: macOS
28
+ os-version: '13.2'
29
+ node-version: 18.14.2
30
+ date-time: 2024-07-02T21:13:59.114Z (UTC)
31
+ dependencies:
32
+ - '@babel/core@7.22.10'
33
+ - '@babel/preset-typescript@7.23.3'
34
+ - '@commitlint/cli@18.6.0'
35
+ - '@commitlint/config-conventional@18.6.0'
36
+ - '@grnsft/if-core@0.0.10'
37
+
38
+ - '@jest/globals@29.7.0'
39
+ - '@types/jest@29.5.8'
40
+ - '@types/js-yaml@4.0.9'
41
+ - '@types/luxon@3.4.2'
42
+ - '@types/node@20.9.0'
43
+ - axios-mock-adapter@1.22.0
44
+ - axios@1.7.2
45
+ - cross-env@7.0.3
46
+ - csv-parse@5.5.6
47
+ - csv-stringify@6.4.6
48
+ - fixpack@4.0.0
49
+ - gts@5.2.0
50
+ - husky@8.0.3
51
+ - jest@29.7.0
52
+ - js-yaml@4.1.0
53
+ - lint-staged@15.2.2
54
+ - luxon@3.4.4
55
+ - release-it@16.3.0
56
+ - rimraf@5.0.5
57
+ - ts-command-line-args@2.5.1
58
+ - ts-jest@29.1.1
59
+ - typescript-cubic-spline@1.0.1
60
+ - typescript@5.2.2
61
+ - winston@3.11.0
62
+ - zod@3.22.4
63
+ error: 'InputValidationError: `start-time` should be lower than `end-time`'
64
+ tree:
65
+ children:
66
+ child:
67
+ pipeline:
68
+ - time-sync
69
+ config: null
70
+ inputs:
71
+ - timestamp: '2023-12-12T00:00:00.000Z'
72
+ duration: 1
73
+ energy-cpu: 0.001
74
+ - timestamp: '2023-12-12T00:00:01.000Z'
75
+ duration: 5
76
+ energy-cpu: 0.001
77
+ - timestamp: '2023-12-12T00:00:06.000Z'
78
+ duration: 7
79
+ energy-cpu: 0.001
80
+ - timestamp: '2023-12-12T00:00:13.000Z'
81
+ duration: 30
82
+ energy-cpu: 0.001
@@ -0,0 +1,78 @@
1
+ name: time-sync
2
+ description: missing global config
3
+ tags: null
4
+ initialize:
5
+ outputs:
6
+ - yaml
7
+ plugins:
8
+ time-sync:
9
+ method: TimeSync
10
+ path: builtin
11
+ global-config: null
12
+ execution:
13
+ status: fail
14
+ command: >-
15
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
16
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
17
+ manifests/outputs/plugins/time-sync/failure-missing-global-config.yml -o
18
+ manifests/outputs/plugins/time-sync/failure-missing-global-config
19
+ environment:
20
+ if-version: 0.4.0
21
+ os: macOS
22
+ os-version: '13.2'
23
+ node-version: 18.14.2
24
+ date-time: 2024-07-02T21:13:12.360Z (UTC)
25
+ dependencies:
26
+ - '@babel/core@7.22.10'
27
+ - '@babel/preset-typescript@7.23.3'
28
+ - '@commitlint/cli@18.6.0'
29
+ - '@commitlint/config-conventional@18.6.0'
30
+ - '@grnsft/if-core@0.0.10'
31
+
32
+ - '@jest/globals@29.7.0'
33
+ - '@types/jest@29.5.8'
34
+ - '@types/js-yaml@4.0.9'
35
+ - '@types/luxon@3.4.2'
36
+ - '@types/node@20.9.0'
37
+ - axios-mock-adapter@1.22.0
38
+ - axios@1.7.2
39
+ - cross-env@7.0.3
40
+ - csv-parse@5.5.6
41
+ - csv-stringify@6.4.6
42
+ - fixpack@4.0.0
43
+ - gts@5.2.0
44
+ - husky@8.0.3
45
+ - jest@29.7.0
46
+ - js-yaml@4.1.0
47
+ - lint-staged@15.2.2
48
+ - luxon@3.4.4
49
+ - release-it@16.3.0
50
+ - rimraf@5.0.5
51
+ - ts-command-line-args@2.5.1
52
+ - ts-jest@29.1.1
53
+ - typescript-cubic-spline@1.0.1
54
+ - typescript@5.2.2
55
+ - winston@3.11.0
56
+ - zod@3.22.4
57
+ error: >-
58
+ ManifestValidationError: "initialize.plugins.time-sync.global-config"
59
+ parameter is expected object, received null. Error code: invalid_type.
60
+ tree:
61
+ children:
62
+ child:
63
+ pipeline:
64
+ - time-sync
65
+ config: null
66
+ inputs:
67
+ - timestamp: '2023-12-12T00:00:00.000Z'
68
+ duration: 3
69
+ energy-cpu: 0.001
70
+ - timestamp: '2023-12-12T00:00:01.000Z'
71
+ duration: 5
72
+ energy-cpu: 0.001
73
+ - timestamp: '2023-12-12T00:00:06.000Z'
74
+ duration: 7
75
+ energy-cpu: 0.001
76
+ - timestamp: '2023-12-12T00:00:13.000Z'
77
+ duration: 30
78
+ energy-cpu: 0.001
@@ -0,0 +1,119 @@
1
+ name: time-sync
2
+ description: successful path
3
+ tags: null
4
+ initialize:
5
+ plugins:
6
+ time-sync:
7
+ path: builtin
8
+ method: TimeSync
9
+ global-config:
10
+ start-time: '2023-12-12T00:00:00.000Z'
11
+ end-time: '2023-12-12T00:01:00.000Z'
12
+ interval: 5
13
+ allow-padding: true
14
+ outputs:
15
+ - yaml
16
+ execution:
17
+ command: >-
18
+ /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
19
+ /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
20
+ manifests/outputs/plugins/time-sync/success.yml -o
21
+ manifests/outputs/plugins/time-sync/success -s
22
+ environment:
23
+ if-version: 0.4.0
24
+ os: macOS
25
+ os-version: '13.2'
26
+ node-version: 18.14.2
27
+ date-time: 2024-07-02T21:12:32.629Z (UTC)
28
+ dependencies:
29
+ - '@babel/core@7.22.10'
30
+ - '@babel/preset-typescript@7.23.3'
31
+ - '@commitlint/cli@18.6.0'
32
+ - '@commitlint/config-conventional@18.6.0'
33
+ - '@grnsft/if-core@0.0.10'
34
+
35
+ - '@jest/globals@29.7.0'
36
+ - '@types/jest@29.5.8'
37
+ - '@types/js-yaml@4.0.9'
38
+ - '@types/luxon@3.4.2'
39
+ - '@types/node@20.9.0'
40
+ - axios-mock-adapter@1.22.0
41
+ - axios@1.7.2
42
+ - cross-env@7.0.3
43
+ - csv-parse@5.5.6
44
+ - csv-stringify@6.4.6
45
+ - fixpack@4.0.0
46
+ - gts@5.2.0
47
+ - husky@8.0.3
48
+ - jest@29.7.0
49
+ - js-yaml@4.1.0
50
+ - lint-staged@15.2.2
51
+ - luxon@3.4.4
52
+ - release-it@16.3.0
53
+ - rimraf@5.0.5
54
+ - ts-command-line-args@2.5.1
55
+ - ts-jest@29.1.1
56
+ - typescript-cubic-spline@1.0.1
57
+ - typescript@5.2.2
58
+ - winston@3.11.0
59
+ - zod@3.22.4
60
+ status: success
61
+ tree:
62
+ children:
63
+ child:
64
+ pipeline:
65
+ - time-sync
66
+ config: null
67
+ inputs:
68
+ - timestamp: '2023-12-12T00:00:00.000Z'
69
+ duration: 1
70
+ energy-cpu: 0.001
71
+ - timestamp: '2023-12-12T00:00:01.000Z'
72
+ duration: 5
73
+ energy-cpu: 0.001
74
+ - timestamp: '2023-12-12T00:00:06.000Z'
75
+ duration: 7
76
+ energy-cpu: 0.001
77
+ - timestamp: '2023-12-12T00:00:13.000Z'
78
+ duration: 30
79
+ energy-cpu: 0.001
80
+ outputs:
81
+ - timestamp: '2023-12-12T00:00:00.000Z'
82
+ duration: 5
83
+ energy-cpu: 0.0018000000000000004
84
+ - timestamp: '2023-12-12T00:00:05.000Z'
85
+ duration: 5
86
+ energy-cpu: 0.0007714285714285716
87
+ - timestamp: '2023-12-12T00:00:10.000Z'
88
+ duration: 5
89
+ energy-cpu: 0.0004952380952380952
90
+ - timestamp: '2023-12-12T00:00:15.000Z'
91
+ duration: 5
92
+ energy-cpu: 0.0001666666666666667
93
+ - timestamp: '2023-12-12T00:00:20.000Z'
94
+ duration: 5
95
+ energy-cpu: 0.0001666666666666667
96
+ - timestamp: '2023-12-12T00:00:25.000Z'
97
+ duration: 5
98
+ energy-cpu: 0.0001666666666666667
99
+ - timestamp: '2023-12-12T00:00:30.000Z'
100
+ duration: 5
101
+ energy-cpu: 0.0001666666666666667
102
+ - timestamp: '2023-12-12T00:00:35.000Z'
103
+ duration: 5
104
+ energy-cpu: 0.0001666666666666667
105
+ - timestamp: '2023-12-12T00:00:40.000Z'
106
+ duration: 5
107
+ energy-cpu: 0.0001
108
+ - timestamp: '2023-12-12T00:00:45.000Z'
109
+ duration: 5
110
+ energy-cpu: 0
111
+ - timestamp: '2023-12-12T00:00:50.000Z'
112
+ duration: 5
113
+ energy-cpu: 0
114
+ - timestamp: '2023-12-12T00:00:55.000Z'
115
+ duration: 5
116
+ energy-cpu: 0
117
+ - timestamp: '2023-12-12T00:01:00.000Z'
118
+ duration: 1
119
+ energy-cpu: 0
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@grnsft/if",
3
3
  "description": "Impact Framework",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "author": {
6
6
  "name": "Green Software Foundation",
7
7
  "email": "info@gsf.com"
8
8
  },
9
9
  "bin": {
10
- "ie": "./build/index.js",
11
- "if-diff": "./build/diff.js"
10
+ "if-diff": "./build/diff.js",
11
+ "if-run": "./build/index.js",
12
+ "if-env": "./build/env.js",
13
+ "if-check": "./build/check.js"
12
14
  },
13
15
  "bugs": {
14
16
  "url": "https://github.com/Green-Software-Foundation/if/issues/new?assignees=&labels=feedback&projects=&template=feedback.md&title=Feedback+-+"
@@ -16,6 +18,7 @@
16
18
  "dependencies": {
17
19
  "@commitlint/cli": "^18.6.0",
18
20
  "@commitlint/config-conventional": "^18.6.0",
21
+ "@grnsft/if-core": "^0.0.10",
19
22
  "axios": "^1.7.2",
20
23
  "csv-parse": "^5.5.6",
21
24
  "csv-stringify": "^6.4.6",
@@ -36,6 +39,7 @@
36
39
  "@types/luxon": "^3.4.2",
37
40
  "@types/node": "^20.8.9",
38
41
  "axios-mock-adapter": "^1.22.0",
42
+ "cross-env": "7.0.3",
39
43
  "fixpack": "^4.0.0",
40
44
  "gts": "^5.0.0",
41
45
  "husky": "^8.0.0",
@@ -72,8 +76,10 @@
72
76
  "coverage": "jest --verbose --coverage --testPathPattern=src/__tests__/unit",
73
77
  "fix": "gts fix",
74
78
  "fix:package": "fixpack",
75
- "ie": "npx ts-node src/index.ts",
79
+ "if-check": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/check.ts",
76
80
  "if-diff": "npx ts-node src/diff.ts",
81
+ "if-env": "cross-env CURRENT_DIR=$(node -p \"process.env.INIT_CWD\") npx ts-node src/env.ts",
82
+ "if-run": "npx ts-node src/index.ts",
77
83
  "lint": "gts lint",
78
84
  "pre-commit": "lint-staged",
79
85
  "prepare": "husky install",
@@ -0,0 +1,72 @@
1
+ name: template manifest
2
+ description: auto-generated template
3
+ tags: null
4
+ initialize:
5
+ plugins:
6
+ memory-energy-from-memory-util:
7
+ path: builtin
8
+ method: Coefficient
9
+ global-config:
10
+ input-parameter: memory/utilization
11
+ coefficient: 0.0001
12
+ output-parameter: memory/energy
13
+ outputs:
14
+ - yaml
15
+ execution:
16
+ command: >-
17
+ /Users/manushak/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
18
+ /Users/manushak/Documents/Projects/Green-Software/if/src/index.ts -m
19
+ ./src/env-template.yml -o ./manifests/outputs/template
20
+ environment:
21
+ if-version: 0.4.0
22
+ os: macOS
23
+ os-version: 13.6.6
24
+ node-version: 20.12.2
25
+ date-time: 2024-06-18T08:39:55.771Z (UTC)
26
+ dependencies:
27
+ - "@babel/core@7.22.10"
28
+ - "@babel/preset-typescript@7.23.3"
29
+ - "@commitlint/cli@18.6.0"
30
+ - "@commitlint/config-conventional@18.6.0"
31
+ - "@grnsft/if-core@0.0.3"
32
+ - "@jest/globals@29.7.0"
33
+ - "@types/jest@29.5.8"
34
+ - "@types/js-yaml@4.0.9"
35
+ - "@types/luxon@3.4.2"
36
+ - "@types/node@20.9.0"
37
+ - axios-mock-adapter@1.22.0
38
+ - axios@1.7.2
39
+ - cross-env@7.0.3
40
+ - csv-parse@5.5.6
41
+ - csv-stringify@6.4.6
42
+ - fixpack@4.0.0
43
+ - gts@5.2.0
44
+ - husky@8.0.3
45
+ - jest@29.7.0
46
+ - js-yaml@4.1.0
47
+ - lint-staged@15.2.2
48
+ - luxon@3.4.4
49
+ - release-it@16.3.0
50
+ - rimraf@5.0.5
51
+ - ts-command-line-args@2.5.1
52
+ - ts-jest@29.1.1
53
+ - typescript-cubic-spline@1.0.1
54
+ - typescript@5.2.2
55
+ - winston@3.11.0
56
+ - zod@3.22.4
57
+ status: success
58
+ tree:
59
+ children:
60
+ child:
61
+ pipeline:
62
+ - memory-energy-from-memory-util
63
+ config: null
64
+ inputs:
65
+ - timestamp: 2023-12-12T00:00:00.000Z
66
+ duration: 3600
67
+ memory/utilization: 10
68
+ outputs:
69
+ - timestamp: 2023-12-12T00:00:00.000Z
70
+ duration: 3600
71
+ memory/utilization: 10
72
+ memory/energy: 0.001
@@ -305,7 +305,7 @@ Then, you must select the metric you want to export to CSV. The name of that met
305
305
  For example, to export the `carbon` data from your tree to a CSV file:
306
306
 
307
307
  ```sh
308
- ie --manifest example.yml --output example#carbon
308
+ if-run --manifest example.yml --output example#carbon
309
309
  ```
310
310
 
311
311
  This will save a CSV file called `example.csv`. The contents will look similar to the following:
@@ -86,7 +86,25 @@ tree:
86
86
  You can run this example by saving it as `./examples/manifests/coefficient.yml` and executing the following command from the project root:
87
87
 
88
88
  ```sh
89
- ie --manifest ./examples/manifests/coefficient.yml --output ./examples/outputs/coefficient.yml
89
+ if-run --manifest ./examples/manifests/coefficient.yml --output ./examples/outputs/coefficient.yml
90
90
  ```
91
91
 
92
92
  The results will be saved to a new `yaml` file in `./examples/outputs`
93
+
94
+
95
+ ## Errors
96
+
97
+ `Coefficient` exposes one of the IF error classes.
98
+
99
+ ### GlobalConfigError
100
+
101
+ You will receive an error starting `GlobalConfigError: ` if you have not provided the expected configuration data in the plugin's `initialize` block.
102
+
103
+ The required parameters are:
104
+ - `input-parameter`: this must be a string
105
+ - `coefficient`: this must be a number
106
+ - `output-parameter`: this must be a string
107
+
108
+ You can fix this error by checking you are providing valid values for each parameter in the config.
109
+
110
+ For more information on our error classes, please visit [our docs](https://if.greensoftware.foundation/reference/errors