@grnsft/if 0.0.6 → 0.1.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.
- package/.examples/ompls/azure.yml +205 -0
- package/.github/workflows/nodejs-ci.yml +0 -8
- package/README.md +48 -9
- package/build/index.js +1 -2
- package/examples/impls/test/azure.yml +8 -8
- package/examples/impls/test/ccf.yml +5 -3
- package/examples/impls/test/if-demo.yml +19 -9
- package/examples/impls/test/metadata.yml +3 -2
- package/examples/impls/test/nesting.yml +10 -13
- package/examples/impls/test/sci-e.yml +1 -1
- package/examples/impls/test/sci-m.yml +2 -2
- package/examples/impls/test/sci-o.yml +2 -4
- package/examples/impls/test/sci.yml +1 -2
- package/examples/impls/test/shell.yml +2 -1
- package/examples/impls/{tdp-finder-test.yml → test/tdp-finder.yml} +8 -8
- package/examples/ompls/ccf.yml +3 -1
- package/examples/ompls/if-demo.yml +46 -22
- package/package.json +12 -5
- package/tsconfig.build.json +7 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/build/__mocks__/azure/index.d.ts +0 -11
- package/build/__mocks__/azure/index.js +0 -132
- package/build/__mocks__/boavizta/countries.json +0 -138
- package/build/__mocks__/boavizta/instance_types.json +0 -625
- package/build/__mocks__/boavizta/providers.json +0 -1
- package/build/__mocks__/fs/index.d.ts +0 -3
- package/build/__mocks__/fs/index.js +0 -56
- package/build/__mocks__/model-universe/index.d.ts +0 -31
- package/build/__mocks__/model-universe/index.js +0 -64
- package/build/__mocks__/watt-time/data.json +0 -119
- package/build/__tests__/integration/ompl/index.test.d.ts +0 -1
- package/build/__tests__/integration/ompl/index.test.js +0 -61
- package/build/__tests__/unit/lib/azure-importer/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/azure-importer/index.test.js +0 -152
- package/build/__tests__/unit/lib/boavizta/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/boavizta/index.test.js +0 -579
- package/build/__tests__/unit/lib/case-studies/aveva.test.d.ts +0 -1
- package/build/__tests__/unit/lib/case-studies/aveva.test.js +0 -36
- package/build/__tests__/unit/lib/case-studies/emem.test.d.ts +0 -1
- package/build/__tests__/unit/lib/case-studies/emem.test.js +0 -108
- package/build/__tests__/unit/lib/case-studies/eshoppen.test.d.ts +0 -1
- package/build/__tests__/unit/lib/case-studies/eshoppen.test.js +0 -53
- package/build/__tests__/unit/lib/case-studies/sci-accenture.test.d.ts +0 -1
- package/build/__tests__/unit/lib/case-studies/sci-accenture.test.js +0 -23
- package/build/__tests__/unit/lib/ccf/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/ccf/index.test.js +0 -223
- package/build/__tests__/unit/lib/cloud-instance-metadata/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/cloud-instance-metadata/index.test.js +0 -73
- package/build/__tests__/unit/lib/models-universe.test.d.ts +0 -1
- package/build/__tests__/unit/lib/models-universe.test.js +0 -193
- package/build/__tests__/unit/lib/observatory.test.d.ts +0 -1
- package/build/__tests__/unit/lib/observatory.test.js +0 -99
- package/build/__tests__/unit/lib/sci/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/sci/index.test.js +0 -106
- package/build/__tests__/unit/lib/sci-e/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/sci-e/index.test.js +0 -30
- package/build/__tests__/unit/lib/sci-m/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/sci-m/index.test.js +0 -58
- package/build/__tests__/unit/lib/sci-o/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/sci-o/index.test.js +0 -42
- package/build/__tests__/unit/lib/shell-imp/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/shell-imp/index.test.js +0 -21
- package/build/__tests__/unit/lib/supercomputer.test.d.ts +0 -1
- package/build/__tests__/unit/lib/supercomputer.test.js +0 -231
- package/build/__tests__/unit/lib/tdp-finder/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/tdp-finder/index.test.js +0 -62
- package/build/__tests__/unit/lib/teads-aws/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/teads-aws/index.test.js +0 -170
- package/build/__tests__/unit/lib/teads-curve/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/teads-curve/index.test.js +0 -146
- package/build/__tests__/unit/lib/watt-time/index.test.d.ts +0 -1
- package/build/__tests__/unit/lib/watt-time/index.test.js +0 -106
- package/build/__tests__/unit/util/args.test.d.ts +0 -1
- package/build/__tests__/unit/util/args.test.js +0 -92
- package/build/__tests__/unit/util/models-universe.test.d.ts +0 -1
- package/build/__tests__/unit/util/models-universe.test.js +0 -193
- package/build/__tests__/unit/util/observatory.test.d.ts +0 -1
- package/build/__tests__/unit/util/observatory.test.js +0 -99
- package/build/__tests__/unit/util/supercomputer.test.d.ts +0 -1
- package/build/__tests__/unit/util/supercomputer.test.js +0 -231
- package/build/__tests__/unit/util/yaml.test.d.ts +0 -1
- package/build/__tests__/unit/util/yaml.test.js +0 -59
- package/build/lib/azure-importer/index.d.ts +0 -55
- package/build/lib/azure-importer/index.js +0 -314
- package/build/lib/boavizta/index.d.ts +0 -53
- package/build/lib/boavizta/index.js +0 -254
- package/build/lib/case-studies/aveva-model.d.ts +0 -29
- package/build/lib/case-studies/aveva-model.js +0 -53
- package/build/lib/case-studies/emem-model.d.ts +0 -42
- package/build/lib/case-studies/emem-model.js +0 -93
- package/build/lib/case-studies/eshoppen-model.d.ts +0 -24
- package/build/lib/case-studies/eshoppen-model.js +0 -123
- package/build/lib/case-studies/index.d.ts +0 -4
- package/build/lib/case-studies/index.js +0 -21
- package/build/lib/case-studies/sci-accenture-model.d.ts +0 -10
- package/build/lib/case-studies/sci-accenture-model.js +0 -37
- package/build/lib/ccf/aws-embodied.json +0 -5591
- package/build/lib/ccf/aws-instances.json +0 -21116
- package/build/lib/ccf/aws-use.json +0 -79
- package/build/lib/ccf/azure-embodied.json +0 -6547
- package/build/lib/ccf/azure-instances.json +0 -8332
- package/build/lib/ccf/azure-use.json +0 -58
- package/build/lib/ccf/gcp-embodied.json +0 -3049
- package/build/lib/ccf/gcp-instances.json +0 -3880
- package/build/lib/ccf/gcp-use.json +0 -58
- package/build/lib/ccf/index.d.ts +0 -63
- package/build/lib/ccf/index.js +0 -338
- package/build/lib/cloud-instance-metadata/aws-instances.json +0 -1
- package/build/lib/cloud-instance-metadata/azure-instances.json +0 -1
- package/build/lib/cloud-instance-metadata/index.d.ts +0 -15
- package/build/lib/cloud-instance-metadata/index.js +0 -104
- package/build/lib/index.d.ts +0 -14
- package/build/lib/index.js +0 -32
- package/build/lib/interfaces/ccf.d.ts +0 -19
- package/build/lib/interfaces/ccf.js +0 -3
- package/build/lib/interfaces/index.d.ts +0 -7
- package/build/lib/interfaces/index.js +0 -18
- package/build/lib/sci/index.d.ts +0 -13
- package/build/lib/sci/index.js +0 -131
- package/build/lib/sci-e/index.d.ts +0 -38
- package/build/lib/sci-e/index.js +0 -85
- package/build/lib/sci-m/index.d.ts +0 -10
- package/build/lib/sci-m/index.js +0 -124
- package/build/lib/sci-o/index.d.ts +0 -17
- package/build/lib/sci-o/index.js +0 -52
- package/build/lib/shell-imp/index.d.ts +0 -32
- package/build/lib/shell-imp/index.js +0 -82
- package/build/lib/tdp-finder/index.d.ts +0 -19
- package/build/lib/tdp-finder/index.js +0 -98
- package/build/lib/teads-aws/aws-embodied.json +0 -1
- package/build/lib/teads-aws/aws-instances.json +0 -1
- package/build/lib/teads-aws/index.d.ts +0 -58
- package/build/lib/teads-aws/index.js +0 -208
- package/build/lib/teads-curve/index.d.ts +0 -52
- package/build/lib/teads-curve/index.js +0 -158
- package/build/lib/watt-time/index.d.ts +0 -18
- package/build/lib/watt-time/index.js +0 -204
- package/build/util/models-universe.d.ts +0 -28
- package/build/util/models-universe.js +0 -95
- package/build/util/observatory.d.ts +0 -20
- package/build/util/observatory.js +0 -31
- package/build/util/supercomputer.d.ts +0 -30
- package/build/util/supercomputer.js +0 -109
- package/docs/implementations/tdp-finder.md +0 -36
- package/examples/impls/test/complex-pipeline.yml +0 -67
- package/examples/impls/test/toto.yaml +0 -22
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
name: ccf-demo
|
|
2
|
+
description: example impl invoking CCF model
|
|
3
|
+
tags: null
|
|
4
|
+
initialize:
|
|
5
|
+
models:
|
|
6
|
+
- name: azure-importer
|
|
7
|
+
kind: plugin
|
|
8
|
+
path: if-models
|
|
9
|
+
model: AzureImporterModel
|
|
10
|
+
graph:
|
|
11
|
+
children:
|
|
12
|
+
child:
|
|
13
|
+
pipeline:
|
|
14
|
+
- azure-importer
|
|
15
|
+
config:
|
|
16
|
+
azure-importer: null
|
|
17
|
+
inputs:
|
|
18
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
19
|
+
duration: 3600
|
|
20
|
+
azure-observation-window: 5 min
|
|
21
|
+
azure-observation-aggregation: average
|
|
22
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
23
|
+
azure-resource-group: vm1_group
|
|
24
|
+
azure-vm-name: vm1
|
|
25
|
+
outputs:
|
|
26
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
27
|
+
cloud-vendor: azure
|
|
28
|
+
cpu-util: '0.314'
|
|
29
|
+
mem-availableGB: 0.488636416
|
|
30
|
+
mem-usedGB: 0.5113635839999999
|
|
31
|
+
total-memoryGB: '1'
|
|
32
|
+
mem-util: 51.13635839999999
|
|
33
|
+
location: uksouth
|
|
34
|
+
cloud-instance-type: Standard_B1s
|
|
35
|
+
duration: 300
|
|
36
|
+
azure-observation-window: 5 min
|
|
37
|
+
azure-observation-aggregation: average
|
|
38
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
39
|
+
azure-resource-group: vm1_group
|
|
40
|
+
azure-vm-name: vm1
|
|
41
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
42
|
+
cloud-vendor: azure
|
|
43
|
+
cpu-util: '0.314'
|
|
44
|
+
mem-availableGB: 0.48978984960000005
|
|
45
|
+
mem-usedGB: 0.5102101504
|
|
46
|
+
total-memoryGB: '1'
|
|
47
|
+
mem-util: 51.021015039999995
|
|
48
|
+
location: uksouth
|
|
49
|
+
cloud-instance-type: Standard_B1s
|
|
50
|
+
duration: 300
|
|
51
|
+
azure-observation-window: 5 min
|
|
52
|
+
azure-observation-aggregation: average
|
|
53
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
54
|
+
azure-resource-group: vm1_group
|
|
55
|
+
azure-vm-name: vm1
|
|
56
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
57
|
+
cloud-vendor: azure
|
|
58
|
+
cpu-util: '0.301'
|
|
59
|
+
mem-availableGB: 0.490733568
|
|
60
|
+
mem-usedGB: 0.509266432
|
|
61
|
+
total-memoryGB: '1'
|
|
62
|
+
mem-util: 50.9266432
|
|
63
|
+
location: uksouth
|
|
64
|
+
cloud-instance-type: Standard_B1s
|
|
65
|
+
duration: 300
|
|
66
|
+
azure-observation-window: 5 min
|
|
67
|
+
azure-observation-aggregation: average
|
|
68
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
69
|
+
azure-resource-group: vm1_group
|
|
70
|
+
azure-vm-name: vm1
|
|
71
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
72
|
+
cloud-vendor: azure
|
|
73
|
+
cpu-util: '0.298'
|
|
74
|
+
mem-availableGB: 0.490733568
|
|
75
|
+
mem-usedGB: 0.509266432
|
|
76
|
+
total-memoryGB: '1'
|
|
77
|
+
mem-util: 50.9266432
|
|
78
|
+
location: uksouth
|
|
79
|
+
cloud-instance-type: Standard_B1s
|
|
80
|
+
duration: 300
|
|
81
|
+
azure-observation-window: 5 min
|
|
82
|
+
azure-observation-aggregation: average
|
|
83
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
84
|
+
azure-resource-group: vm1_group
|
|
85
|
+
azure-vm-name: vm1
|
|
86
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
87
|
+
cloud-vendor: azure
|
|
88
|
+
cpu-util: '0.301'
|
|
89
|
+
mem-availableGB: 0.49178214400000003
|
|
90
|
+
mem-usedGB: 0.5082178559999999
|
|
91
|
+
total-memoryGB: '1'
|
|
92
|
+
mem-util: 50.82178559999999
|
|
93
|
+
location: uksouth
|
|
94
|
+
cloud-instance-type: Standard_B1s
|
|
95
|
+
duration: 300
|
|
96
|
+
azure-observation-window: 5 min
|
|
97
|
+
azure-observation-aggregation: average
|
|
98
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
99
|
+
azure-resource-group: vm1_group
|
|
100
|
+
azure-vm-name: vm1
|
|
101
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
102
|
+
cloud-vendor: azure
|
|
103
|
+
cpu-util: '0.298'
|
|
104
|
+
mem-availableGB: 0.49178214400000003
|
|
105
|
+
mem-usedGB: 0.5082178559999999
|
|
106
|
+
total-memoryGB: '1'
|
|
107
|
+
mem-util: 50.82178559999999
|
|
108
|
+
location: uksouth
|
|
109
|
+
cloud-instance-type: Standard_B1s
|
|
110
|
+
duration: 300
|
|
111
|
+
azure-observation-window: 5 min
|
|
112
|
+
azure-observation-aggregation: average
|
|
113
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
114
|
+
azure-resource-group: vm1_group
|
|
115
|
+
azure-vm-name: vm1
|
|
116
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
117
|
+
cloud-vendor: azure
|
|
118
|
+
cpu-util: '0.304'
|
|
119
|
+
mem-availableGB: 0.492306432
|
|
120
|
+
mem-usedGB: 0.507693568
|
|
121
|
+
total-memoryGB: '1'
|
|
122
|
+
mem-util: 50.7693568
|
|
123
|
+
location: uksouth
|
|
124
|
+
cloud-instance-type: Standard_B1s
|
|
125
|
+
duration: 300
|
|
126
|
+
azure-observation-window: 5 min
|
|
127
|
+
azure-observation-aggregation: average
|
|
128
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
129
|
+
azure-resource-group: vm1_group
|
|
130
|
+
azure-vm-name: vm1
|
|
131
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
132
|
+
cloud-vendor: azure
|
|
133
|
+
cpu-util: '0.3'
|
|
134
|
+
mem-availableGB: 0.49283072000000006
|
|
135
|
+
mem-usedGB: 0.50716928
|
|
136
|
+
total-memoryGB: '1'
|
|
137
|
+
mem-util: 50.716927999999996
|
|
138
|
+
location: uksouth
|
|
139
|
+
cloud-instance-type: Standard_B1s
|
|
140
|
+
duration: 300
|
|
141
|
+
azure-observation-window: 5 min
|
|
142
|
+
azure-observation-aggregation: average
|
|
143
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
144
|
+
azure-resource-group: vm1_group
|
|
145
|
+
azure-vm-name: vm1
|
|
146
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
147
|
+
cloud-vendor: azure
|
|
148
|
+
cpu-util: '0.636'
|
|
149
|
+
mem-availableGB: 0.5062524928000001
|
|
150
|
+
mem-usedGB: 0.49374750719999994
|
|
151
|
+
total-memoryGB: '1'
|
|
152
|
+
mem-util: 49.374750719999994
|
|
153
|
+
location: uksouth
|
|
154
|
+
cloud-instance-type: Standard_B1s
|
|
155
|
+
duration: 300
|
|
156
|
+
azure-observation-window: 5 min
|
|
157
|
+
azure-observation-aggregation: average
|
|
158
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
159
|
+
azure-resource-group: vm1_group
|
|
160
|
+
azure-vm-name: vm1
|
|
161
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
162
|
+
cloud-vendor: azure
|
|
163
|
+
cpu-util: '0.29500000000000004'
|
|
164
|
+
mem-availableGB: 0.509607936
|
|
165
|
+
mem-usedGB: 0.490392064
|
|
166
|
+
total-memoryGB: '1'
|
|
167
|
+
mem-util: 49.039206400000005
|
|
168
|
+
location: uksouth
|
|
169
|
+
cloud-instance-type: Standard_B1s
|
|
170
|
+
duration: 300
|
|
171
|
+
azure-observation-window: 5 min
|
|
172
|
+
azure-observation-aggregation: average
|
|
173
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
174
|
+
azure-resource-group: vm1_group
|
|
175
|
+
azure-vm-name: vm1
|
|
176
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
177
|
+
cloud-vendor: azure
|
|
178
|
+
cpu-util: '0.309'
|
|
179
|
+
mem-availableGB: 0.5106565120000001
|
|
180
|
+
mem-usedGB: 0.48934348799999994
|
|
181
|
+
total-memoryGB: '1'
|
|
182
|
+
mem-util: 48.934348799999995
|
|
183
|
+
location: uksouth
|
|
184
|
+
cloud-instance-type: Standard_B1s
|
|
185
|
+
duration: 300
|
|
186
|
+
azure-observation-window: 5 min
|
|
187
|
+
azure-observation-aggregation: average
|
|
188
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
189
|
+
azure-resource-group: vm1_group
|
|
190
|
+
azure-vm-name: vm1
|
|
191
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
192
|
+
cloud-vendor: azure
|
|
193
|
+
cpu-util: '0.484'
|
|
194
|
+
mem-availableGB: 0.5106565120000001
|
|
195
|
+
mem-usedGB: 0.48934348799999994
|
|
196
|
+
total-memoryGB: '1'
|
|
197
|
+
mem-util: 48.934348799999995
|
|
198
|
+
location: uksouth
|
|
199
|
+
cloud-instance-type: Standard_B1s
|
|
200
|
+
duration: 300
|
|
201
|
+
azure-observation-window: 5 min
|
|
202
|
+
azure-observation-aggregation: average
|
|
203
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
204
|
+
azure-resource-group: vm1_group
|
|
205
|
+
azure-vm-name: vm1
|
|
@@ -16,17 +16,9 @@ jobs:
|
|
|
16
16
|
node-version: 18
|
|
17
17
|
cache: 'yarn'
|
|
18
18
|
|
|
19
|
-
- name: 'setup python'
|
|
20
|
-
uses: actions/setup-python@v4
|
|
21
|
-
with:
|
|
22
|
-
python-version: '3.11'
|
|
23
|
-
|
|
24
19
|
- name: Install dependencies
|
|
25
20
|
run: yarn install
|
|
26
21
|
|
|
27
|
-
- name: Copy Sample CLI Mocker to bin folder
|
|
28
|
-
run: pip3 install pyyaml && cp src/lib/shell-imp/sampler /usr/local/bin/sampler && chmod +x /usr/local/bin/sampler
|
|
29
|
-
|
|
30
22
|
- name: Run lint
|
|
31
23
|
run: yarn lint
|
|
32
24
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Impact
|
|
1
|
+
# Impact Framework
|
|
2
2
|
|
|
3
|
-
[Impact
|
|
3
|
+
[Impact Framework](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/17072136/Opensource+Impact+Engine+Framework) (IF) is an [Incubation](https://oc.greensoftware.foundation/project-lifecycle.html#incubation) project from the [Open Source Working Group](https://greensoftwarefoundation.atlassian.net/wiki/spaces/~612dd45e45cd76006a84071a/pages/852049/Open+Source+Working+Group) in the [Green Software Foundation](https://greensoftware.foundation/).
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**IF** is a framework to **M**odel, **M**easure, si**M**ulate and **M**onitor the environmental impacts of software
|
|
6
6
|
|
|
7
7
|
Modern applications are composed of many smaller pieces of software (components) running on many different environments, for example, private cloud, public cloud, bare-metal, virtualized, containerized, mobile, laptops, and desktops.
|
|
8
8
|
|
|
@@ -15,12 +15,51 @@ Read the [specification and design docs](https://github.com/Green-Software-Found
|
|
|
15
15
|
|
|
16
16
|
## Get started
|
|
17
17
|
|
|
18
|
-
The first thing to understand is that IF is a framework for running model plugins. This means that in order to do some calculations, you need to load some models from some external resource. We provide a [standard library of models](https://github.com/Green-Software-Foundation/if-models) and a repository of [community models](https://github.com/Green-Software-Foundation/if-
|
|
18
|
+
The first thing to understand is that IF is a framework for running model plugins. This means that in order to do some calculations, you need to load some models from some external resource. We provide a [standard library of models](https://github.com/Green-Software-Foundation/if-models) and a repository of [community models](https://github.com/Green-Software-Foundation/if-unofficial-models) to get you started.
|
|
19
19
|
|
|
20
|
-
Start by installing
|
|
20
|
+
Start by installing framework itself:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
|
|
23
|
+
npm install -g "@grnsft/if"
|
|
24
|
+
```
|
|
25
|
+
Then installing some models:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install -g "@grnsft/if-models"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then create an `impl` file that describes your application (see our docs for a detailed explanation).
|
|
32
|
+
|
|
33
|
+
Then, run `impact-engine` using the following command:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
impact-engine --impl <path-to-your-impl-file>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
You can also add an optional savepath for your output yaml (if you do not provide one, the output will be printed to the console):
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
impact-engine --impl <path-to-your-impl-file> --ompl <your-savepath>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The `impact-engine` CLI tool will configure and run the models defined in your input `yaml` (`impl`) and return the results as an output `yaml` (`ompl`).
|
|
46
|
+
|
|
47
|
+
### Alternate version
|
|
48
|
+
|
|
49
|
+
Start by cloning repository locally:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
git clone https://github.com/Green-Software-Foundation/if
|
|
53
|
+
|
|
54
|
+
cd if
|
|
55
|
+
|
|
56
|
+
yarn install
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then installing some models:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
yarn add "@grnsft/if-models"
|
|
24
63
|
```
|
|
25
64
|
|
|
26
65
|
Then create an `impl` file that describes your application (see our docs for a detailed explanation).
|
|
@@ -28,24 +67,24 @@ Then create an `impl` file that describes your application (see our docs for a d
|
|
|
28
67
|
Then, run `impact-engine` using the following command:
|
|
29
68
|
|
|
30
69
|
```sh
|
|
31
|
-
|
|
70
|
+
yarn impact-engine -- --impl <path-to-your-impl-file>
|
|
32
71
|
```
|
|
33
72
|
|
|
34
73
|
You can also add an optional savepath for your output yaml (if you do not provide one, the output will be printed to the console):
|
|
35
74
|
|
|
36
75
|
```sh
|
|
37
|
-
|
|
76
|
+
yarn impact-engine -- --impl <path-to-your-impl-file> --ompl <your-savepath>
|
|
38
77
|
```
|
|
39
78
|
|
|
40
79
|
The `impact-engine` CLI tool will configure and run the models defined in your input `yaml` (`impl`) and return the results as an output `yaml` (`ompl`).
|
|
41
80
|
|
|
81
|
+
|
|
42
82
|
## Video walk-through
|
|
43
83
|
|
|
44
84
|
Watch this video to learn how to create and run an `impl`.
|
|
45
85
|
|
|
46
86
|
[](https://youtu.be/R-6eDM8AsvY)
|
|
47
87
|
|
|
48
|
-
|
|
49
88
|
## Run tests
|
|
50
89
|
|
|
51
90
|
To run the complete set of tests simply run
|
package/build/index.js
CHANGED
|
@@ -17,7 +17,6 @@ const { DISCLAIMER_MESSAGE, SOMETHING_WRONG } = config_1.STRINGS;
|
|
|
17
17
|
* 3. Initializes models.
|
|
18
18
|
* 4. Initializes graph, does computing.
|
|
19
19
|
* 5. Saves processed object as a yaml file.
|
|
20
|
-
* @example run `npx ts-node impact-engine.ts --impl ./test.yml --ompl ./result.yml`
|
|
21
20
|
* @example run `npm run impact-engine -- --impl ./test.yml --ompl ./result.yml`
|
|
22
21
|
*/
|
|
23
22
|
const impactEngine = async () => {
|
|
@@ -44,4 +43,4 @@ const impactEngine = async () => {
|
|
|
44
43
|
return Promise.reject(new CliInputError(SOMETHING_WRONG));
|
|
45
44
|
};
|
|
46
45
|
impactEngine().catch(helpers_1.andHandle);
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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5cbiAgICAvLyBMaWZlY3ljbGUgSW5pdGlhbGl6ZSBNb2RlbHNcbiAgICBjb25zdCBtb2RlbHNIYW5kYm9vayA9IG5ldyBNb2RlbHNVbml2ZXJzZSgpO1xuICAgIGltcGwuaW5pdGlhbGl6ZS5tb2RlbHMuZm9yRWFjaCgobW9kZWw6IGFueSkgPT5cbiAgICAgIG1vZGVsc0hhbmRib29rLndyaXRlRG93bihtb2RlbClcbiAgICApO1xuXG4gICAgLy8gTGlmZWN5Y2xlIENvbXB1dGluZ1xuICAgIGNvbnN0IGF0ZXJ1aUNvbXB1dGVyID0gbmV3IFN1cGVyY29tcHV0ZXIoaW1wbCwgbW9kZWxzSGFuZGJvb2spO1xuICAgIGNvbnN0IG9tcGwgPSBhd2FpdCBhdGVydWlDb21wdXRlci5jb21wdXRlKCk7XG5cbiAgICBpZiAoIW91dHB1dFBhdGgpIHtcbiAgICAgIGNvbnNvbGUubG9nKEpTT04uc3RyaW5naWZ5KG9tcGwpKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBhd2FpdCBzYXZlWWFtbEZpbGVBcyhvbXBsLCBvdXRwdXRQYXRoKTtcblxuICAgIHJldHVybjtcbiAgfVxuXG4gIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgQ2xpSW5wdXRFcnJvcihTT01FVEhJTkdfV1JPTkcpKTtcbn07XG5cbmltcGFjdEVuZ2luZSgpLmNhdGNoKGFuZEhhbmRsZSk7XG4iXX0=
|
|
@@ -4,7 +4,7 @@ tags:
|
|
|
4
4
|
initialize:
|
|
5
5
|
models:
|
|
6
6
|
- name: azure-importer
|
|
7
|
-
path: if-models
|
|
7
|
+
path: "@grnsft/if-unofficial-models"
|
|
8
8
|
model: AzureImporterModel
|
|
9
9
|
kind: plugin
|
|
10
10
|
graph:
|
|
@@ -15,12 +15,12 @@ graph:
|
|
|
15
15
|
config:
|
|
16
16
|
azure-importer:
|
|
17
17
|
inputs:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
- timestamp: '2023-11-02T10:35:31.820Z'
|
|
19
|
+
duration: 3600
|
|
20
|
+
azure-observation-window: 5 min # value and unit must be space separated
|
|
21
|
+
azure-observation-aggregation: 'average'
|
|
22
|
+
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
23
|
+
azure-resource-group: vm1_group
|
|
24
|
+
azure-vm-name: vm1
|
|
25
25
|
|
|
26
26
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
name: ccf-demo
|
|
2
2
|
description: example impl invoking CCF model
|
|
3
|
+
tags:
|
|
3
4
|
initialize:
|
|
4
5
|
models:
|
|
5
6
|
- name: ccf
|
|
6
|
-
|
|
7
|
+
model: CloudCarbonFootprint
|
|
8
|
+
path: "@grnsft/if-unofficial-models"
|
|
7
9
|
graph:
|
|
8
10
|
children:
|
|
9
11
|
child:
|
|
@@ -11,8 +13,8 @@ graph:
|
|
|
11
13
|
- ccf
|
|
12
14
|
config:
|
|
13
15
|
ccf:
|
|
14
|
-
vendor: aws
|
|
15
|
-
instance-type: m5n.large
|
|
16
|
+
vendor: 'aws'
|
|
17
|
+
instance-type: 'm5n.large'
|
|
16
18
|
inputs:
|
|
17
19
|
- timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
|
|
18
20
|
duration: 1
|
|
@@ -4,21 +4,29 @@ tags:
|
|
|
4
4
|
initialize:
|
|
5
5
|
models:
|
|
6
6
|
- name: azure-importer
|
|
7
|
-
|
|
7
|
+
model: AzureImporterModel
|
|
8
|
+
path: "@grnsft/if-unofficial-models"
|
|
8
9
|
- name: cloud-instance-metadata
|
|
9
|
-
|
|
10
|
+
model: CloudInstanceMetadataModel
|
|
11
|
+
path: "@grnsft/if-models"
|
|
10
12
|
- name: teads-curve
|
|
11
|
-
|
|
13
|
+
model: TeadsCurveModel
|
|
14
|
+
path: "@grnsft/if-unofficial-models"
|
|
12
15
|
- name: sci-e
|
|
13
|
-
|
|
16
|
+
model: SciEModel
|
|
17
|
+
path: "@grnsft/if-models"
|
|
14
18
|
- name: sci-o
|
|
15
|
-
|
|
19
|
+
model: SciOModel
|
|
20
|
+
path: "@grnsft/if-models"
|
|
16
21
|
- name: sci-e
|
|
17
|
-
|
|
22
|
+
model: SciEModel
|
|
23
|
+
path: "@grnsft/if-models"
|
|
18
24
|
- name: sci-m
|
|
19
|
-
|
|
25
|
+
model: SciMModel
|
|
26
|
+
path: "@grnsft/if-models"
|
|
20
27
|
- name: sci
|
|
21
|
-
|
|
28
|
+
model: SciModel
|
|
29
|
+
path: "@grnsft/if-models"
|
|
22
30
|
graph:
|
|
23
31
|
children:
|
|
24
32
|
child:
|
|
@@ -31,6 +39,8 @@ graph:
|
|
|
31
39
|
- sci-m
|
|
32
40
|
- sci
|
|
33
41
|
config:
|
|
42
|
+
sci-o:
|
|
43
|
+
grid-carbon-intensity: 951
|
|
34
44
|
sci:
|
|
35
45
|
functional-unit: ''
|
|
36
46
|
functional-unit-time: hour
|
|
@@ -43,9 +53,9 @@ graph:
|
|
|
43
53
|
azure-subscription-id: 9de7e19f-8a18-4e73-9451-45fc74e7d0d3
|
|
44
54
|
azure-resource-group: vm1_group
|
|
45
55
|
azure-vm-name: vm1
|
|
46
|
-
grid-carbon-intensity: 951
|
|
47
56
|
total-embodied-emissions: 1533.12
|
|
48
57
|
time-reserved: 300
|
|
49
58
|
expected-lifespan: 94348800 # 3 yrs in seconds
|
|
50
59
|
resources-reserved: 1
|
|
51
60
|
total-resources: 64
|
|
61
|
+
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: cloud-instance-metadata
|
|
2
2
|
description: simple demo invoking metadata lookup
|
|
3
3
|
tags: null
|
|
4
4
|
initialize:
|
|
5
5
|
models:
|
|
6
6
|
- name: cloud-instance-metadata
|
|
7
|
-
|
|
7
|
+
model: CloudInstanceMetadataModel
|
|
8
|
+
path: "@grnsft/if-models"
|
|
8
9
|
graph:
|
|
9
10
|
children:
|
|
10
11
|
child:
|
|
@@ -7,23 +7,20 @@ tags:
|
|
|
7
7
|
initialize:
|
|
8
8
|
models:
|
|
9
9
|
- name: teads-curve
|
|
10
|
-
|
|
10
|
+
model: TeadsCurveModel
|
|
11
|
+
path: "@grnsft/if-unofficial-models"
|
|
11
12
|
- name: sci-e
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
path: ''
|
|
13
|
+
model: SciEModel
|
|
14
|
+
path: "@grnsft/if-models"
|
|
15
15
|
- name: sci-m
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
path: ''
|
|
16
|
+
path: "@grnsft/if-models"
|
|
17
|
+
model: SciMModel
|
|
19
18
|
- name: sci-o
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
path: ''
|
|
19
|
+
model: SciOModel
|
|
20
|
+
path: "@grnsft/if-models"
|
|
23
21
|
- name: sci
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
path: ''
|
|
22
|
+
model: SciModel
|
|
23
|
+
path: "@grnsft/if-models"
|
|
27
24
|
graph:
|
|
28
25
|
children:
|
|
29
26
|
child: # an advanced grouping node
|
|
@@ -5,14 +5,12 @@ initialize:
|
|
|
5
5
|
models:
|
|
6
6
|
- name: sci-e
|
|
7
7
|
kind: plugin
|
|
8
|
-
verbose: false
|
|
9
8
|
model: SciEModel
|
|
10
|
-
path: if-models
|
|
9
|
+
path: "@grnsft/if-models"
|
|
11
10
|
- name: sci-o
|
|
12
|
-
kind: plugin
|
|
13
11
|
verbose: false
|
|
14
12
|
model: SciOModel
|
|
15
|
-
path: if-models
|
|
13
|
+
path: "@grnsft/if-models"
|
|
16
14
|
graph:
|
|
17
15
|
children:
|
|
18
16
|
child:
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
name: tdp-
|
|
1
|
+
name: tdp-finder
|
|
2
|
+
description: demo
|
|
3
|
+
tags:
|
|
2
4
|
initialize:
|
|
3
5
|
models:
|
|
4
6
|
- name: tdp-finder # a model that returns an embodied value given the sci embodied attribution equation.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
path: ''
|
|
7
|
+
model: TdpFinderModel
|
|
8
|
+
path: "@grnsft/if-models"
|
|
8
9
|
graph:
|
|
9
10
|
children:
|
|
10
|
-
|
|
11
|
+
child:
|
|
11
12
|
pipeline:
|
|
12
13
|
- tdp-finder
|
|
13
14
|
config:
|
|
14
|
-
|
|
15
|
-
tdp:
|
|
16
|
-
observations:
|
|
15
|
+
inputs:
|
|
17
16
|
- timestamp: 2023-07-06T00:00
|
|
17
|
+
duration: 300
|
|
18
18
|
physical-processor: AMD 3020e
|
|
19
19
|
|