@grnsft/if 0.3.2 → 0.3.4

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 (187) hide show
  1. package/.commitlintrc.js +3 -0
  2. package/.env +5 -0
  3. package/.release-it.json +18 -0
  4. package/CONTRIBUTING.md +77 -4
  5. package/README.md +34 -26
  6. package/build/builtins/export-csv-raw.js +4 -4
  7. package/build/builtins/export-csv.js +5 -5
  8. package/build/builtins/export-log.js +26 -2
  9. package/build/builtins/export-yaml.js +3 -3
  10. package/build/config/config.d.ts +3 -3
  11. package/build/config/config.js +23 -27
  12. package/build/config/strings.d.ts +1 -0
  13. package/build/config/strings.js +8 -3
  14. package/build/index.js +23 -14
  15. package/build/lib/environment.d.ts +5 -0
  16. package/build/lib/environment.js +69 -0
  17. package/build/lib/exhaust.d.ts +2 -1
  18. package/build/lib/exhaust.js +11 -9
  19. package/build/lib/initialize.d.ts +2 -2
  20. package/build/lib/initialize.js +5 -5
  21. package/build/lib/load.d.ts +1 -29
  22. package/build/lib/load.js +2 -5
  23. package/build/types/environment.d.ts +18 -0
  24. package/build/types/environment.js +3 -0
  25. package/build/types/manifest.d.ts +1 -0
  26. package/build/types/manifest.js +1 -1
  27. package/build/types/process-args.d.ts +13 -1
  28. package/build/types/process-args.js +1 -1
  29. package/build/util/args.d.ts +3 -5
  30. package/build/util/args.js +14 -10
  31. package/build/util/errors.d.ts +1 -1
  32. package/build/util/errors.js +2 -3
  33. package/build/util/helpers.d.ts +6 -0
  34. package/build/util/helpers.js +9 -3
  35. package/build/util/os-checker.d.ts +7 -0
  36. package/build/util/os-checker.js +97 -0
  37. package/build/util/validations.d.ts +90 -4
  38. package/build/util/validations.js +14 -2
  39. package/coverage/clover.xml +1590 -0
  40. package/coverage/coverage-final.json +50 -0
  41. package/coverage/lcov-report/base.css +224 -0
  42. package/coverage/lcov-report/block-navigation.js +87 -0
  43. package/coverage/lcov-report/builtins/coefficient/index.html +116 -0
  44. package/coverage/lcov-report/builtins/coefficient/index.ts.html +295 -0
  45. package/coverage/lcov-report/builtins/csv-lookup/index.html +116 -0
  46. package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +832 -0
  47. package/coverage/lcov-report/builtins/divide/index.html +116 -0
  48. package/coverage/lcov-report/builtins/divide/index.ts.html +361 -0
  49. package/coverage/lcov-report/builtins/exponent/index.html +116 -0
  50. package/coverage/lcov-report/builtins/exponent/index.ts.html +355 -0
  51. package/coverage/lcov-report/builtins/export-csv-raw.ts.html +553 -0
  52. package/coverage/lcov-report/builtins/export-csv.ts.html +433 -0
  53. package/coverage/lcov-report/builtins/export-log.ts.html +145 -0
  54. package/coverage/lcov-report/builtins/export-yaml.ts.html +184 -0
  55. package/coverage/lcov-report/builtins/group-by.ts.html +364 -0
  56. package/coverage/lcov-report/builtins/index.html +206 -0
  57. package/coverage/lcov-report/builtins/index.ts.html +130 -0
  58. package/coverage/lcov-report/builtins/interpolation/index.html +131 -0
  59. package/coverage/lcov-report/builtins/interpolation/index.ts.html +670 -0
  60. package/coverage/lcov-report/builtins/interpolation/types.ts.html +100 -0
  61. package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +181 -0
  62. package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +131 -0
  63. package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +295 -0
  64. package/coverage/lcov-report/builtins/mock-observations/index.html +116 -0
  65. package/coverage/lcov-report/builtins/mock-observations/index.ts.html +613 -0
  66. package/coverage/lcov-report/builtins/multiply/index.html +116 -0
  67. package/coverage/lcov-report/builtins/multiply/index.ts.html +337 -0
  68. package/coverage/lcov-report/builtins/regex/index.html +116 -0
  69. package/coverage/lcov-report/builtins/regex/index.ts.html +379 -0
  70. package/coverage/lcov-report/builtins/sci/config.ts.html +205 -0
  71. package/coverage/lcov-report/builtins/sci/index.html +116 -0
  72. package/coverage/lcov-report/builtins/sci/index.ts.html +331 -0
  73. package/coverage/lcov-report/builtins/sci-embodied/index.html +116 -0
  74. package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +481 -0
  75. package/coverage/lcov-report/builtins/shell/index.html +116 -0
  76. package/coverage/lcov-report/builtins/shell/index.ts.html +283 -0
  77. package/coverage/lcov-report/builtins/subtract/index.html +116 -0
  78. package/coverage/lcov-report/builtins/subtract/index.ts.html +373 -0
  79. package/coverage/lcov-report/builtins/sum/index.html +116 -0
  80. package/coverage/lcov-report/builtins/sum/index.ts.html +340 -0
  81. package/coverage/lcov-report/builtins/time-sync.ts.html +1459 -0
  82. package/coverage/lcov-report/config/config.ts.html +334 -0
  83. package/coverage/lcov-report/config/index.html +161 -0
  84. package/coverage/lcov-report/config/index.ts.html +94 -0
  85. package/coverage/lcov-report/config/params.ts.html +697 -0
  86. package/coverage/lcov-report/config/strings.ts.html +415 -0
  87. package/coverage/lcov-report/favicon.png +0 -0
  88. package/coverage/lcov-report/index.html +386 -0
  89. package/coverage/lcov-report/lib/aggregate.ts.html +331 -0
  90. package/coverage/lcov-report/lib/compare.ts.html +283 -0
  91. package/coverage/lcov-report/lib/compute.ts.html +391 -0
  92. package/coverage/lcov-report/lib/environment.ts.html +343 -0
  93. package/coverage/lcov-report/lib/exhaust.ts.html +283 -0
  94. package/coverage/lcov-report/lib/index.html +221 -0
  95. package/coverage/lcov-report/lib/initialize.ts.html +388 -0
  96. package/coverage/lcov-report/lib/load.ts.html +268 -0
  97. package/coverage/lcov-report/lib/parameterize.ts.html +283 -0
  98. package/coverage/lcov-report/prettify.css +1 -0
  99. package/coverage/lcov-report/prettify.js +2 -0
  100. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  101. package/coverage/lcov-report/sorter.js +196 -0
  102. package/coverage/lcov-report/types/aggregation.ts.html +94 -0
  103. package/coverage/lcov-report/types/index.html +146 -0
  104. package/coverage/lcov-report/types/interface.ts.html +181 -0
  105. package/coverage/lcov-report/types/parameters.ts.html +106 -0
  106. package/coverage/lcov-report/util/aggregation-helper.ts.html +286 -0
  107. package/coverage/lcov-report/util/args.ts.html +508 -0
  108. package/coverage/lcov-report/util/errors.ts.html +232 -0
  109. package/coverage/lcov-report/util/helpers.ts.html +613 -0
  110. package/coverage/lcov-report/util/index.html +266 -0
  111. package/coverage/lcov-report/util/json.ts.html +115 -0
  112. package/coverage/lcov-report/util/log-memoize.ts.html +145 -0
  113. package/coverage/lcov-report/util/logger.ts.html +151 -0
  114. package/coverage/lcov-report/util/os-checker.ts.html +421 -0
  115. package/coverage/lcov-report/util/plugin-storage.ts.html +199 -0
  116. package/coverage/lcov-report/util/validations.ts.html +526 -0
  117. package/coverage/lcov-report/util/yaml.ts.html +193 -0
  118. package/coverage/lcov.info +2811 -0
  119. package/github-processes.md +10 -0
  120. package/{examples/manifests/pipeline-demo-2.yml → manifests/bugs/aggregation-error-wrong-metric.yml} +8 -34
  121. package/manifests/bugs/azure-importer-ignoring-defaults.yml +61 -0
  122. package/manifests/bugs/azure-importer-incorrect-calculation.yml +56 -0
  123. package/manifests/bugs/initialize-error-no-config.yml +27 -0
  124. package/manifests/bugs/initialize-error-no-path.yml +28 -0
  125. package/manifests/bugs/initialize-error-no-plugins.yml +23 -0
  126. package/manifests/bugs/input-error-missing-duration.yml +21 -0
  127. package/manifests/bugs/pipeline-error-naming-mismatch.yml +28 -0
  128. package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +29 -0
  129. package/{examples/manifests/boavizta-pipeline.yml → manifests/bugs/pipeline-ordering-error.yml} +7 -10
  130. package/{examples/manifests → manifests/examples}/basic.yml +3 -2
  131. package/{examples/manifests → manifests/examples}/generics.yml +2 -2
  132. package/{examples/manifests/asim-demo.yml → manifests/examples/mock-cpu-util-to-carbon.yml} +3 -7
  133. package/{examples/manifests → manifests/examples}/nesting.yml +3 -2
  134. package/{examples/manifests → manifests/examples}/pipeline-teads-sci.yml +1 -1
  135. package/{examples/manifests/pipeline-demo.yml → manifests/examples/pipeline-with-aggregate.yml} +2 -2
  136. package/{examples/manifests → manifests/examples}/pipeline-with-mocks.yml +3 -2
  137. package/manifests/features/aggregate-horizontal.yml +44 -0
  138. package/manifests/features/aggregate-vertical.yml +44 -0
  139. package/manifests/features/aggregate.yml +44 -0
  140. package/manifests/integrations/mock-obs-groupby.yml +39 -0
  141. package/manifests/integrations/mock-obs-time-sync.yml +65 -0
  142. package/manifests/plugins/cloud-metadata/failure-invalid-vendor.yaml +21 -0
  143. package/{examples/manifests/cloud-metadata.yml → manifests/plugins/cloud-metadata/success.yml} +2 -1
  144. package/manifests/plugins/coefficient/failure-invalid-config-input-param.yml +24 -0
  145. package/{examples/manifests/coefficient.yml → manifests/plugins/coefficient/success.yml} +2 -1
  146. package/manifests/plugins/divide/failure-invalid-config-denominator.yml +39 -0
  147. package/manifests/plugins/divide/success.yml +39 -0
  148. package/manifests/plugins/groupby/failure-invalid-config-group.yml +47 -0
  149. package/{examples/manifests/group-by.yml → manifests/plugins/groupby/success.yml} +3 -2
  150. package/manifests/plugins/mock-observations/failure-invalid-config-cpu-range.yml +34 -0
  151. package/{examples/manifests/mock-observation.yml → manifests/plugins/mock-observations/success.yml} +2 -1
  152. package/manifests/plugins/multiply/failure-input-parameter-is-missing.yml +24 -0
  153. package/{examples/manifests/multiply.yml → manifests/plugins/multiply/success.yml} +3 -2
  154. package/manifests/plugins/regex/failure-missing-input-param.yml +24 -0
  155. package/{examples/manifests/regex.yml → manifests/plugins/regex/success.yml} +3 -2
  156. package/manifests/plugins/sci/failure-invalid-config-value.yml +28 -0
  157. package/{examples/manifests/sci.yml → manifests/plugins/sci/success.yml} +3 -2
  158. package/manifests/plugins/sci-m/failure-invalid-default-emission-value.yml +24 -0
  159. package/{examples/manifests/sci-m.yml → manifests/plugins/sci-m/success.yml} +2 -1
  160. package/manifests/plugins/shell/failure-invalid-command.yml +21 -0
  161. package/{examples/manifests/shell.yml → manifests/plugins/shell/success.yml} +3 -2
  162. package/manifests/plugins/sum/failure-missing-input-param.yml +24 -0
  163. package/{examples/manifests/sum.yml → manifests/plugins/sum/success.yml} +3 -2
  164. package/manifests/plugins/tdp-finder/failure-missing-input-param.yml +18 -0
  165. package/{examples/manifests/tdp-finder.yml → manifests/plugins/tdp-finder/success.yml} +2 -1
  166. package/manifests/plugins/time-sync/failure-config-start-later-end.yml +34 -0
  167. package/{examples/manifests/time-sync.yml → manifests/plugins/time-sync/success.yml} +4 -2
  168. package/package.json +4 -2
  169. package/src/__tests__/integration/manifest/sci-e.yaml +23 -0
  170. package/examples/manifests/azure-importer.yml +0 -24
  171. package/examples/manifests/basic-demo.yml +0 -70
  172. package/examples/manifests/boavizta-cloud.yml +0 -20
  173. package/examples/manifests/boavizta.yml +0 -26
  174. package/examples/manifests/ccf.yml +0 -20
  175. package/examples/manifests/cloud-metadata-teads.yml +0 -41
  176. package/examples/manifests/co2js.yml +0 -30
  177. package/examples/manifests/csv-export.yml +0 -34
  178. package/examples/manifests/e-mem.yml +0 -21
  179. package/examples/manifests/e-net.yml +0 -22
  180. package/examples/manifests/nesting-demo.yml +0 -89
  181. package/examples/manifests/pipeline-demo-1.yml +0 -85
  182. package/examples/manifests/pipeline-with-generics.yml +0 -152
  183. package/examples/manifests/sci-e.yml +0 -19
  184. package/examples/manifests/sci-o.yml +0 -26
  185. package/examples/manifests/teads-curve.yml +0 -20
  186. package/examples/manifests/watt-time.yml +0 -35
  187. /package/{examples/manifests/divide.yml → manifests/integrations/cloud-metadata-divide-boavizta.yml} +0 -0
@@ -0,0 +1,39 @@
1
+ name: Mock observations + Group by
2
+ description: Integration of `mock observations` + `groupby plugins`
3
+ initialize:
4
+ plugins:
5
+ mock-observations:
6
+ path: '@grnsft/if-plugins'
7
+ method: MockObservations
8
+ global-config:
9
+ timestamp-from: '2024-03-05T00:00:00.000Z'
10
+ timestamp-to: '2024-03-05T00:01:00.000Z'
11
+ duration: 10
12
+ components:
13
+ - name: server-1
14
+ cloud/instance-type: Standard_E64_v3
15
+ cloud/region: westus3
16
+ - name: server-2
17
+ cloud/instance-type: Standard_E64_v3
18
+ cloud/region: france
19
+ generators:
20
+ common:
21
+ cloud/vendor: azure
22
+ randint:
23
+ cpu/utilization:
24
+ min: 1
25
+ max: 99
26
+ group-by:
27
+ path: 'builtin'
28
+ method: GroupBy
29
+ tree:
30
+ pipeline:
31
+ - mock-observations
32
+ - group-by
33
+ defaults:
34
+ config:
35
+ group-by:
36
+ group:
37
+ - cloud/region
38
+ - name
39
+ inputs: null
@@ -0,0 +1,65 @@
1
+ name: Mock observation and time sync integration
2
+ description: Integration of `mock observation` + `time sync`
3
+ tags:
4
+ initialize:
5
+ plugins:
6
+ mock-observations:
7
+ kind: plugin
8
+ method: MockObservations
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ timestamp-from: 2023-07-06T00:00
12
+ timestamp-to: 2023-07-06T00:10
13
+ duration: 60
14
+ components:
15
+ - cloud/instance-type: A1
16
+ generators:
17
+ common:
18
+ cloud/region: uk-west
19
+ common-key: common-val
20
+ randint:
21
+ cpu/utilization:
22
+ min: 1
23
+ max: 99
24
+ "teads-curve":
25
+ path: "@grnsft/if-unofficial-plugins"
26
+ method: TeadsCurve
27
+ global-config:
28
+ interpolation: spline
29
+ "time-sync":
30
+ method: TimeSync
31
+ path: "builtin"
32
+ global-config:
33
+ start-time: "2023-12-12T00:00:00.000Z"
34
+ end-time: "2023-12-12T00:01:00.000Z"
35
+ interval: 5
36
+ allow-padding: true
37
+ tree:
38
+ children:
39
+ child-1:
40
+ pipeline:
41
+ - teads-curve
42
+ - time-sync
43
+ defaults:
44
+ cpu/thermal-design-power: 100
45
+ inputs:
46
+ - timestamp: "2023-12-12T00:00:00.000Z"
47
+ cloud/instance-type: A1
48
+ cloud/region: uk-west
49
+ duration: 1
50
+ cpu/utilization: 10
51
+ - timestamp: "2023-12-12T00:00:01.000Z"
52
+ duration: 5
53
+ cpu/utilization: 20
54
+ cloud/instance-type: A1
55
+ cloud/region: uk-west
56
+ - timestamp: "2023-12-12T00:00:06.000Z"
57
+ duration: 7
58
+ cpu/utilization: 15
59
+ cloud/instance-type: A1
60
+ cloud/region: uk-west
61
+ - timestamp: "2023-12-12T00:00:13.000Z"
62
+ duration: 30
63
+ cloud/instance-type: A1
64
+ cloud/region: uk-west
65
+ cpu/utilization: 15
@@ -0,0 +1,21 @@
1
+ name: cloud-metadata
2
+ description: failure with invalid `inputs.cloud/vendor`
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ tree:
11
+ children:
12
+ child:
13
+ pipeline:
14
+ - cloud-metadata
15
+ config:
16
+ inputs:
17
+ - timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
18
+ cloud/vendor: gcp
19
+ cloud/instance-type: m5n.large
20
+ duration: 100
21
+ cpu/utilization: 10
@@ -1,7 +1,8 @@
1
1
  name: cloud-metadata
2
- description: example impl invoking Cloud Metadata plugin
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  cloud-metadata:
7
8
  method: CloudMetadata
@@ -0,0 +1,24 @@
1
+ name: coefficient-demo
2
+ description: failure with ivalid `global-config.input-parameter`
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ coefficient:
8
+ method: Coefficient
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ input-parameter: 4
12
+ coefficient: 3
13
+ output-parameter: "carbon-product"
14
+ tree:
15
+ children:
16
+ child:
17
+ pipeline:
18
+ - coefficient
19
+ config:
20
+ sum:
21
+ inputs:
22
+ - timestamp: 2023-08-06T00:00
23
+ duration: 3600
24
+ carbon: 30
@@ -1,7 +1,8 @@
1
1
  name: coefficient-demo
2
- description:
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  coefficient:
7
8
  method: Coefficient
@@ -0,0 +1,39 @@
1
+ name: divide
2
+ description: failure when `global-config.denominator` is string
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ divide:
11
+ method: Divide
12
+ path: "@grnsft/if-plugins"
13
+ global-config:
14
+ numerator: vcpus-allocated
15
+ denominator: 'vcpus'
16
+ output: cpu/number-cores
17
+ boavizta-cpu:
18
+ method: BoaviztaCpuOutput
19
+ path: "@grnsft/if-unofficial-plugins"
20
+ global-config:
21
+ allocation: LINEAR
22
+ verbose: true
23
+ tree:
24
+ children:
25
+ child:
26
+ pipeline:
27
+ - cloud-metadata
28
+ - divide
29
+ - boavizta-cpu
30
+ config:
31
+ divide:
32
+ defaults:
33
+ cloud/vendor: aws
34
+ cloud/instance-type: m5n.large
35
+ cpu/name: Intel® Core™ i7-1185G7
36
+ inputs:
37
+ - timestamp: 2023-08-06T00:00
38
+ duration: 3600
39
+ cpu/utilization: 80
@@ -0,0 +1,39 @@
1
+ name: divide
2
+ description: success path
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ cloud-metadata:
8
+ method: CloudMetadata
9
+ path: "@grnsft/if-plugins"
10
+ divide:
11
+ method: Divide
12
+ path: "@grnsft/if-plugins"
13
+ global-config:
14
+ numerator: vcpus-allocated
15
+ denominator: 2
16
+ output: cpu/number-cores
17
+ boavizta-cpu:
18
+ method: BoaviztaCpuOutput
19
+ path: "@grnsft/if-unofficial-plugins"
20
+ global-config:
21
+ allocation: LINEAR
22
+ verbose: true
23
+ tree:
24
+ children:
25
+ child:
26
+ pipeline:
27
+ - cloud-metadata
28
+ - divide
29
+ - boavizta-cpu
30
+ config:
31
+ divide:
32
+ defaults:
33
+ cloud/vendor: aws
34
+ cloud/instance-type: m5n.large
35
+ cpu/name: Intel® Core™ i7-1185G7
36
+ inputs:
37
+ - timestamp: 2023-08-06T00:00
38
+ duration: 3600
39
+ cpu/utilization: 80
@@ -0,0 +1,47 @@
1
+ name: groupby
2
+ description: failure when `config->group-by->group` is not an array
3
+ initialize:
4
+ outputs: ['yaml']
5
+ plugins:
6
+ group-by:
7
+ path: "builtin"
8
+ method: GroupBy
9
+ tree:
10
+ children:
11
+ my-app:
12
+ pipeline:
13
+ - group-by
14
+ config:
15
+ group-by:
16
+ group: cloud/region
17
+ inputs:
18
+ - timestamp: 2023-07-06T00:00
19
+ duration: 300
20
+ cloud/instance-type: A1
21
+ cloud/region: uk-west
22
+ cpu/utilization: 99
23
+ - timestamp: 2023-07-06T05:00
24
+ duration: 300
25
+ cloud/instance-type: A1
26
+ cloud/region: uk-west
27
+ cpu/utilization: 23
28
+ - timestamp: 2023-07-06T10:00
29
+ duration: 300
30
+ cloud/instance-type: A1
31
+ cloud/region: uk-west
32
+ cpu/utilization: 12
33
+ - timestamp: 2023-07-06T00:00 # note this time restarts at the start timstamp
34
+ duration: 300
35
+ cloud/instance-type: B1
36
+ cloud/region: uk-west
37
+ cpu/utilization: 11
38
+ - timestamp: 2023-07-06T05:00
39
+ duration: 300
40
+ cloud/instance-type: B1
41
+ cloud/region: uk-west
42
+ cpu/utilization: 67
43
+ - timestamp: 2023-07-06T10:00
44
+ duration: 300
45
+ cloud/instance-type: B1
46
+ cloud/region: uk-west
47
+ cpu/utilization: 1
@@ -1,6 +1,7 @@
1
- name: groupby-demo
2
- description: demo pipeline
1
+ name: groupby
2
+ description: successful path
3
3
  initialize:
4
+ outputs: ['yaml']
4
5
  plugins:
5
6
  group-by:
6
7
  path: "builtin"
@@ -0,0 +1,34 @@
1
+ name: mock-observation-demo
2
+ description: failure with `global-config->generators->randint->cpu/utilization->min` is greater than `max`
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ mock-observations:
8
+ kind: plugin
9
+ method: MockObservations
10
+ path: "@grnsft/if-plugins"
11
+ global-config:
12
+ timestamp-from: 2023-07-06T00:00
13
+ timestamp-to: 2023-07-06T00:10
14
+ duration: 60
15
+ components:
16
+ - cloud/instance-type: A1
17
+ - cloud/instance-type: B1
18
+ generators:
19
+ common:
20
+ region: uk-west
21
+ common-key: common-val
22
+ randint:
23
+ cpu/utilization:
24
+ min: 99
25
+ max: 10
26
+ memory/utilization:
27
+ min: 1
28
+ max: 99
29
+ tree:
30
+ children:
31
+ child:
32
+ pipeline:
33
+ - mock-observations
34
+ inputs:
@@ -1,7 +1,8 @@
1
1
  name: mock-observation-demo
2
- description: example invoking mock-observation plugin
2
+ description: a manifest demonstrating how to use the mock observations feature
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  mock-observations:
7
8
  kind: plugin
@@ -0,0 +1,24 @@
1
+ name: multiply
2
+ description: failure `inputs` is missing `cpu/energy` parameter
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ multiply:
8
+ method: Multiply
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ input-parameters: ["cpu/energy", "network/energy"]
12
+ output-parameter: "energy-product"
13
+ tree:
14
+ children:
15
+ child:
16
+ pipeline:
17
+ - multiply
18
+ config:
19
+ sum:
20
+ inputs:
21
+ - timestamp: 2023-08-06T00:00
22
+ duration: 3600
23
+ cpu: 0.001
24
+ network/energy: 0.002
@@ -1,7 +1,8 @@
1
- name: multiply-demo
2
- description:
1
+ name: multiply
2
+ description: a manifest demonstrating how to use the multiply feature
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  multiply:
7
8
  method: Multiply
@@ -0,0 +1,24 @@
1
+ name: regex
2
+ description: failure with missing `physical-processor` field from `inputs`
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ regex:
8
+ method: Regex
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ parameter: physical-processor
12
+ match: ^(.*),
13
+ output: cpu/name
14
+ tree:
15
+ children:
16
+ child:
17
+ pipeline:
18
+ - regex
19
+ config:
20
+ regex:
21
+ inputs:
22
+ - timestamp: 2023-08-06T00:00
23
+ duration: 3600
24
+ physical: Intel® Xeon® Platinum 8272CL,Intel® Xeon® 8171M 2.1 GHz,Intel® Xeon® E5-2673 v4 2.3 GHz,Intel® Xeon® E5-2673 v3 2.4 GHz
@@ -1,7 +1,8 @@
1
- name: regex-demo
2
- description:
1
+ name: regex
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  regex:
7
8
  method: Regex
@@ -0,0 +1,28 @@
1
+ name: sci
2
+ description: failure with `config.sci.functional-unit` value being number
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ sci:
8
+ kind: plugin
9
+ method: Sci
10
+ path: "@grnsft/if-plugins"
11
+ # global-config:
12
+ # functional-unit-time: 1 minute
13
+ tree:
14
+ children:
15
+ child:
16
+ pipeline:
17
+ - sci
18
+ config:
19
+ sci:
20
+ functional-unit-time: 1 sec
21
+ functional-unit: 999 # factor to convert per time to per f.unit
22
+ inputs:
23
+ - timestamp: 2023-07-06T00:00
24
+ duration: 3600
25
+ energy: 5
26
+ carbon-operational: 5
27
+ carbon-embodied: 0.02
28
+ requests: 100
@@ -1,7 +1,8 @@
1
- name: sci-demo
2
- description: example invoking sci model
1
+ name: sci
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  sci:
7
8
  kind: plugin
@@ -0,0 +1,24 @@
1
+ name: sci-m
2
+ description: failure with `defaults.device/emissions-embodied` being string instead of number
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ "sci-m": # a model that calculates m from te, tir, el, rr and rtor
8
+ method: SciM
9
+ verbose: false
10
+ path: "@grnsft/if-plugins"
11
+ tree:
12
+ children:
13
+ child:
14
+ pipeline:
15
+ - sci-m # duration & config -> embodied
16
+ defaults:
17
+ device/emissions-embodied: 'fail' # gCO2eq
18
+ time-reserved: 3600 # 1hr in seconds
19
+ device/expected-lifespan: 94608000 # 3 years in seconds
20
+ resources-reserved: 1
21
+ resources-total: 8
22
+ inputs:
23
+ - timestamp: 2023-07-06T00:00
24
+ duration: 3600
@@ -1,7 +1,8 @@
1
1
  name: sci-m
2
- description: simple demo invoking sci-m
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  "sci-m": # a model that calculates m from te, tir, el, rr and rtor
7
8
  method: SciM
@@ -0,0 +1,21 @@
1
+ name: shell
2
+ description: falure with `global-config.command` being number instead od string
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ shell:
8
+ method: Shell
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ command: 1000
12
+ tree:
13
+ children:
14
+ child:
15
+ pipeline:
16
+ - shell
17
+ inputs:
18
+ - timestamp: "2023-11-02T10:35:31.820Z"
19
+ duration: 3600
20
+ cpu/energy: 0.002
21
+ memory/energy: 0.000005
@@ -1,7 +1,8 @@
1
- name: shell-demo
2
- description: example impl invoking shell model
1
+ name: shell
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  shell:
7
8
  method: Shell
@@ -0,0 +1,24 @@
1
+ name: sum
2
+ description: failure with `inputs[0]` misses one of `global-config.input-parameters`
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ sum:
8
+ method: Sum
9
+ path: "@grnsft/if-plugins"
10
+ global-config:
11
+ input-parameters: ["cpu/energy", "network/energy"]
12
+ output-parameter: "energy"
13
+ tree:
14
+ children:
15
+ child:
16
+ pipeline:
17
+ - sum
18
+ config:
19
+ sum:
20
+ inputs:
21
+ - timestamp: 2023-08-06T00:00
22
+ duration: 3600
23
+ cpu: 0.001
24
+ network/energy: 0.001
@@ -1,7 +1,8 @@
1
- name: sci-e-demo
2
- description:
1
+ name: sum
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  sum:
7
8
  method: Sum
@@ -0,0 +1,18 @@
1
+ name: tdp-finder
2
+ description: failure with `inputs` missing `physical-processor` param
3
+ tags:
4
+ initialize:
5
+ outputs: ['yaml']
6
+ plugins:
7
+ tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
8
+ method: TdpFinder
9
+ path: "@grnsft/if-plugins"
10
+ tree:
11
+ children:
12
+ child:
13
+ pipeline:
14
+ - tdp-finder
15
+ config:
16
+ inputs:
17
+ - timestamp: 2023-07-06T00:00
18
+ duration: 300
@@ -1,7 +1,8 @@
1
1
  name: tdp-finder
2
- description: demo
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ outputs: ['yaml']
5
6
  plugins:
6
7
  tdp-finder: # a model that returns an embodied value given the sci embodied attribution equation.
7
8
  method: TdpFinder
@@ -0,0 +1,34 @@
1
+ name: time-sync
2
+ description: failure with `global-config.start-time` being later than `global-config.end-time`
3
+ tags:
4
+ initialize:
5
+ output:
6
+ - yaml
7
+ plugins:
8
+ 'time-sync':
9
+ method: TimeSync
10
+ path: "builtin"
11
+ global-config:
12
+ start-time: '2023-12-12T00:01:00.000Z'
13
+ end-time: '2023-12-12T00:00:00.000Z'
14
+ interval: 5
15
+ allow-padding: true
16
+ tree:
17
+ children:
18
+ child:
19
+ pipeline:
20
+ - time-sync
21
+ config:
22
+ inputs:
23
+ - timestamp: '2023-12-12T00:00:00.000Z'
24
+ duration: 1
25
+ energy-cpu: 0.001
26
+ - timestamp: '2023-12-12T00:00:01.000Z'
27
+ duration: 5
28
+ energy-cpu: 0.001
29
+ - timestamp: '2023-12-12T00:00:06.000Z'
30
+ duration: 7
31
+ energy-cpu: 0.001
32
+ - timestamp: '2023-12-12T00:00:13.000Z'
33
+ duration: 30
34
+ energy-cpu: 0.001
@@ -1,7 +1,9 @@
1
- name: time-sync-demo
2
- description:
1
+ name: time-sync
2
+ description: successful path
3
3
  tags:
4
4
  initialize:
5
+ output:
6
+ - yaml
5
7
  plugins:
6
8
  'time-sync':
7
9
  method: TimeSync