-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconst_config.py
149 lines (110 loc) · 3.55 KB
/
const_config.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
# Decorator
def constant(func):
def func_set(self, value):
raise TypeError
def func_get(self):
return func()
return property(func_get, func_set)
class Storage(object):
@constant
def BUCKET_NAME():
return "spotlake"
@constant
def DATABASE_NAME():
return "spotlake"
@constant
def AWS_TABLE_NAME():
return "aws"
@constant
def AZURE_TABLE_NAME():
return "azure"
@constant
def GCP_TABLE_NAME():
return "gcp"
class AwsCollector(object):
@constant
def LOCAL_PATH():
return "/home/ubuntu/spotlake/collector/spot-dataset/aws/ec2_collector"
@constant
def S3_LATEST_DATA_SAVE_PATH():
return "latest_data/latest_aws.json"
@constant
def S3_LOCAL_FILES_SAVE_PATH():
return "rawdata/aws/localfile"
@constant
def S3_WORKLOAD_SAVE_PATH():
return "rawdata/aws/workloads"
class AzureCollector(object):
@constant
def SLACK_WEBHOOK_URL():
return ""
@constant
def GET_EVICTION_RATE_URL():
return "https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01"
@constant
def GET_HARDWAREMAP_URL():
return "https://afd.hosting.portal.azure.net/compute/?environmentjson=true&extensionName=Microsoft_Azure_Compute&l=en&trustedAuthority=portal.azure.com"
@constant
def GET_PRICE_URL():
return "https://s2.billing.ext.azure.com/api/Billing/Subscription/GetSpecsCosts?SpotPricing=true"
@constant
def AZURE_SUBSCRIPTION_ID():
return ""
@constant
def SPEC_RESOURCE_SETS_LIMIT():
return 2000
@constant
def LATEST_FILENAME():
return "latest_azure.json"
@constant
def S3_LATEST_DATA_SAVE_PATH():
return "latest_data/latest_azure.json"
@constant
def QUERY_SELECTOR_FILENAME():
return "query-selector-azure.json"
@constant
def S3_QUERY_SELECTOR_SAVE_PATH():
return "query-selector/query-selector-azure.json"
@constant
def DF_WORKLOAD_COLS():
return ['InstanceTier', 'InstanceType', 'Region']
@constant
def DF_FEATURE_COLS():
return ['OndemandPrice', 'SpotPrice', 'IF']
@constant
def SERVER_SAVE_DIR():
return "/tmp"
@constant
def SERVER_SAVE_FILENAME():
return "latest_azure_df.pkl"
@constant
def GET_PRICE_URL():
return "https://prices.azure.com:443/api/retail/prices?$filter=serviceName eq 'Virtual Machines' and priceType eq 'Consumption' and unitOfMeasure eq '1 Hour' and contains(productName, 'Windows') eq false and contains(meterName, 'Low Priority') eq false and contains(meterName, 'Expired') eq false and contains(location, 'Gov') eq false and contains(location, 'ATT') eq false &$skip="
@constant
def FILTER_LOCATIONS():
return ['GOV', 'EUAP', 'ATT', 'SLV', '']
@constant
def MAX_SKIP():
return 200
@constant
def SPOT_DATA_COLLECTION_LOG_GROUP_NAME():
return "Collection-Data-Count"
@constant
def LOG_STREAM_NAME():
return "Azure-Count"
class GcpCollector(object):
@constant
def API_LINK():
return "https://cloudpricingcalculator.appspot.com/static/data/pricelist.json"
@constant
def S3_LATEST_DATA_SAVE_PATH():
return "latest_data/latest_gcp.json"
@constant
def LOCAL_PATH():
return "/tmp"
@constant
def SPOT_DATA_COLLECTION_LOG_GROUP_NAME():
return "Collection-Data-Count"
@constant
def LOG_STREAM_NAME():
return "GCP-Count"