@grnsft/if 0.3.1 → 0.3.3-beta.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 (115) hide show
  1. package/.commitlintrc.js +3 -0
  2. package/.release-it.json +18 -0
  3. package/CONTRIBUTING.md +82 -1
  4. package/README.md +34 -23
  5. package/build/builtins/export-csv-raw.js +5 -5
  6. package/build/builtins/export-csv.js +17 -7
  7. package/build/builtins/export-log.js +26 -2
  8. package/build/builtins/export-yaml.js +3 -3
  9. package/build/builtins/group-by.js +20 -5
  10. package/build/builtins/time-sync.js +2 -1
  11. package/build/config/config.d.ts +3 -3
  12. package/build/config/config.js +23 -27
  13. package/build/config/strings.d.ts +1 -0
  14. package/build/config/strings.js +9 -5
  15. package/build/index.js +24 -15
  16. package/build/lib/compute.js +8 -8
  17. package/build/lib/environment.d.ts +5 -0
  18. package/build/lib/environment.js +69 -0
  19. package/build/lib/exhaust.d.ts +2 -1
  20. package/build/lib/exhaust.js +11 -9
  21. package/build/lib/initialize.d.ts +2 -2
  22. package/build/lib/initialize.js +5 -5
  23. package/build/lib/load.d.ts +1 -29
  24. package/build/lib/load.js +6 -7
  25. package/build/lib/parameterize.d.ts +2 -1
  26. package/build/lib/parameterize.js +4 -4
  27. package/build/types/compute.d.ts +2 -2
  28. package/build/types/compute.js +1 -1
  29. package/build/types/environment.d.ts +18 -0
  30. package/build/types/environment.js +3 -0
  31. package/build/types/manifest.d.ts +1 -0
  32. package/build/types/manifest.js +1 -1
  33. package/build/types/process-args.d.ts +13 -1
  34. package/build/types/process-args.js +1 -1
  35. package/build/util/aggregation-helper.js +4 -4
  36. package/build/util/args.d.ts +3 -5
  37. package/build/util/args.js +14 -10
  38. package/build/util/errors.d.ts +1 -1
  39. package/build/util/errors.js +4 -5
  40. package/build/util/helpers.d.ts +8 -2
  41. package/build/util/helpers.js +19 -15
  42. package/build/util/os-checker.d.ts +7 -0
  43. package/build/util/os-checker.js +97 -0
  44. package/build/util/validations.d.ts +90 -4
  45. package/build/util/validations.js +14 -2
  46. package/github-processes.md +168 -0
  47. package/{examples/manifests/pipeline-demo-2.yml → manifests/bugs/aggregation-error-wrong-metric.yml} +18 -39
  48. package/manifests/bugs/azure-importer-ignoring-defaults.yml +61 -0
  49. package/manifests/bugs/azure-importer-incorrect-calculation.yml +56 -0
  50. package/manifests/bugs/initialize-error-no-config.yml +27 -0
  51. package/manifests/bugs/initialize-error-no-path.yml +28 -0
  52. package/manifests/bugs/initialize-error-no-plugins.yml +23 -0
  53. package/manifests/bugs/input-error-missing-duration.yml +21 -0
  54. package/manifests/bugs/pipeline-error-naming-mismatch.yml +28 -0
  55. package/manifests/bugs/pipeline-error-uninitialized-plugin.yml +29 -0
  56. package/{examples/manifests/pipeline-teads-sci.yml → manifests/bugs/pipeline-ordering-error.yml} +15 -15
  57. package/{examples/manifests → manifests/examples}/basic.yml +3 -2
  58. package/{examples/manifests → manifests/examples}/generics.yml +16 -16
  59. package/{examples/manifests/asim-demo.yml → manifests/examples/mock-cpu-util-to-carbon.yml} +3 -7
  60. package/{examples/manifests → manifests/examples}/nesting.yml +19 -18
  61. package/{examples/manifests/pipeline-demo-1.yml → manifests/examples/pipeline-teads-sci.yml} +10 -13
  62. package/{examples/manifests/pipeline-demo.yml → manifests/examples/pipeline-with-aggregate.yml} +12 -12
  63. package/{examples/manifests → manifests/examples}/pipeline-with-mocks.yml +26 -25
  64. package/manifests/features/aggregate-horizontal.yml +44 -0
  65. package/manifests/features/aggregate-vertical.yml +44 -0
  66. package/manifests/features/aggregate.yml +44 -0
  67. package/manifests/integrations/mock-obs-groupby.yml +39 -0
  68. package/manifests/integrations/mock-obs-time-sync.yml +65 -0
  69. package/manifests/plugins/cloud-metadata/failure-invalid-vendor.yaml +21 -0
  70. package/{examples/manifests/cim.yml → manifests/plugins/cloud-metadata/success.yml} +3 -2
  71. package/manifests/plugins/coefficient/failure-invalid-config-input-param.yml +24 -0
  72. package/{examples/manifests/coefficient.yml → manifests/plugins/coefficient/success.yml} +2 -1
  73. package/manifests/plugins/divide/failure-invalid-config-denominator.yml +39 -0
  74. package/manifests/plugins/divide/success.yml +39 -0
  75. package/manifests/plugins/groupby/failure-invalid-config-group.yml +47 -0
  76. package/{examples/manifests/group-by.yml → manifests/plugins/groupby/success.yml} +24 -23
  77. package/manifests/plugins/mock-observations/failure-invalid-config-cpu-range.yml +34 -0
  78. package/{examples/manifests/mock-observation.yml → manifests/plugins/mock-observations/success.yml} +2 -1
  79. package/manifests/plugins/multiply/failure-input-parameter-is-missing.yml +24 -0
  80. package/{examples/manifests/multiply.yml → manifests/plugins/multiply/success.yml} +3 -2
  81. package/manifests/plugins/regex/failure-missing-input-param.yml +24 -0
  82. package/{examples/manifests/regex.yml → manifests/plugins/regex/success.yml} +3 -2
  83. package/manifests/plugins/sci/failure-invalid-config-value.yml +28 -0
  84. package/{examples/manifests/sci.yml → manifests/plugins/sci/success.yml} +3 -2
  85. package/manifests/plugins/sci-m/failure-invalid-default-emission-value.yml +24 -0
  86. package/{examples/manifests/sci-m.yml → manifests/plugins/sci-m/success.yml} +2 -1
  87. package/manifests/plugins/shell/failure-invalid-command.yml +21 -0
  88. package/{examples/manifests/shell.yml → manifests/plugins/shell/success.yml} +3 -2
  89. package/manifests/plugins/sum/failure-missing-input-param.yml +24 -0
  90. package/{examples/manifests/sum.yml → manifests/plugins/sum/success.yml} +3 -2
  91. package/manifests/plugins/tdp-finder/failure-missing-input-param.yml +18 -0
  92. package/{examples/manifests/tdp-finder.yml → manifests/plugins/tdp-finder/success.yml} +2 -1
  93. package/manifests/plugins/time-sync/failure-config-start-later-end.yml +34 -0
  94. package/{examples/manifests/time-sync.yml → manifests/plugins/time-sync/success.yml} +4 -2
  95. package/package.json +4 -2
  96. package/src/builtins/README.md +40 -44
  97. package/examples/manifests/azure-importer.yml +0 -24
  98. package/examples/manifests/basic-demo.yml +0 -70
  99. package/examples/manifests/boavizta-cloud.yml +0 -20
  100. package/examples/manifests/boavizta-pipeline.yml +0 -85
  101. package/examples/manifests/boavizta.yml +0 -26
  102. package/examples/manifests/ccf.yml +0 -20
  103. package/examples/manifests/cloud-metadata.yml +0 -41
  104. package/examples/manifests/co2js.yml +0 -30
  105. package/examples/manifests/csv-export.yml +0 -34
  106. package/examples/manifests/e-mem.yml +0 -21
  107. package/examples/manifests/e-net.yml +0 -22
  108. package/examples/manifests/nesting-demo.yml +0 -89
  109. package/examples/manifests/pipeline-with-generics.yml +0 -147
  110. package/examples/manifests/sci-e.yml +0 -19
  111. package/examples/manifests/sci-o.yml +0 -26
  112. package/examples/manifests/teads-aws.yml +0 -22
  113. package/examples/manifests/teads-curve.yml +0 -20
  114. package/examples/manifests/watt-time.yml +0 -42
  115. /package/{examples/manifests/divide.yml → manifests/integrations/cloud-metadata-divide-boavizta.yml} +0 -0
@@ -1,89 +0,0 @@
1
- name: nesting-demo
2
- description: null
3
- tags:
4
- kind: web
5
- complexity: moderate
6
- category: on-premise
7
- params:
8
- aggregation:
9
- type: vertical
10
- metrics:
11
- - "energy"
12
- initialize:
13
- plugins:
14
- teads-curve:
15
- path: "@grnsft/if-unofficial-plugins"
16
- method: TeadsCurve
17
- global-config:
18
- interpolation: spline
19
- sci-e:
20
- path: "@grnsft/if-plugins"
21
- method: SciE
22
- sci-m:
23
- path: "@grnsft/if-plugins"
24
- method: SciM
25
- sci-o:
26
- path: "@grnsft/if-plugins"
27
- method: SciO
28
- "time-sync":
29
- method: TimeSync
30
- path: "builtin"
31
- global-config:
32
- start-time: "2023-12-12T00:00:00.000Z"
33
- end-time: "2023-12-12T00:01:00.000Z"
34
- interval: 5
35
- allow-padding: true
36
- sci:
37
- path: "@grnsft/if-plugins"
38
- method: Sci
39
- global-config:
40
- functional-unit: "requests"
41
- functional-unit-time: "1 minute"
42
- tree:
43
- children:
44
- child-0:
45
- defaults:
46
- cpu/thermal-design-power: 100
47
- grid/carbon-intensity: 800
48
- device/emissions-embodied: 1533.120 # gCO2eq
49
- time-reserved: 3600 # 1hr in seconds
50
- device/expected-lifespan: 94608000 # 3 years in seconds
51
- resources-reserved: 1
52
- resources-total: 8
53
- functional-unit-time: "1 min"
54
- pipeline:
55
- - teads-curve
56
- - sci-e
57
- - sci-m
58
- - sci-o
59
- - time-sync
60
- - sci
61
- inputs:
62
- - timestamp: "2023-12-12T00:00:00.000Z"
63
- duration: 10
64
- cpu/utilization: 50
65
- network/energy: 1
66
- energy: 1
67
- child-1:
68
- defaults:
69
- cpu/thermal-design-power: 100
70
- grid/carbon-intensity: 800
71
- device/emissions-embodied: 1533.120 # gCO2eq
72
- time-reserved: 3600 # 1hr in seconds
73
- device/expected-lifespan: 94608000 # 3 years in seconds
74
- resources-reserved: 1
75
- resources-total: 8
76
- functional-unit-time: "1 min"
77
- pipeline:
78
- - teads-curve
79
- - sci-e
80
- - sci-m
81
- - sci-o
82
- - time-sync
83
- - sci
84
- inputs:
85
- - timestamp: "2023-12-12T00:00:00.000Z"
86
- duration: 10
87
- cpu/utilization: 30
88
- network/energy: 1
89
- energy: 1
@@ -1,147 +0,0 @@
1
- name: pipeline-with-generics-demo
2
- description:
3
- tags:
4
- aggregation:
5
- metrics:
6
- - 'carbon'
7
- type: 'both'
8
- initialize:
9
- plugins:
10
- "teads-curve":
11
- path: "@grnsft/if-unofficial-plugins"
12
- method: TeadsCurve
13
- global-config:
14
- interpolation: spline
15
- "sum":
16
- path: "@grnsft/if-plugins"
17
- method: Sum
18
- global-config:
19
- input-parameters:
20
- - cpu/energy
21
- - network/energy
22
- output-parameter: energy-sum
23
- "coefficient":
24
- path: "@grnsft/if-plugins"
25
- method: Coefficient
26
- global-config:
27
- input-parameter: energy
28
- coefficient: 2
29
- output-parameter: energy-doubled
30
- "sci-m":
31
- path: "@grnsft/if-plugins"
32
- method: SciM
33
- "sci-o":
34
- path: "@grnsft/if-plugins"
35
- method: SciO
36
- "sci":
37
- path: "@grnsft/if-plugins"
38
- method: Sci
39
- global-config:
40
- functional-unit: "requests"
41
- functional-unit-time: "1 minute"
42
- "time-sync":
43
- method: TimeSync
44
- path: "builtin"
45
- global-config:
46
- start-time: "2023-12-12T00:00:00.000Z"
47
- end-time: "2023-12-12T00:01:00.000Z"
48
- interval: 5
49
- allow-padding: true
50
- tree:
51
- children:
52
- child-1:
53
- pipeline:
54
- - teads-curve
55
- - sum
56
- - sci-m
57
- - sci-o
58
- - time-sync
59
- - coefficient
60
- - sci
61
- config:
62
- defaults:
63
- cpu/thermal-design-power: 100
64
- grid/carbon-intensity: 800
65
- device/emissions-embodied: 1533.120 # gCO2eq
66
- time-reserved: 3600 # 1hr in seconds
67
- device/expected-lifespan: 94608000 # 3 years in seconds
68
- resources-reserved: 1
69
- resources-total: 8
70
- functional-unit-time: "1 min"
71
- inputs:
72
- - timestamp: "2023-12-12T00:00:00.000Z"
73
- cloud/instance-type: A1
74
- region: uk-west
75
- duration: 1
76
- cpu/utilization: 50
77
- network/energy: 10
78
- energy: 5
79
- - timestamp: "2023-12-12T00:00:01.000Z"
80
- duration: 5
81
- cpu/utilization: 20
82
- cloud/instance-type: A1
83
- region: uk-west
84
- network/energy: 10
85
- energy: 5
86
- - timestamp: "2023-12-12T00:00:06.000Z"
87
- duration: 7
88
- cpu/utilization: 15
89
- cloud/instance-type: A1
90
- region: uk-west
91
- network/energy: 10
92
- energy: 5
93
- - timestamp: "2023-12-12T00:00:13.000Z"
94
- duration: 30
95
- cloud/instance-type: A1
96
- region: uk-west
97
- cpu/utilization: 15
98
- network/energy: 10
99
- energy: 5
100
- child-2:
101
- pipeline:
102
- - teads-curve
103
- - sum
104
- - sci-m
105
- - sci-o
106
- - time-sync
107
- - coefficient
108
- - sci
109
- config:
110
- defaults:
111
- cpu/thermal-design-power: 100
112
- grid/carbon-intensity: 800
113
- device/emissions-embodied: 1533.120 # gCO2eq
114
- time-reserved: 3600 # 1hr in seconds
115
- device/expected-lifespan: 94608000 # 3 years in seconds
116
- resources-reserved: 1
117
- resources-total: 8
118
- functional-unit-time: "1 min"
119
- inputs:
120
- - timestamp: "2023-12-12T00:00:00.000Z"
121
- duration: 1
122
- cpu/utilization: 30
123
- cloud/instance-type: A1
124
- region: uk-west
125
- network/energy: 10
126
- energy: 5
127
- - timestamp: "2023-12-12T00:00:01.000Z"
128
- duration: 5
129
- cpu/utilization: 28
130
- cloud/instance-type: A1
131
- region: uk-west
132
- network/energy: 10
133
- energy: 5
134
- - timestamp: "2023-12-12T00:00:06.000Z"
135
- duration: 7
136
- cpu/utilization: 40
137
- cloud/instance-type: A1
138
- region: uk-west
139
- network/energy: 10
140
- energy: 5
141
- - timestamp: "2023-12-12T00:00:13.000Z"
142
- duration: 30
143
- cpu/utilization: 33
144
- cloud/instance-type: A1
145
- region: uk-west
146
- network/energy: 10
147
- energy: 5
@@ -1,19 +0,0 @@
1
- name: sci-e-demo
2
- description:
3
- tags:
4
- initialize:
5
- plugins:
6
- "sci-e":
7
- method: SciE
8
- path: "@grnsft/if-plugins"
9
- tree:
10
- children:
11
- child:
12
- pipeline:
13
- - sci-e
14
- config:
15
- sci-e:
16
- inputs:
17
- - timestamp: 2023-08-06T00:00
18
- duration: 3600
19
- cpu/energy: 0.001
@@ -1,26 +0,0 @@
1
- name: sci-o-demo
2
- description:
3
- tags:
4
- initialize:
5
- plugins:
6
- sci-e:
7
- kind: plugin
8
- method: SciE
9
- path: "@grnsft/if-plugins"
10
- sci-o:
11
- verbose: false
12
- method: SciO
13
- path: "@grnsft/if-plugins"
14
- tree:
15
- children:
16
- child:
17
- pipeline:
18
- - sci-e
19
- - sci-o
20
- config:
21
- sci-e:
22
- inputs:
23
- - timestamp: 2023-08-06T00:00
24
- duration: 3600
25
- cpu/energy: 0.001
26
- grid/carbon-intensity: 800
@@ -1,22 +0,0 @@
1
- name: teads-aws
2
- description: simple demo invoking TeadsAWS model
3
- tags:
4
- initialize:
5
- plugins:
6
- teads-aws:
7
- method: TeadsAWS
8
- path: "@grnsft/if-unofficial-plugins"
9
- global-config:
10
- interpolation: linear
11
- tree:
12
- children:
13
- child:
14
- pipeline:
15
- - teads-aws # duration & config -> embodied
16
- defaults:
17
- cloud/instance-type: m5n.large
18
- cpu/expected-lifespan: 252288000
19
- inputs:
20
- - timestamp: 2023-07-06T00:00
21
- duration: 3600
22
- cpu/utilization: 10
@@ -1,20 +0,0 @@
1
- name: teads-curve
2
- description: simple demo invoking teads-curve
3
- tags:
4
- initialize:
5
- plugins:
6
- teads-curve:
7
- method: TeadsCurve
8
- path: "@grnsft/if-unofficial-plugins"
9
- global-config:
10
- interpolation: spline
11
- tree:
12
- children:
13
- child:
14
- pipeline:
15
- - teads-curve
16
- inputs:
17
- - timestamp: 2023-07-06T00:00
18
- duration: 3600
19
- cpu/utilization: 50
20
- cpu/thermal-design-power: 100
@@ -1,42 +0,0 @@
1
- name: watt-time-demo
2
- description: null
3
- tags: null
4
- initialize:
5
- plugins:
6
- mock-observations:
7
- path: "@grnsft/if-plugins"
8
- method: MockObservations
9
- global-config:
10
- timestamp-from: 2024-02-26T00:00
11
- timestamp-to: 2024-02-26T00:10
12
- duration: 60
13
- components:
14
- - cloud/instance-type: Standard_A1_v2
15
- - cloud/instance-type: Standard_A2_v2
16
- generators:
17
- common:
18
- cloud/vendor: azure
19
- cloud/region: uk-west
20
- geolocation: 37.7749,-122.4194
21
- randint:
22
- cpu/utilization:
23
- min: 1
24
- max: 99
25
- watttime:
26
- path: "@grnsft/if-unofficial-plugins"
27
- method: WattTimeGridEmissions
28
- tree:
29
- children:
30
- application:
31
- pipeline:
32
- - mock-observations
33
- - watttime
34
- config:
35
- inputs:
36
- - timestamp: "2024-02-26 00:00:00"
37
- duration: 60
38
- cloud/instance-type: Standard_A1_v2
39
- cloud/vendor: azure
40
- cloud/region: uk-west
41
- geolocation: 37.7749,-122.4194
42
- cpu/utilization: 15