forked from gdubicki/gcpinstances.info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scraper.py
executable file
·1525 lines (1375 loc) · 88.5 KB
/
scraper.py
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
import json
import requests
def nice(number: float):
return round(number, 5)
if __name__ == '__main__':
output = {}
n1_sud_discount = 0.7
m1_sud_discount = 0.7
m2_sud_discount = 0.7
m3_sud_discount = 1
n2_sud_discount = 0.8
n2d_sud_discount = 0.8
c2_sud_discount = 0.8
c2d_sud_discount = 0.8
e2_sud_discount = 1
a2_sud_discount = 1
t2d_sud_discount = 1
t2a_sud_discount = 0.7
c3_sud_discount = 1
regions = ['us', 'us-central1', 'us-east1', 'us-east4', 'us-east5', 'us-west4', 'us-west1', 'us-west2',
'us-west3', 'us-south1', 'europe', 'europe-central2', 'europe-west1', 'europe-west2',
'europe-west3', 'europe-west4', 'europe-west6', 'europe-west8', 'europe-west9',
'europe-west12', 'europe-north1', 'europe-southwest1', 'northamerica-northeast1',
'northamerica-northeast2', 'asia', 'asia-east', 'asia-east1', 'asia-east2',
'asia-northeast', 'me-west1', 'me-central1', 'asia-northeast1', 'asia-northeast2', 'asia-northeast3',
'asia-southeast', 'asia-southeast1', 'australia-southeast1', 'australia-southeast2',
'australia', 'southamerica-east1', 'asia-south1', 'asia-southeast2', 'asia-south2', 'southamerica-west1','europe-west10','africa-south1','me-central2']
specs_params = ['cores', 'memory', 'local_ssd', 'gpu', 'sole_tenant', 'nested_virtualization', 'cpu', 'benchmark']
generations = ['f1', 'g1', 'n1', 'n2', 'n2d', 'e2', 'c2', 'c2d', 'm1', 'm2', 'm3', 'a2', 't2d', 't2a', 'c3']
# the following variables scraped from https://cloud.google.com/compute/docs/machine-types
instance_types = ['e2-highcpu-32', 'e2-highcpu-16', 'e2-highcpu-2', 'e2-highcpu-4', 'e2-highcpu-8', 'e2-highmem-16',
'e2-highmem-2', 'e2-highmem-4', 'e2-highmem-8', 'e2-medium', 'e2-micro', 'e2-small',
'e2-standard-32',
'e2-standard-16', 'e2-standard-2', 'e2-standard-4', 'e2-standard-8', 'f1-micro', 'g1-small',
'n1-highcpu-16',
'n1-highcpu-2', 'n1-highcpu-32', 'n1-highcpu-4', 'n1-highcpu-64', 'n1-highcpu-8', 'n1-highcpu-96',
'n1-highmem-16', 'n1-highmem-2', 'n1-highmem-32', 'n1-highmem-4', 'n1-highmem-64', 'n1-highmem-8',
'n1-highmem-96', 'n1-standard-1', 'n1-standard-16', 'n1-standard-2',
'n1-standard-32', 'n1-standard-4', 'n1-standard-64', 'n1-standard-8', 'n1-standard-96',
'c2-standard-4', 'c2-standard-8', 'c2d-standard-2', 'c2d-standard-4', 'c2d-standard-8',
'c2d-standard-16', 'c2d-standard-32', 'c2d-standard-56', 'c2d-standard-112', 'c2d-highcpu-2',
'c2d-highcpu-4', 'c2d-highcpu-8', 'c2d-highcpu-16', 'c2d-highcpu-32', 'c2d-highcpu-56',
'c2d-highcpu-112', 'c2d-highmem-2', 'c2d-highmem-4', 'c2d-highmem-8',
'c2d-highmem-16', 'c2d-highmem-32', 'c2d-highmem-56', 'c2d-highmem-112',
'c2-standard-16', 'm1-ultramem-40', 'm1-ultramem-80', 'm1-ultramem-160',
'm1-megamem-96', 'c2-standard-30', 'c2-standard-60', 'm2-megamem-416', 'm2-ultramem-208',
'm2-ultramem-416',
'm3-ultramem-32', 'm3-ultramem-64', 'm3-ultramem-128', 'm3-megamem-64', 'm3-megamem-128',
'n2-standard-2', 'n2-standard-4', 'n2-standard-8', 'n2-standard-16', 'n2-standard-32',
'n2-standard-48', 'n2-standard-64', 'n2-standard-80', 'n2-standard-96', 'n2-standard-128',
'n2-highmem-2', 'n2-highmem-4', 'n2-highmem-8', 'n2-highmem-16', 'n2-highmem-32', 'n2-highmem-48',
'n2-highmem-64',
'n2-highmem-80', 'n2-highmem-96', 'n2-highmem-128', 'n2-highcpu-2', 'n2-highcpu-4',
'n2-highcpu-8', 'n2-highcpu-16', 'n2-highcpu-32',
'n2-highcpu-48', 'n2-highcpu-64', 'n2-highcpu-80', 'n2-highcpu-96', 'n2d-standard-2',
'n2d-standard-4', 'n2d-standard-8', 'n2d-standard-16', 'n2d-standard-32', 'n2d-standard-48',
'n2d-standard-64',
'n2d-standard-80', 'n2d-standard-96', 'n2d-standard-128', 'n2d-standard-224', 'n2d-highmem-2',
'n2d-highmem-4', 'n2d-highmem-8', 'n2d-highmem-16', 'n2d-highmem-32', 'n2d-highmem-48',
'n2d-highmem-64', 'n2d-highmem-80', 'n2d-highmem-96', 'n2d-highcpu-2', 'n2d-highcpu-4',
'n2d-highcpu-8', 'n2d-highcpu-16', 'n2d-highcpu-32', 'n2d-highcpu-48', 'n2d-highcpu-64',
'n2d-highcpu-80', 'n2d-highcpu-96', 'n2d-highcpu-128', 'n2d-highcpu-224', 'a2-highgpu-1g',
'a2-highgpu-2g', 'a2-highgpu-4g', 'a2-highgpu-8g', 'a2-megagpu-16g', 't2d-standard-1',
't2d-standard-2', 't2d-standard-4', 't2d-standard-8', 't2d-standard-16', 't2d-standard-32',
't2d-standard-48', 't2d-standard-60', 't2a-standard-1', 't2a-standard-2', 't2a-standard-4',
't2a-standard-8',
't2a-standard-16', 't2a-standard-32', 't2a-standard-48',
'c3-highcpu-4', 'c3-highcpu-8', 'c3-highcpu-22', 'c3-highcpu-44', 'c3-highcpu-88', 'c3-highcpu-176',
]
c3_instance_types = {
"c3-highcpu-4": {"cpu": 4, "memory": 8, "local_ssd": 0, "network_egress": 23, "benchmark": 0},
"c3-highcpu-8": {"cpu": 8, "memory": 16, "local_ssd": 0, "network_egress": 23, "benchmark": 0},
"c3-highcpu-22": {"cpu": 22, "memory": 44, "local_ssd": 0, "network_egress": 23, "benchmark": 0},
"c3-highcpu-44": {"cpu": 44, "memory": 88, "local_ssd": 0, "network_egress": 32, "benchmark": 0},
"c3-highcpu-88": {"cpu": 88, "memory": 176, "local_ssd": 0, "network_egress": 62, "benchmark": 0},
"c3-highcpu-176": {"cpu": 176, "memory": 352, "local_ssd": 0, "network_egress": 100, "benchmark": 0},
}
c2_instance_types = {
"c2-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 1, "network_egress": 10, "benchmark": 77310},
"c2-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 1, "network_egress": 16, "benchmark": 148689},
"c2-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 313768},
"c2-standard-30": {"cpu": 30, "memory": 120, "local_ssd": 1, "network_egress": 32, "benchmark": 571147},
"c2-standard-60": {"cpu": 60, "memory": 240, "local_ssd": 1, "network_egress": 32, "benchmark": 1142234}}
c2d_instance_types = {
"c2d-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 1, "network_egress": 32, "benchmark": 41509},
"c2d-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 1, "network_egress": 32, "benchmark": 85847},
"c2d-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 1, "network_egress": 32, "benchmark": 156295},
"c2d-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 327768},
"c2d-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 655858},
"c2d-standard-56": {"cpu": 56, "memory": 224, "local_ssd": 1, "network_egress": 32, "benchmark": 1147023},
"c2d-standard-112": {"cpu": 112, "memory": 448, "local_ssd": 1, "network_egress": 32, "benchmark": 2378171},
"c2d-highcpu-2": {"cpu": 2, "memory": 4, "local_ssd": 1, "network_egress": 32, "benchmark": 41513},
"c2d-highcpu-4": {"cpu": 4, "memory": 8, "local_ssd": 1, "network_egress": 32, "benchmark": 85822},
"c2d-highcpu-8": {"cpu": 8, "memory": 16, "local_ssd": 1, "network_egress": 32, "benchmark": 156259},
"c2d-highcpu-16": {"cpu": 16, "memory": 32, "local_ssd": 1, "network_egress": 32, "benchmark": 328057},
"c2d-highcpu-32": {"cpu": 32, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 656020},
"c2d-highcpu-56": {"cpu": 56, "memory": 112, "local_ssd": 1, "network_egress": 32, "benchmark": 1146929},
"c2d-highcpu-112": {"cpu": 112, "memory": 224, "local_ssd": 1, "network_egress": 32, "benchmark": 2379950},
"c2d-highmem-2": {"cpu": 2, "memory": 16, "local_ssd": 1, "network_egress": 32, "benchmark": 41429},
"c2d-highmem-4": {"cpu": 4, "memory": 32, "local_ssd": 1, "network_egress": 32, "benchmark": 85938},
"c2d-highmem-8": {"cpu": 8, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 156488},
"c2d-highmem-16": {"cpu": 16, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 328023},
"c2d-highmem-32": {"cpu": 32, "memory": 256, "local_ssd": 1, "network_egress": 32, "benchmark": 655657},
"c2d-highmem-56": {"cpu": 56, "memory": 448, "local_ssd": 1, "network_egress": 32, "benchmark": 1146835},
"c2d-highmem-112": {"cpu": 112, "memory": 896, "local_ssd": 1, "network_egress": 32, "benchmark": 2374591}}
m1_instance_types = {
"m1-ultramem-40": {"cpu": 40, "memory": 961, "local_ssd": 0, "network_egress": 32, "benchmark": 498947},
"m1-ultramem-80": {"cpu": 80, "memory": 1922, "local_ssd": 0, "network_egress": 32, "benchmark": 994301},
"m1-ultramem-160": {"cpu": 160, "memory": 3844, "local_ssd": 0, "network_egress": 32, "benchmark": 1967211},
"m1-megamem-96": {"cpu": 96, "memory": 1433.6, "local_ssd": 1, "network_egress": 32, "benchmark": 1254891}}
m2_instance_types = {
"m2-ultramem-208": {"cpu": 208, "memory": 5888, "local_ssd": 0, "network_egress": 32, "benchmark": 3117739},
"m2-ultramem-416": {"cpu": 416, "memory": 11776, "local_ssd": 0, "network_egress": 32, "benchmark": 5378985},
"m2-megamem-416": {"cpu": 416, "memory": 5888, "local_ssd": 0, "network_egress": 32, "benchmark": 5365802}}
m2_instance_types = {
"m2-ultramem-208": {"cpu": 208, "memory": 5888, "local_ssd": 0, "network_egress": 32, "benchmark": 3117739},
"m2-ultramem-416": {"cpu": 416, "memory": 11776, "local_ssd": 0, "network_egress": 32, "benchmark": 5378985},
"m2-megamem-416": {"cpu": 416, "memory": 5888, "local_ssd": 0, "network_egress": 32, "benchmark": 5365802}}
m3_instance_types = {
"m3-ultramem-32": {"cpu": 32, "memory": 976, "local_ssd": 0, "network_egress": 32, "benchmark": 0},
"m3-ultramem-64": {"cpu": 64, "memory": 1952, "local_ssd": 0, "network_egress": 32, "benchmark": 0},
"m3-ultramem-128": {"cpu": 128, "memory": 3904, "local_ssd": 0, "network_egress": 32, "benchmark": 0},
"m3-megamem-64": {"cpu": 64, "memory": 976, "local_ssd": 0, "network_egress": 32, "benchmark": 0},
"m3-megamem-128": {"cpu": 128, "memory": 1952, "local_ssd": 0, "network_egress": 32, "benchmark": 0}}
n2_instance_types = {
"n2-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 1, "network_egress": 10, "benchmark": 33676},
"n2-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 1, "network_egress": 10, "benchmark": 67643},
"n2-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 1, "network_egress": 16, "benchmark": 135272},
"n2-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 269760},
"n2-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 538050},
"n2-standard-48": {"cpu": 48, "memory": 192, "local_ssd": 1, "network_egress": 32, "benchmark": 806235},
"n2-standard-64": {"cpu": 64, "memory": 256, "local_ssd": 1, "network_egress": 32, "benchmark": 1069840},
"n2-standard-80": {"cpu": 80, "memory": 320, "local_ssd": 1, "network_egress": 32, "benchmark": 1338406},
"n2-standard-96": {"cpu": 96, "memory": 384, "local_ssd": 1, "network_egress": 32, "benchmark": 1590273},
"n2-standard-128": {"cpu": 128, "memory": 512, "local_ssd": 1, "network_egress": 32, "benchmark": 2065382},
"n2-highmem-2": {"cpu": 2, "memory": 16, "local_ssd": 1, "network_egress": 10, "benchmark": 33649},
"n2-highmem-4": {"cpu": 4, "memory": 32, "local_ssd": 1, "network_egress": 10, "benchmark": 67702},
"n2-highmem-8": {"cpu": 8, "memory": 64, "local_ssd": 1, "network_egress": 16, "benchmark": 135364},
"n2-highmem-16": {"cpu": 16, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 269842},
"n2-highmem-32": {"cpu": 32, "memory": 256, "local_ssd": 1, "network_egress": 32, "benchmark": 538032},
"n2-highmem-48": {"cpu": 48, "memory": 384, "local_ssd": 1, "network_egress": 32, "benchmark": 806506},
"n2-highmem-64": {"cpu": 64, "memory": 512, "local_ssd": 1, "network_egress": 32, "benchmark": 1071112},
"n2-highmem-80": {"cpu": 80, "memory": 640, "local_ssd": 1, "network_egress": 32, "benchmark": 1330008},
"n2-highmem-96": {"cpu": 96, "memory": 768, "local_ssd": 1, "network_egress": 32, "benchmark": 1590062},
"n2-highmem-128": {"cpu": 128, "memory": 864, "local_ssd": 1, "network_egress": 32, "benchmark": 2072337},
"n2-highcpu-2": {"cpu": 2, "memory": 2, "local_ssd": 1, "network_egress": 10, "benchmark": 33719},
"n2-highcpu-4": {"cpu": 4, "memory": 4, "local_ssd": 1, "network_egress": 10, "benchmark": 67817},
"n2-highcpu-8": {"cpu": 8, "memory": 8, "local_ssd": 1, "network_egress": 16, "benchmark": 135527},
"n2-highcpu-16": {"cpu": 16, "memory": 16, "local_ssd": 1, "network_egress": 32, "benchmark": 270110},
"n2-highcpu-32": {"cpu": 32, "memory": 32, "local_ssd": 1, "network_egress": 32, "benchmark": 538530},
"n2-highcpu-48": {"cpu": 48, "memory": 48, "local_ssd": 1, "network_egress": 32, "benchmark": 806668},
"n2-highcpu-64": {"cpu": 64, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 1070807},
"n2-highcpu-80": {"cpu": 80, "memory": 80, "local_ssd": 1, "network_egress": 32, "benchmark": 1329120},
"n2-highcpu-96": {"cpu": 96, "memory": 96, "local_ssd": 1, "network_egress": 32, "benchmark": 0}}
e2_instance_types = {
"e2-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 0, "network_egress": 4, "benchmark": 26471},
"e2-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 0, "network_egress": 8, "benchmark": 54585},
"e2-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 0, "network_egress": 16, "benchmark": 104906},
"e2-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 0, "network_egress": 16, "benchmark": 220997},
"e2-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 0, "network_egress": 16, "benchmark": 439445},
"e2-highmem-2": {"cpu": 2, "memory": 16, "local_ssd": 0, "network_egress": 4, "benchmark": 26470},
"e2-highmem-4": {"cpu": 4, "memory": 32, "local_ssd": 0, "network_egress": 8, "benchmark": 54535},
"e2-highmem-8": {"cpu": 8, "memory": 64, "local_ssd": 0, "network_egress": 16, "benchmark": 104887},
"e2-highmem-16": {"cpu": 16, "memory": 128, "local_ssd": 0, "network_egress": 16, "benchmark": 221049},
"e2-highcpu-2": {"cpu": 2, "memory": 2, "local_ssd": 0, "network_egress": 4, "benchmark": 26499},
"e2-highcpu-4": {"cpu": 4, "memory": 4, "local_ssd": 0, "network_egress": 8, "benchmark": 54785},
"e2-highcpu-8": {"cpu": 8, "memory": 8, "local_ssd": 0, "network_egress": 16, "benchmark": 104953},
"e2-highcpu-16": {"cpu": 16, "memory": 16, "local_ssd": 0, "network_egress": 16, "benchmark": 220277},
"e2-highcpu-32": {"cpu": 32, "memory": 32, "local_ssd": 0, "network_egress": 16, "benchmark": 438843}}
n2d_instance_types = {
"n2d-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 1, "network_egress": 10, "benchmark": 38897},
"n2d-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 1, "network_egress": 10, "benchmark": 79682},
"n2d-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 1, "network_egress": 10, "benchmark": 145022},
"n2d-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 303974},
"n2d-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 611375},
"n2d-standard-48": {"cpu": 48, "memory": 192, "local_ssd": 1, "network_egress": 32, "benchmark": 916485},
"n2d-standard-64": {"cpu": 64, "memory": 256, "local_ssd": 1, "network_egress": 32, "benchmark": 1217192},
"n2d-standard-80": {"cpu": 80, "memory": 320, "local_ssd": 1, "network_egress": 32, "benchmark": 1553066},
"n2d-standard-96": {"cpu": 96, "memory": 384, "local_ssd": 1, "network_egress": 32, "benchmark": 1826345},
"n2d-standard-128": {"cpu": 128, "memory": 512, "local_ssd": 1, "network_egress": 32, "benchmark": 2425400},
"n2d-standard-224": {"cpu": 224, "memory": 896, "local_ssd": 1, "network_egress": 32, "benchmark": 3938461},
"n2d-highmem-2": {"cpu": 2, "memory": 16, "local_ssd": 1, "network_egress": 10, "benchmark": 39065},
"n2d-highmem-4": {"cpu": 4, "memory": 32, "local_ssd": 1, "network_egress": 10, "benchmark": 80661},
"n2d-highmem-8": {"cpu": 8, "memory": 64, "local_ssd": 1, "network_egress": 10, "benchmark": 145124},
"n2d-highmem-16": {"cpu": 16, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 304101},
"n2d-highmem-32": {"cpu": 32, "memory": 256, "local_ssd": 1, "network_egress": 32, "benchmark": 611819},
"n2d-highmem-48": {"cpu": 48, "memory": 384, "local_ssd": 1, "network_egress": 32, "benchmark": 917010},
"n2d-highmem-64": {"cpu": 64, "memory": 512, "local_ssd": 1, "network_egress": 32, "benchmark": 1220465},
"n2d-highmem-80": {"cpu": 80, "memory": 640, "local_ssd": 1, "network_egress": 32, "benchmark": 1567766},
"n2d-highmem-96": {"cpu": 96, "memory": 768, "local_ssd": 1, "network_egress": 32, "benchmark": 1868649},
"n2d-highcpu-2": {"cpu": 2, "memory": 2, "local_ssd": 1, "network_egress": 10, "benchmark": 39106},
"n2d-highcpu-4": {"cpu": 4, "memory": 4, "local_ssd": 1, "network_egress": 10, "benchmark": 79859},
"n2d-highcpu-8": {"cpu": 8, "memory": 8, "local_ssd": 1, "network_egress": 10, "benchmark": 144995},
"n2d-highcpu-16": {"cpu": 16, "memory": 16, "local_ssd": 1, "network_egress": 32, "benchmark": 304014},
"n2d-highcpu-32": {"cpu": 32, "memory": 32, "local_ssd": 1, "network_egress": 32, "benchmark": 611726},
"n2d-highcpu-48": {"cpu": 48, "memory": 48, "local_ssd": 1, "network_egress": 32, "benchmark": 916993},
"n2d-highcpu-64": {"cpu": 64, "memory": 64, "local_ssd": 1, "network_egress": 32, "benchmark": 1218165},
"n2d-highcpu-80": {"cpu": 80, "memory": 80, "local_ssd": 1, "network_egress": 32, "benchmark": 1562713},
"n2d-highcpu-96": {"cpu": 96, "memory": 96, "local_ssd": 1, "network_egress": 32, "benchmark": 1870287},
"n2d-highcpu-128": {"cpu": 128, "memory": 128, "local_ssd": 1, "network_egress": 32, "benchmark": 0},
"n2d-highcpu-224": {"cpu": 224, "memory": 224, "local_ssd": 1, "network_egress": 32, "benchmark": 0}}
n1_instance_types = {
"n1-standard-1": {"cpu": 1, "memory": 3.75, "local_ssd": 1, "network_egress": 2, "benchmark": 20090},
"n1-standard-2": {"cpu": 2, "memory": 7.5, "local_ssd": 1, "network_egress": 10, "benchmark": 26532},
"n1-standard-4": {"cpu": 4, "memory": 15, "local_ssd": 1, "network_egress": 10, "benchmark": 54678},
"n1-standard-8": {"cpu": 8, "memory": 30, "local_ssd": 1, "network_egress": 16, "benchmark": 105383},
"n1-standard-16": {"cpu": 16, "memory": 60, "local_ssd": 1, "network_egress": 32, "benchmark": 221834},
"n1-standard-32": {"cpu": 32, "memory": 120, "local_ssd": 1, "network_egress": 32, "benchmark": 440755},
"n1-standard-64": {"cpu": 64, "memory": 240, "local_ssd": 1, "network_egress": 32, "benchmark": 883369},
"n1-standard-96": {"cpu": 96, "memory": 360, "local_ssd": 1, "network_egress": 32, "benchmark": 1247197},
"n1-highmem-2": {"cpu": 2, "memory": 13, "local_ssd": 1, "network_egress": 10, "benchmark": 26438},
"n1-highmem-4": {"cpu": 4, "memory": 26, "local_ssd": 1, "network_egress": 10, "benchmark": 54337},
"n1-highmem-8": {"cpu": 8, "memory": 52, "local_ssd": 1, "network_egress": 16, "benchmark": 104640},
"n1-highmem-16": {"cpu": 16, "memory": 104, "local_ssd": 1, "network_egress": 32, "benchmark": 220547},
"n1-highmem-32": {"cpu": 32, "memory": 208, "local_ssd": 1, "network_egress": 32, "benchmark": 439129},
"n1-highmem-64": {"cpu": 64, "memory": 416, "local_ssd": 1, "network_egress": 32, "benchmark": 879708},
"n1-highmem-96": {"cpu": 96, "memory": 624, "local_ssd": 1, "network_egress": 32, "benchmark": 1248277},
"n1-highcpu-2": {"cpu": 2, "memory": 1.8, "local_ssd": 1, "network_egress": 10, "benchmark": 26517},
"n1-highcpu-4": {"cpu": 4, "memory": 3.6, "local_ssd": 1, "network_egress": 10, "benchmark": 54676},
"n1-highcpu-8": {"cpu": 8, "memory": 7.2, "local_ssd": 1, "network_egress": 16, "benchmark": 105053},
"n1-highcpu-16": {"cpu": 16, "memory": 14.4, "local_ssd": 1, "network_egress": 32, "benchmark": 221443},
"n1-highcpu-32": {"cpu": 32, "memory": 28.8, "local_ssd": 1, "network_egress": 32, "benchmark": 438006},
"n1-highcpu-64": {"cpu": 64, "memory": 57.6, "local_ssd": 1, "network_egress": 32, "benchmark": 874912},
"n1-highcpu-96": {"cpu": 96, "memory": 86.4, "local_ssd": 1, "network_egress": 32, "benchmark": 1245251}}
a2_instance_types = {
"a2-highgpu-1g": {"cpu": 12, "memory": 85, "local_ssd": 1, "network_egress": 24, "benchmark": 0},
"a2-highgpu-2g": {"cpu": 24, "memory": 170, "local_ssd": 1, "network_egress": 32, "benchmark": 0},
"a2-highgpu-4g": {"cpu": 48, "memory": 340, "local_ssd": 1, "network_egress": 50, "benchmark": 0},
"a2-highgpu-8g": {"cpu": 96, "memory": 680, "local_ssd": 1, "network_egress": 100, "benchmark": 0},
"a2-megagpu-16g": {"cpu": 96, "memory": 1360, "local_ssd": 1, "network_egress": 100, "benchmark": 0}}
t2d_instance_types = {
"t2d-standard-1": {"cpu": 1, "memory": 4, "local_ssd": 0, "network_egress": 10, "benchmark": 28961},
"t2d-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 0, "network_egress": 10, "benchmark": 58601},
"t2d-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 0, "network_egress": 10, "benchmark": 118761},
"t2d-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 0, "network_egress": 16, "benchmark": 229103},
"t2d-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 0, "network_egress": 32, "benchmark": 451682},
"t2d-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 0, "network_egress": 32, "benchmark": 886865},
"t2d-standard-48": {"cpu": 48, "memory": 192, "local_ssd": 0, "network_egress": 32, "benchmark": 1305259},
"t2d-standard-60": {"cpu": 60, "memory": 240, "local_ssd": 0, "network_egress": 32, "benchmark": 1588850}}
t2a_instance_types = {
"t2a-standard-1": {"cpu": 1, "memory": 4, "local_ssd": 0, "network_egress": 10, "benchmark": 23261},
"t2a-standard-2": {"cpu": 2, "memory": 8, "local_ssd": 0, "network_egress": 10, "benchmark": 46385},
"t2a-standard-4": {"cpu": 4, "memory": 16, "local_ssd": 0, "network_egress": 10, "benchmark": 92973},
"t2a-standard-8": {"cpu": 8, "memory": 32, "local_ssd": 0, "network_egress": 16, "benchmark": 185998},
"t2a-standard-16": {"cpu": 16, "memory": 64, "local_ssd": 0, "network_egress": 32, "benchmark": 371142},
"t2a-standard-32": {"cpu": 32, "memory": 128, "local_ssd": 0, "network_egress": 32, "benchmark": 736262},
"t2a-standard-48": {"cpu": 48, "memory": 192, "local_ssd": 0, "network_egress": 32, "benchmark": 1102993}}
for gen in generations:
output[gen] = {}
for instance_t in instance_types:
instance_t_generation = instance_t.split('-')[0]
if instance_t_generation == gen:
output[gen][instance_t] = {'regions': {}, 'specs': {}}
for region in regions:
output[gen][instance_t]['regions'][region] = {}
for spec in specs_params:
output[gen][instance_t]['specs'][spec] = {}
# OS License
output['license'] = {}
# Download GCP Calculator pricing, and reformat it to GCPinstances.info strcture
data_json = requests.get('https://cloudpricingcalculator.appspot.com/static/data/pricelist.json').json()
data = data_json['gcp_price_list']
for k, v in data.items():
if k == 'CP-COMPUTEENGINE-OS':
for kk, vv in v.items():
output['license'][kk] = vv
if k == 'CP-COMPUTEENGINE-VMIMAGE-F1-MICRO':
for kk, vv in v.items():
if kk in regions:
output['f1']['f1-micro']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
# CPU type pulled from /proc/cpuinfo
output['f1']['f1-micro']['specs'].update(
{kk: vv, 'cpu': ['Intel Xeon @ 2.30GHz'], 'gpu': 0, 'local_ssd': 0, 'nested_virtualization': 0,
'sole_tenant': 0, 'benchmark': 4111})
if k == 'CP-COMPUTEENGINE-VMIMAGE-G1-SMALL':
for kk, vv in v.items():
if kk in regions:
output['g1']['g1-small']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
# CPU type pulled from /proc/cpuinfo
output['g1']['g1-small']['specs'].update(
{kk: vv, 'cpu': ['Intel Xeon @ 2.30GHz'], 'gpu': 0, 'local_ssd': 0, 'nested_virtualization': 0,
'sole_tenant': 0, 'benchmark': 10657})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-1':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-1']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-1']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-2':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-2']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-2']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-4':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-4']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-4']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-8':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-8']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-8']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-16':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-16']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-16']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-32':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-32']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-32']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-64':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-64']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-64']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-96':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-96']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-standard-96']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-2':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-2']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-2']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-4':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-4']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-4']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-8':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-8']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-8']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-16':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-16']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-16']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-32':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-32']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-32']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-64':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-64']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-64']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-96':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-96']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highmem-96']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-2':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-2']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-2']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-4':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-4']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-4']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-8':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-8']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-8']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-16':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-16']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-16']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-32':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-32']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-32']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-64':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-64']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-64']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-96':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-96']['regions'][kk] = {'ondemand': vv}
output['n1']['n1-highcpu-96']['regions'][kk].update({'sud': nice(vv * n1_sud_discount)})
#### PREEMPTIBLE INSTANCES
if k == 'CP-COMPUTEENGINE-VMIMAGE-F1-MICRO-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['f1']['f1-micro']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-G1-SMALL-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['g1']['g1-small']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-1-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-1']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-96']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-96']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-96']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-1-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-1']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-STANDARD-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-standard-96']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHMEM-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highmem-96']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-64-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-64']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-N1-HIGHCPU-96-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['n1']['n1-highcpu-96']['regions'][kk].update({'preemptible': vv})
### E2
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-32':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-32']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-32']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-4']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-SMALL':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-small']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-small']['specs'].update(
{'cores': 2, 'memory': 2, 'cpu': ['N/A'], 'gpu': 0, 'local_ssd': 0, 'nested_virtualization': 0,
'sole_tenant': 0, 'benchmark': 6745, 'network_egress': 1})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-32':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-32']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-32']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-standard-4']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-32':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-32']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-32']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-4']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-16':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-16']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-16']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-32':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-32']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-32']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-MICRO':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-micro']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-micro']['specs'].update(
{'cores': 2, 'memory': 1, 'cpu': ['Skylake', 'Broadwell', 'Haswell', 'AMD EPYC Rome'], 'gpu': 0,
'local_ssd': 0, 'nested_virtualization': 0,
'sole_tenant': 0, 'benchmark': 3238, 'network_egress': 1})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-4']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-8':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-8']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-8']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-MEDIUM':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-medium']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-medium']['specs'].update(
{'cores': 2, 'memory': 4, 'cpu': ['Skylake', 'Broadwell', 'Haswell', 'AMD EPYC Rome'], 'gpu': 0,
'local_ssd': 0, 'nested_virtualization': 0,
'sole_tenant': 0, 'benchmark': 14529, 'network_egress': 2})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-2':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-2']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-2']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highcpu-4']['specs'].update({kk: vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-4':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-4']['regions'][kk] = {'ondemand': vv}
if kk in specs_params:
output['e2']['e2-highmem-4']['specs'].update({kk: vv})
### PREEMPTIBLE E2
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-MICRO-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-micro']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-MEDIUM-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-medium']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-SMALL-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-small']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-STANDARD-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-standard-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-16-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-16']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-32-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-32']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-4']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-2-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-2']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHCPU-8-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highcpu-8']['regions'][kk].update({'preemptible': vv})
if k == 'CP-COMPUTEENGINE-VMIMAGE-E2-HIGHMEM-4-PREEMPTIBLE':
for kk, vv in v.items():
if kk in regions:
output['e2']['e2-highmem-4']['regions'][kk].update({'preemptible': vv})
# N1
# Update specs
for k, v in n1_instance_types.items():
output['n1'][k]['specs'].update({'cores': v['cpu'], 'memory': v['memory'], 'local_ssd': v['local_ssd'],
'network_egress': v['network_egress'], 'benchmark': v['benchmark'],
'cpu': ['Skylake', 'Broadwell', 'Haswell', 'Sandy Bridge', 'Ivy Bridge'],
'gpu': 1, 'nested_virtualization': 1, 'sole_tenant': 1, 'regional_disk': 1})
# C2D
# On Demand, SUD and specs
c2d_ram = data['CP-COMPUTEENGINE-C2D-PREDEFINED-VM-RAM']
c2d_cpu = data['CP-COMPUTEENGINE-C2D-PREDEFINED-VM-CORE']
for k, v in c2d_instance_types.items():
output['c2d'][k]['specs'].update({'cores': v['cpu'], 'memory': v['memory'], 'local_ssd': v['local_ssd'],
'network_egress': v['network_egress'], 'benchmark': v['benchmark'],
'cpu': ['AMD EPYC Milan 3rd Generation'],
'regional_disk': 0, 'gpu': 0, 'sole_tenant': -1,
'nested_virtualization': -1})
for reg, c2d_cpu_region_cost in c2d_cpu.items():
for reg2, c2d_ram_region_cost in c2d_ram.items():
if reg == reg2: