Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
grid5000
reference-repository
Commits
a4aa91e5
Commit
a4aa91e5
authored
5 years ago
by
Pierre Neyron
Browse files
Options
Downloads
Patches
Plain Diff
[gen/wiki/oar] get disk resources possible values automatically
parent
515680f0
Branches
Branches containing commit
No related tags found
1 merge request
!100
Update the OAR-Properties wiki page
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/refrepo/gen/wiki/generators/oar_properties.rb
+15
-27
15 additions, 27 deletions
lib/refrepo/gen/wiki/generators/oar_properties.rb
with
15 additions
and
27 deletions
lib/refrepo/gen/wiki/generators/oar_properties.rb
+
15
−
27
View file @
a4aa91e5
...
...
@@ -52,11 +52,9 @@ class OarPropertiesGenerator < WikiGenerator
},
"disk"
=>
{
"description"
=>
"Id of a reservable disk on a node, for resources of type 'disk'."
,
"possible_values"
=>
"sdb.yeti-1, sdc.yeti-1, sdd.yeti-1, ..."
},
"diskpath"
=>
{
"description"
=>
"Device path of a reservable disk on a node, for resources of type 'disk'."
,
"possible_values"
=>
"/dev/disk/by-path/pci-0000:18:00.0-scsi-0:0:1:0, /dev/disk/by-path/pci-0000:18:00.0-scsi-0:0:2:0, /dev/disk/by-path/pci-0000:18:00.0-scsi-0:0:3:0..."
},
"gpu"
=>
{
"description"
=>
"The ID of the GPU the resource is part of. The unique scope is the OAR server. "
,
...
...
@@ -202,20 +200,6 @@ class OarPropertiesGenerator < WikiGenerator
#Existing properties that won't be documented
@@ignored_properties
=
[
"maintenance"
,
"state"
,
"ip_virtual"
]
def
get_nodes_properties
(
_site_uid
,
site
)
properties
=
{}
site
[
'clusters'
].
sort
.
to_h
.
each
do
|
cluster_uid
,
cluster
|
cluster
[
'nodes'
].
sort
.
to_h
.
each
do
|
node_uid
,
node
|
begin
properties
[
node_uid
]
=
get_ref_node_properties_internal
(
cluster_uid
,
cluster
,
node_uid
,
node
)
rescue
MissingProperty
=>
e
puts
"Error while processing node
#{
node_uid
}
:
#{
e
}
"
end
end
end
return
properties
end
def
get_value_type
(
prop
,
values
)
if
(
@@properties
[
prop
][
"value_type"
])
return
@@properties
[
prop
][
"value_type"
]
...
...
@@ -236,22 +220,26 @@ class OarPropertiesGenerator < WikiGenerator
#Properties generated from oar-properties generator
props
=
{}
G5K
::
SITES
.
each
{
|
site_uid
|
props
[
site_uid
]
=
get_nodes_properties
(
site_uid
,
refapi
[
"sites"
][
site_uid
])
props
[
site_uid
]
=
{}
props
[
site_uid
][
"default"
]
=
get_ref_default_properties
(
site_uid
,
refapi
[
"sites"
][
site_uid
])
props
[
site_uid
][
"disk"
]
=
get_ref_disk_properties
(
site_uid
,
refapi
[
"sites"
][
site_uid
])
}
#Compiled properties used to generate page
oar_properties
=
{}
props
.
sort
.
to_h
.
each
{
|
site
,
site_props
|
site_props
.
sort
.
to_h
.
each
{
|
node_uid
,
node_props
|
node_props
.
sort
.
to_h
.
each
{
|
property
,
value
|
next
if
@@ignored_properties
.
include?
(
property
)
site_props
.
sort
.
to_h
.
each
{
|
type
,
type_props
|
type_props
.
sort
.
to_h
.
each
{
|
node_uid
,
node_props
|
node_props
.
sort
.
to_h
.
each
{
|
property
,
value
|
next
if
@@ignored_properties
.
include?
(
property
)
oar_properties
[
property
]
||=
{}
oar_properties
[
property
][
"values"
]
||=
[]
oar_properties
[
property
][
"values"
]
<<
value
unless
value
.
nil?
oar_properties
[
property
][
"values"
].
uniq!
oar_properties
[
property
][
"values"
].
sort!
{
|
a
,
b
|
(
a
&&
a
.
to_s
||
""
)
<=>
(
b
&&
b
.
to_s
||
""
)
oar_properties
[
property
]
||=
{}
oar_properties
[
property
][
"values"
]
||=
[]
oar_properties
[
property
][
"values"
]
<<
value
unless
value
.
nil?
oar_properties
[
property
][
"values"
].
uniq!
oar_properties
[
property
][
"values"
].
sort!
{
|
a
,
b
|
(
a
&&
a
.
to_s
||
""
)
<=>
(
b
&&
b
.
to_s
||
""
)
}
}
}
}
...
...
@@ -263,7 +251,7 @@ class OarPropertiesGenerator < WikiGenerator
prop_hash
[
"values"
].
slice!
(
0
...-
20
)
prop_hash
[
"values"
].
push
(
"..."
)
end
@@properties
[
prop
][
"possible_values"
]
||=
prop_hash
[
"values"
].
join
(
", "
)
@@properties
[
prop
][
"possible_values"
]
||=
prop_hash
[
"values"
].
join
(
", "
)
unless
@@properties
[
prop
].
nil?
}
@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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment