Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
reference-repository
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
grid5000
reference-repository
Commits
28b07427
Commit
28b07427
authored
May 08, 2018
by
Lucas Nussbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache the parsing of all JSON files (to avoid parsing it several times per run)
=> huge performance improvement
parent
3ba0847e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
7 deletions
+19
-7
generators/wiki/cpu_parameters.rb
generators/wiki/cpu_parameters.rb
+1
-1
generators/wiki/disk_reservation.rb
generators/wiki/disk_reservation.rb
+1
-1
generators/wiki/hardware.rb
generators/wiki/hardware.rb
+1
-1
generators/wiki/mw_utils.rb
generators/wiki/mw_utils.rb
+10
-2
generators/wiki/oar_properties.rb
generators/wiki/oar_properties.rb
+1
-1
generators/wiki/site_hardware.rb
generators/wiki/site_hardware.rb
+1
-1
generators/wiki/wiki_generator.rb
generators/wiki/wiki_generator.rb
+4
-0
No files found.
generators/wiki/cpu_parameters.rb
View file @
28b07427
...
...
@@ -12,7 +12,7 @@ class CPUParametersGenerator < WikiGenerator
table_columns
=
[
"Installation date"
,
"Site"
,
"Cluster"
,
"CPU Family"
,
"CPU Version"
,
"Microarchitecture"
,
"Frequency"
,
"Server type"
,
"HT enabled"
,
"Turboboost enabled"
,
"P-State driver"
,
"C-State driver"
]
table_data
=
[]
global_hash
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))
global_hash
=
get_global_hash
# Loop over Grid'5000 sites
global_hash
[
"sites"
].
sort
.
to_h
.
each
{
|
site_uid
,
site_hash
|
...
...
generators/wiki/disk_reservation.rb
View file @
28b07427
...
...
@@ -12,7 +12,7 @@ class DiskReservationGenerator < WikiGenerator
def
generate_content
table_columns
=
[
"Site"
,
"Cluster"
,
"Number of nodes"
,
"Number of reservable disks per node"
]
table_data
=
[]
global_hash
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))
global_hash
=
get_global_hash
# Loop over Grid'5000 sites
global_hash
[
"sites"
].
sort
.
to_h
.
each
{
|
site_uid
,
site_hash
|
...
...
generators/wiki/hardware.rb
View file @
28b07427
...
...
@@ -12,7 +12,7 @@ class G5KHardwareGenerator < WikiGenerator
end
def
generate_content
@global_hash
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
'../../input/grid5000/'
,
File
.
dirname
(
__FILE__
)))
@global_hash
=
get_global_hash
@site_uids
=
G5K
::
SITES
@generated_content
=
"__NOEDITSECTION__
\n
"
...
...
generators/wiki/mw_utils.rb
View file @
28b07427
...
...
@@ -59,8 +59,6 @@ end
#Defines global Grid5000 helpers (TODO move to its own file once it is big enough)
module
G5K
SITES
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))[
'sites'
].
keys
.
sort
# This method compacts an array of integers as follows
# nodeset([2,3,4,7,9,10,12]) returns the string '[2-4,<wbr>7,<wbr>9-10,<wbr>12]'
# where <wbr> is a hidden tag that enables carriage return in wikimedia
...
...
@@ -108,6 +106,16 @@ module G5K
return
(
count
==
1
||
word
[
-
1
]
==
's'
)
?
word
:
word
+
's'
end
@@global_hash
=
nil
def
self
.
get_global_hash
if
@@global_hash
.
nil?
@@global_hash
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))
end
# return a deep copy of global_hash
return
Marshal
.
load
(
Marshal
.
dump
(
@@global_hash
))
end
SITES
=
get_global_hash
[
'sites'
].
keys
.
sort
end
#Defines MediaWiki helpers
...
...
generators/wiki/oar_properties.rb
View file @
28b07427
...
...
@@ -173,7 +173,7 @@ class OarPropertiesGenerator < WikiGenerator
end
def
generate_content
refapi
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))
refapi
=
get_global_hash
#Properties generated from oar-properties generator
props
=
{}
G5K
::
SITES
.
each
{
|
site_uid
|
...
...
generators/wiki/site_hardware.rb
View file @
28b07427
...
...
@@ -160,7 +160,7 @@ def sort_data(data, key)
end
def
get_hardware
(
sites
)
global_hash
=
load_yaml_file_hierarchy
(
File
.
expand_path
(
"../../input/grid5000/"
,
File
.
dirname
(
__FILE__
)))
global_hash
=
G5K
::
get_global_hash
# Loop over each cluster of the site
hardware
=
{}
...
...
generators/wiki/wiki_generator.rb
View file @
28b07427
...
...
@@ -11,6 +11,10 @@ class WikiGenerator
@page_name
=
page_name
end
def
get_global_hash
return
G5K
::
get_global_hash
end
def
login
(
options
)
if
(
options
[
:user
]
&&
options
[
:pwd
])
@mw_client
.
log_in
(
options
[
:user
],
options
[
:pwd
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment