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
Show more breadcrumbs
grid5000
reference-repository
Commits
66084c63
Commit
66084c63
authored
4 years ago
by
Alexandre MERLIN
Browse files
Options
Downloads
Patches
Plain Diff
Add group storage wiki generator
parent
069d716a
No related branches found
No related tags found
1 merge request
!150
Bug12247 group storage
Pipeline
#189606
passed
4 years ago
Stage: validate
Stage: generate
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/refrepo/gen/wiki.rb
+5
-0
5 additions, 0 deletions
lib/refrepo/gen/wiki.rb
lib/refrepo/gen/wiki/generators/group_storage.rb
+39
-0
39 additions, 0 deletions
lib/refrepo/gen/wiki/generators/group_storage.rb
with
44 additions
and
0 deletions
lib/refrepo/gen/wiki.rb
+
5
−
0
View file @
66084c63
...
...
@@ -7,6 +7,7 @@ require 'refrepo/gen/wiki/generators/oar_properties'
require
'refrepo/gen/wiki/generators/site_hardware'
require
'refrepo/gen/wiki/generators/site_network'
require
'refrepo/gen/wiki/generators/status'
require
'refrepo/gen/wiki/generators/group_storage'
module
RefRepo::Gen::Wiki
...
...
@@ -30,6 +31,10 @@ module RefRepo::Gen::Wiki
'oar_properties'
=>
{
:gen
=>
OarPropertiesGenerator
,
:page
=>
'OAR_Properties'
},
'group_storage'
=>
{
:gen
=>
GroupStorageGenerator
,
:page
=>
'Group_Storage'
}
}
SITE_GENERATORS
=
{
...
...
This diff is collapsed.
Click to expand it.
lib/refrepo/gen/wiki/generators/group_storage.rb
0 → 100644
+
39
−
0
View file @
66084c63
# coding: utf-8
class
GroupStorageGenerator
<
WikiGenerator
def
initialize
(
page_name
)
super
(
page_name
)
end
def
generate_content
table_columns
=
[
"Site"
,
"Server Name"
,
"Size"
,
"Link Speed"
,
"Notes"
]
table_data
=
[]
global_hash
=
get_global_hash
# Loop over Grid'5000 sites
global_hash
[
"sites"
].
sort
.
to_h
.
each
{
|
site_uid
,
site_hash
|
site_hash
.
fetch
(
"servers"
).
sort
.
to_h
.
each_value
{
|
server_hash
|
next
unless
server_hash
[
'group_storage'
]
group_storage
=
server_hash
[
'group_storage'
]
table_data
<<
[
"[[
#{
site_uid
.
capitalize
}
:Hardware|
#{
site_uid
.
capitalize
}
]]"
,
"
#{
group_storage
[
'name'
]
}
.
#{
site_uid
}
.grid5000.fr"
,
G5K
.
get_size
(
group_storage
[
'size'
],
'metric'
),
G5K
.
get_rate
(
group_storage
[
'rate'
]),
group_storage
[
"comment"
]
||
""
]
}
}
# Sort by site and server name
table_data
.
sort_by!
{
|
row
|
[
row
[
0
],
row
[
1
]]
}
# Table construction
table_options
=
'class="wikitable sortable" style="text-align: center;"'
@generated_content
=
MW
.
generate_table
(
table_options
,
table_columns
,
table_data
)
@generated_content
+=
MW
.
italic
(
MW
.
small
(
generated_date_string
))
@generated_content
+=
MW
::
LINE_FEED
end
end
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