@@ -32,6 +32,9 @@ def initialize(page_name)
32
32
"description" => "Is this resource available in production queue ?" ,
33
33
"value_type" => "Boolean"
34
34
} ,
35
+ "chassis" => {
36
+ "description" => "The manfacturer, name and serial of the chassis."
37
+ } ,
35
38
"cluster" => {
36
39
"description" => "The name of the cluster the resource is part of"
37
40
} ,
@@ -43,24 +46,78 @@ def initialize(page_name)
43
46
"description" => "The ID of the CPU the resource is part of. The unique scope is the OAR server. " ,
44
47
"possible_values" => "1, 2, 3, ..."
45
48
} ,
49
+ "cpuset" => {
50
+ "description" => "Logical processor identifier (only the first thread in case of HyperThreading)." ,
51
+ "possible_values" => "0, 1, 2, 3, ..."
52
+ } ,
53
+ "disk" => {
54
+ "description" => "Id of a reservable disk on a node, for resources of type 'disk'." ,
55
+ } ,
56
+ "diskpath" => {
57
+ "description" => "Device path of a reservable disk on a node, for resources of type 'disk'." ,
58
+ } ,
46
59
"gpu" => {
47
60
"description" => "The ID of the GPU the resource is part of. The unique scope is the OAR server. " ,
48
61
"possible_values" => "1, 2, 3, ..."
49
62
} ,
63
+ "gpudevice" => {
64
+ "description" => "GPU device identifier." ,
65
+ "possible_values" => "0, 1, 2, 3"
66
+ } ,
50
67
"host" => {
51
- "description" => "A user-friendly name for the network_address property " ,
68
+ "description" => "The full hostname of the node the resource is part of. " ,
52
69
"possible_values" => "dahu-1.grenoble.grid5000.fr, ..."
53
70
} ,
54
71
"ip" => {
55
72
"description" => "The IPv4 address of the node the resource is part of"
56
73
} ,
57
74
"network_address" => {
58
- "description" => "The full hostname of the node the resource is part of" ,
75
+ "description" => "The full hostname of the node the resource is part of, please use 'host' instead. " ,
59
76
"possible_values" => "dahu-1.grenoble.grid5000.fr, ..."
60
77
} ,
78
+ "slash_16" => {
79
+ "description" => "Used for subnet resources." ,
80
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
81
+ } ,
82
+ "slash_17" => {
83
+ "description" => "Used for subnet resources." ,
84
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
85
+ } ,
86
+ "slash_18" => {
87
+ "description" => "Used for subnet resources." ,
88
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
89
+ } ,
90
+ "slash_19" => {
91
+ "description" => "Used for subnet resources." ,
92
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
93
+ } ,
94
+ "slash_20" => {
95
+ "description" => "Used for subnet resources." ,
96
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
97
+ } ,
98
+ "slash_21" => {
99
+ "description" => "Used for subnet resources." ,
100
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
101
+ } ,
102
+ "slash_22" => {
103
+ "description" => "Used for subnet resources." ,
104
+ "possible_values" => "3d92, 00e6, 2cfc, 2bed, ..."
105
+ } ,
61
106
"switch" => {
62
107
"description" => "On what switch the resource is directly connected ?"
63
108
} ,
109
+ "subnet_address" => {
110
+ "description" => "Subnet address for subnet resources." ,
111
+ "possible_values" => "10.144.52.0, 10.144.24.0, 10.144.132.0, 10.146.28.0, 10.144.236.0, ..."
112
+ } ,
113
+ "subnet_prefix" => {
114
+ "description" => "Subnet prefix for subnet resources." ,
115
+ "possible_values" => "22"
116
+ } ,
117
+ "vlan" => {
118
+ "description" => "Used for kavlan-topo resources." ,
119
+ "possible_values" => "1, 1523, 1560, 1597, ..."
120
+ } ,
64
121
"nodemodel" => {
65
122
"description" => "The type of the chassis"
66
123
} ,
@@ -136,34 +193,37 @@ def initialize(page_name)
136
193
"mic" => {
137
194
"description" => "Intel many integrated core architecture support" ,
138
195
"value_type" => "Boolean"
196
+ } ,
197
+ "type" => {
198
+ "description" => "Type of the resource." ,
199
+ "possible_values" => "kavlan-topo, storage, disk, kavlan-local, kavlan-global, default, subnet, kavlan"
200
+ } ,
201
+ "expiry_date" => {
202
+ "description" => "Expiration date for the given resource." ,
203
+ "possible_values" => "0"
204
+ } ,
205
+ "comment" => {
206
+ "description" => "Comment for the given resource. (g5k internal property)" ,
207
+ "possible_values" => "Retired since 2018-01-30: retired_cluster, PSU Dead, Retired"
208
+ } ,
209
+ "maintenance" => {
210
+ "description" => "Is this resource under maintenance ?" ,
211
+ "value_type" => "Boolean" ,
212
+ "possible_values" => "YES, NO"
139
213
}
140
214
}
141
215
142
216
#Group properties by categories
143
217
@@categories = {
144
218
"Job-related properties" => [ "besteffort" , "deploy" , "production" , "cluster_priority" , "max_walltime" ] ,
145
- "Hierarchy" => [ "cluster" , "cpu" , "core" , "host" , "network_address " , "ip " , "switch" ] ,
219
+ "Hierarchy" => [ "chassis" , " cluster", "cpu" , "cpuset" , " core", "disk" , "diskpath" , "gpu" , "gpudevice" , " host", "slash_16 " , "slash_17 " , "slash_18" , "slash_19" , "slash_20" , "slash_21" , "slash_22" , " switch" , "subnet_address" , "subnet_prefix" , "vlan "] ,
146
220
"Hardware" => [ "gpu_model" , "gpu_count" , "memnode" , "memcore" , "memcpu" , "disktype" , "disk_reservation_count" , "myri_rate" , "myri_count" , "myri" , "ib_rate" , "ib_count" , "ib" , "opa_rate" , "opa_count" , "eth_rate" , "eth_count" , "cpufreq" , "cputype" , "cpucore" , "cpuarch" , "virtual" , "mic" ] ,
147
- "Miscellaneous" => [ "wattmeter" , "nodemodel" ]
221
+ "Miscellaneous" => [ "wattmeter" , "nodemodel" , "network_address" , "ip" , "type" , "expiry_date" , "comment" , "maintenance" ]
148
222
}
149
223
150
224
#Existing properties that won't be documented
151
225
@@ignored_properties = [ "maintenance" , "state" , "ip_virtual" ]
152
226
153
- def get_nodes_properties ( _site_uid , site )
154
- properties = { }
155
- site [ 'clusters' ] . sort . to_h . each do |cluster_uid , cluster |
156
- cluster [ 'nodes' ] . sort . to_h . each do |node_uid , node |
157
- begin
158
- properties [ node_uid ] = get_ref_node_properties_internal ( cluster_uid , cluster , node_uid , node )
159
- rescue MissingProperty => e
160
- puts "Error while processing node #{ node_uid } : #{ e } "
161
- end
162
- end
163
- end
164
- return properties
165
- end
166
-
167
227
def get_value_type ( prop , values )
168
228
if ( @@properties [ prop ] [ "value_type" ] )
169
229
return @@properties [ prop ] [ "value_type" ]
@@ -183,38 +243,58 @@ def generate_content
183
243
refapi = load_data_hierarchy
184
244
#Properties generated from oar-properties generator
185
245
props = { }
186
- G5K ::SITES . each { |site_uid |
187
- props [ site_uid ] = get_nodes_properties ( site_uid , refapi [ "sites" ] [ site_uid ] )
246
+ oar_data_properties = [ ]
247
+ G5K ::SITES . each_with_index { |site_uid , index |
248
+ props [ site_uid ] = { }
249
+ props [ site_uid ] [ "default" ] = get_ref_default_properties ( site_uid , refapi [ "sites" ] [ site_uid ] )
250
+ props [ site_uid ] [ "disk" ] = get_ref_disk_properties ( site_uid , refapi [ "sites" ] [ site_uid ] )
251
+
252
+ # Retrieve all oar fields from the first site
253
+ if index == 0
254
+ get_oar_data ( site_uid , { "api" : { } , "verbose" : false } ) . each { |oar_node_data , _ |
255
+ oar_node_data . each { |key , _ |
256
+ oar_data_properties << key unless oar_data_properties . include? key
257
+ }
258
+ }
259
+ end
188
260
}
189
261
190
262
#Compiled properties used to generate page
191
263
oar_properties = { }
192
264
props . sort . to_h . each { |site , site_props |
193
- site_props . sort . to_h . each { |node_uid , node_props |
194
- node_props . sort . to_h . each { |property , value |
195
- next if @@ignored_properties . include? ( property )
196
-
197
- oar_properties [ property ] ||= { }
198
- oar_properties [ property ] [ "values" ] ||= [ ]
199
- oar_properties [ property ] [ "values" ] << value unless value . nil?
200
- oar_properties [ property ] [ "values" ] . uniq!
201
- oar_properties [ property ] [ "values" ] . sort! { |a , b |
202
- ( a && a . to_s || "" ) <=> ( b && b . to_s || "" )
265
+ site_props . sort . to_h . each { |type , type_props |
266
+ type_props . sort . to_h . each { |node_uid , node_props |
267
+ node_props . sort . to_h . each { |property , value |
268
+ next if @@ignored_properties . include? ( property )
269
+
270
+ oar_properties [ property ] ||= { }
271
+ oar_properties [ property ] [ "values" ] ||= [ ]
272
+ oar_properties [ property ] [ "values" ] << value unless value . nil?
273
+ oar_properties [ property ] [ "values" ] . uniq!
274
+ oar_properties [ property ] [ "values" ] . sort! { |a , b |
275
+ ( a && a . to_s || "" ) <=> ( b && b . to_s || "" )
276
+ }
203
277
}
204
278
}
205
279
}
206
280
}
207
281
oar_properties . sort . to_h . each { |prop , prop_hash |
208
282
prop_hash [ "values" ] . sort!
209
283
if ( prop_hash [ "values" ] . length > 20 )
210
- #Limit possible values to 20 elements and mark the list as truncated
211
- prop_hash [ "values" ] . slice! ( 0 ...- 20 )
284
+ #Limit possible values to 20 random elements and mark the list as truncated
285
+ prop_hash [ "values" ] = prop_hash [ "values" ] . sample ( 20 ) . sort
212
286
prop_hash [ "values" ] . push ( "..." )
213
287
end
214
- @@properties [ prop ] [ "possible_values" ] ||= prop_hash [ "values" ] . join ( ", " )
288
+ @@properties [ prop ] [ "possible_values" ] ||= prop_hash [ "values" ] . join ( ", " ) unless @@properties [ prop ] . nil?
215
289
}
216
290
291
+ # Compare properties with fields from oar db
292
+ oar_data_properties . reject! { |x | ( @@properties . keys . include? x or @@ignored_properties . include? x ) }
293
+
217
294
@generated_content = "{{Portal|User}}\n Properties on resources managed by OAR allow users to select them according to their experiment's characteristics." + MW ::LINE_FEED
295
+ if not oar_data_properties . empty?
296
+ @generated_content += "{{Warning|text=Following properties are not documented : " + oar_data_properties . sort . join ( ', ' ) + "}}" + MW ::LINE_FEED
297
+ end
218
298
@generated_content += MW ::heading ( "OAR Properties" , 1 ) + MW ::LINE_FEED
219
299
220
300
@@categories . sort . to_h . each { |cat , cat_properties |
0 commit comments