-
Notifications
You must be signed in to change notification settings - Fork 0
/
if-project-sci.yml
421 lines (393 loc) · 13.1 KB
/
if-project-sci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
name: Impact Framework SCI
description: SCi score for the IF project, not including website.
tags:
initialize:
plugins:
# Unit conversions
##################
duration-in-hours:
method: Divide
path: 'builtin'
config:
numerator: duration
denominator: 3600 # s to hr
output: duration-in-hours
## Github storage for IF
########################
storage-and-traffic-from-github-if:
method: Github
path: if-github-plugin
config:
repo: Green-Software-Foundation/if
mapping: # rename outputs
'size': 'repo-size-if'
'clones': 'repo-clones-if'
storage-in-mb-to-tb-if:
method: Coefficient
path: builtin
config:
input-parameter: repo-size-if # size comes from github api and represents repo size in gb
coefficient: 0.000001 # convert size to tb
output-parameter: 'storage-tb-if'
storage-energy-in-watts-if:
method: Multiply
path: builtin
config:
input-parameters: ['storage-tb-if', 'watts-per-tb']
output-parameter: 'storage-watts-if'
storage-energy-in-wh-if:
method: Multiply
path: builtin
config:
input-parameters: ['storage-watts-if', 'duration-in-hours']
output-parameter: 'storage-wh-if'
storage-energy-to-kwh-if:
path: 'builtin'
method: Coefficient
config:
input-parameter: storage-wh-if
coefficient: 0.001
output-parameter: storage-kwh-if
## Github storage for if-data
#############################
storage-and-traffic-from-github-if-data:
method: Github
path: if-github-plugin
config:
repo: Green-Software-Foundation/if-data
mapping: # rename outputs
'size': 'repo-size-if-data'
'clones': 'repo-clones-if-data'
storage-in-mb-to-tb-if-data:
method: Coefficient
path: builtin
config:
input-parameter: repo-size-if-data # size comes from github api and represents repo size in gb
coefficient: 0.000001 # convert size to tb
output-parameter: storage-tb-if-data
storage-energy-in-watts-if-data:
method: Multiply
path: builtin
config:
input-parameters: ['storage-tb-if-data', 'watts-per-tb']
output-parameter: 'storage-watts-if-data'
storage-energy-in-wh-if-data:
method: Multiply
path: builtin
config:
input-parameters: ['storage-watts-if-data', 'duration-in-hours']
output-parameter: 'storage-wh-if-data'
storage-energy-to-kwh-if-data:
path: 'builtin'
method: Coefficient
config:
input-parameter: storage-wh-if-data
coefficient: 0.001
output-parameter: storage-kwh-if-data
## Github storage for if-docs
#############################
storage-and-traffic-from-github-if-docs:
method: Github
path: if-github-plugin
config:
repo: Green-Software-Foundation/if-docs
mapping: # rename outputs
'size': 'repo-size-if-docs'
'clones': 'repo-clones-if-docs'
storage-in-mb-to-tb-if-docs:
method: Coefficient
path: builtin
config:
input-parameter: repo-size-if-docs # size comes from github api and represents repo size in gb
coefficient: 0.000001 # convert size to tb
output-parameter: storage-tb-if-docs
storage-energy-in-watts-if-docs:
method: Multiply
path: builtin
config:
input-parameters: ['storage-tb-if-docs', 'watts-per-tb']
output-parameter: storage-watts-if-docs
storage-energy-in-wh-if-docs:
method: Multiply
path: builtin
config:
input-parameters: ['storage-watts-if-docs', 'duration-in-hours']
output-parameter: storage-wh-if-docs
storage-energy-to-kwh-if-docs:
path: builtin
method: Coefficient
config:
input-parameter: storage-wh-if-docs
coefficient: 0.001
output-parameter: storage-kwh-if-docs
sum-storage-energy-components:
method: Sum
path: builtin
config:
input-parameters:
['storage-kwh-if', 'storage-kwh-if-data', 'storage-kwh-if-docs']
output-parameter: 'storage-energy-kwh'
# data downloaded from if repositories
######################################
total-data-downloaded-from-if-repo:
method: Multiply
path: 'builtin'
config:
input-parameters: ['repo-size-if', 'repo-clones-if']
output-parameter: 'data-egress-if' # data transferred in GB
total-data-downloaded-from-if-docs-repo:
method: Multiply
path: 'builtin'
config:
input-parameters: ['repo-size-if-docs', 'repo-clones-if-docs']
output-parameter: 'data-egress-if-docs' # data transferred in GB
total-data-downloaded-from-if-data-repo:
method: Multiply
path: 'builtin'
config:
input-parameters: ['repo-size-if-data', 'repo-clones-if-data']
output-parameter: 'data-egress-if-data' # data transferred in GB
sum-repo-download-components:
method: Sum
path: builtin
config:
input-parameters:
['data-egress-if', 'data-egress-if-docs', 'data-egress-if-data']
output-parameter: total-data-egress
repo-downloads-to-energy:
method: Coefficient
path: 'builtin'
config:
input-parameter: total-data-egress
coefficient: 0.001 # from https://www.cloudcarbonfootprint.org/docs/methodology/#networking
output-parameter: github-downloads-energy-kwh
# Github CI/CD
##############
eco-ci-github-actions-if:
method: EcoCI
path: 'if-eco-ci-plugin'
config:
repo: 'Green-Software-Foundation/if'
branch: all
workflow: 66389738
start-date: 2024-07-14T08:30
end-date: 2024-08-14T10:30
mapping: # rename outputs
'energy': 'ci-cd-energy-kwh'
## NPM Storage
##############
storage-in-gb-to-tb-npm:
method: Coefficient
path: builtin
config:
input-parameter: npm-storage-size
coefficient: 0.001 # convert size to tb
output-parameter: storage-tb-npm
storage-energy-in-watts-npm:
method: Multiply
path: builtin
config:
input-parameters: ['storage-tb-npm', 'watts-per-tb']
output-parameter: storage-watts-npm
storage-energy-in-wh-npm:
method: Multiply
path: builtin
config:
input-parameters: ['storage-watts-npm', 'duration-in-hours']
output-parameter: storage-wh-npm
storage-energy-to-kwh-npm:
path: builtin
method: Coefficient
config:
input-parameter: storage-wh-npm
coefficient: 0.001
output-parameter: storage-energy-kwh-npm
## NPM download energy
######################
total-data-downloaded-from-npm:
method: Multiply
path: 'builtin'
config:
input-parameters: ['npm-storage-size', 'npm-downloads-per-month']
output-parameter: data-egress-npm
npm-downloads-to-energy:
method: Coefficient
path: 'builtin'
config:
input-parameter: data-egress-npm
coefficient: 0.001 # from https://www.cloudcarbonfootprint.org/docs/methodology/#networking
output-parameter: npm-downloads-energy-kwh
# Running IF
############
interpolate-power-curve:
path: builtin
method: Interpolation
config:
method: linear
x:
- 0
- 10
- 50
- 100
'y':
- 0.12
- 0.32
- 0.75
- 1.02
input-parameter: cpu/utilization
output-parameter: cpu-factor
cpu-factor-to-wattage:
path: builtin
method: Multiply
config:
input-parameters:
- cpu-factor
- thermal-design-power
output-parameter: cpu-wattage
cpu-wattage-times-run-time-duration:
path: builtin
method: Multiply
config:
input-parameters:
- cpu-wattage
- run-time-duration
output-parameter: cpu-wattage-times-run-time-duration
cpu-wattage-to-energy-kwh:
path: builtin
method: Divide
config:
numerator: cpu-wattage-times-run-time-duration
denominator: 3600000 # converts watts to kwh
output: cpu-energy-per-run
cpu-per-run-to-cpu-per-month:
path: builtin
method: Multiply
config:
input-parameters: [cpu-energy-per-run, runs-per-month]
output-parameter: if-run-cpu-energy
## Memory used per IF run
#########################
memory-coefficient-correction: # memory coefficient in CCF is given /GB/hr - we want to convert to /GB/run-time-duration then x by run duration in s
path: builtin
method: Coefficient
config:
input-parameter: run-time-duration
coefficient: 0.000006533333 # this is 0.000392/60 = KW/GB/H -> KW/GB/s
output-parameter: memory-coefficient
memory-energy-per-run:
path: builtin
method: Multiply
config:
input-parameters: [if-run-memory-gb, memory-coefficient]
output-parameter: if-run-memory-energy-per-run
memory-energy-per-run-to-memory-energy-per-month:
path: builtin
method: Multiply
config:
input-parameters: [if-run-memory-energy-per-run, runs-per-month]
output-parameter: if-run-memory-energy
## Sum energy components and convert to carbon
##############################################
sum-energy-components:
method: Sum
path: builtin
config:
input-parameters:
[
'storage-energy-kwh',
'github-downloads-energy-kwh',
'ci-cd-energy-kwh',
'storage-energy-kwh-npm',
'npm-downloads-energy-kwh',
'if-run-cpu-energy',
'if-run-memory-energy',
]
output-parameter: 'energy'
energy-to-carbon:
method: Multiply
path: 'builtin'
config:
input-parameters: ['energy', 'grid-intensity']
output-parameter: 'operational-carbon'
## Sum embodied and operational carbon
######################################
sum-carbon-components:
method: Sum
path: builtin
config:
input-parameters:
[
'operational-carbon',
'embodied-carbon-for-gh-server',
'embodied-carbon-of-user-devices',
]
output-parameter: 'carbon'
## Calculate SCI
################
sci:
method: Sci
path: 'builtin'
config:
functional-unit: runs-per-month
tree:
children:
if:
pipeline:
compute:
- duration-in-hours
- storage-and-traffic-from-github-if
- storage-in-mb-to-tb-if
- storage-energy-in-watts-if
- storage-energy-in-wh-if
- storage-energy-to-kwh-if
- storage-and-traffic-from-github-if-data
- storage-in-mb-to-tb-if-data
- storage-energy-in-watts-if-data
- storage-energy-in-wh-if-data
- storage-energy-to-kwh-if-data
- storage-and-traffic-from-github-if-docs
- storage-in-mb-to-tb-if-docs
- storage-energy-in-watts-if-docs
- storage-energy-in-wh-if-docs
- storage-energy-to-kwh-if-docs
- sum-storage-energy-components
- total-data-downloaded-from-if-repo
- total-data-downloaded-from-if-docs-repo
- total-data-downloaded-from-if-data-repo
- sum-repo-download-components
- eco-ci-github-actions-if
- repo-downloads-to-energy
- storage-in-gb-to-tb-npm
- storage-energy-in-watts-npm
- storage-energy-in-wh-npm
- storage-energy-to-kwh-npm
- total-data-downloaded-from-npm
- npm-downloads-to-energy
- interpolate-power-curve
- cpu-factor-to-wattage
- cpu-wattage-times-run-time-duration
- cpu-wattage-to-energy-kwh
- cpu-per-run-to-cpu-per-month
- memory-coefficient-correction
- memory-energy-per-run
- memory-energy-per-run-to-memory-energy-per-month
- sum-energy-components
- energy-to-carbon
- sum-carbon-components
- sci # gCO2eq per run
defaults:
watts-per-tb: 0.65 # https://www.cloudcarbonfootprint.org/docs/methodology/#storage
grid-intensity: 494 # world average according to https://sustainablewebdesign.org/estimating-digital-emissions/
npm-storage-size: 0.00000135 # in GB, retrieved from npm site
npm-downloads-per-month: 1080
runs-per-month: 3000 # assuming 20 per user, 150 users = 3000
cpu/utilization: 95
thermal-design-power: 45
run-time-duration: 7 #how long to run IF on given hardware
if-run-memory-gb: 0.48
embodied-carbon-for-gh-server: 0.117 # embodied carbon for our fraction of the server hosting our GH repos
embodied-carbon-of-user-devices: 26.94 # total embodied carbon for all user devices
embodied-carbon-npm-server: 0.00084 # embodied carbon for our fraction of the server hosting our npm package
inputs:
- timestamp: '2024-08-13T00:00'
duration: 2419200