generated from centrefornetzero/python-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjob.jsonnet
89 lines (88 loc) · 2.37 KB
/
job.jsonnet
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
local job(name, args_excl_output) = {
apiVersion: 'batch/v1',
kind: 'Job',
metadata: {
name: name,
namespace: 'domestic-heating-abm',
},
spec: {
completions: 10,
parallelism: 5,
template: {
spec: {
containers: [
{
name: 'domestic-heating-abm',
image: std.extVar('IMAGE_URI'),
command: ['python', '-m', 'simulation'],
args: args_excl_output + [
'--bigquery',
"select * from %s.prod_domestic_heating.household_agents where abs(mod(farm_fingerprint(id), 307)) = 1 and occupant_type != 'rented_social'" % std.extVar('PROJECT_ID'),
'gs://%s/%s/{uuid}/output.jsonl.gz' % [std.extVar('BUCKET_NAME'), name],
],
env: [
{ name: 'PROJECT_ID', value: std.extVar('PROJECT_ID') },
],
resources: {
requests: {
memory: '1024Mi',
cpu: '1000m',
},
},
},
],
restartPolicy: 'Never',
serviceAccountName: 'runner',
},
},
},
};
[
// scenarios
job('01a-%s-max-policy-extended-bus' % std.extVar('SHORT_SHA'), [
'--intervention',
'extended_boiler_upgrade_scheme',
'--intervention',
'heat_pump_campaign',
'--campaign-target-heat-pump-awareness-date',
'2028-01-01:0.5',
'--campaign-target-heat-pump-awareness-date',
'2034-01-01:0.75',
'--intervention',
'gas_oil_boiler_ban',
'--gas-oil-boiler-ban-date',
'2035-01-01',
'--gas-oil-boiler-ban-announce-date',
'2025-01-01',
'--heat-pump-awareness',
'0.25',
'--price-gbp-per-kwh-gas',
'0.0682',
'--price-gbp-per-kwh-electricity',
'0.182',
'--heat-pump-installer-count',
'10000000000'
]),
job('01b-%s-max-policy-extended-bus' % std.extVar('SHORT_SHA'), [
'--intervention',
'extended_boiler_upgrade_scheme',
'--intervention',
'heat_pump_campaign',
'--campaign-target-heat-pump-awareness-date',
'2028-01-01:0.75',
'--intervention',
'gas_oil_boiler_ban',
'--gas-oil-boiler-ban-date',
'2035-01-01',
'--gas-oil-boiler-ban-announce-date',
'2025-01-01',
'--heat-pump-awareness',
'0.5',
'--price-gbp-per-kwh-gas',
'0.0682',
'--price-gbp-per-kwh-electricity',
'0.182',
'--heat-pump-installer-count',
'10000000000'
]),
]