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
daef80e1
Commit
daef80e1
authored
9 years ago
by
PARISOT Clement
Browse files
Options
Downloads
Patches
Plain Diff
[rake] Update oar:generate for OAR 2.5.4 compatibility
parent
ced2c7e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Rakefile
+28
-17
28 additions, 17 deletions
Rakefile
generators/lib/grid5000/node.rb
+3
-3
3 additions, 3 deletions
generators/lib/grid5000/node.rb
with
31 additions
and
20 deletions
Rakefile
+
28
−
17
View file @
daef80e1
...
...
@@ -54,7 +54,8 @@ namespace :g5k do
command
=
File
.
join
(
ROOT_DIR
,
"generators"
,
"grid5000"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"
#{
site
}
.rb"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"clusters"
,
"
#{
host
}
.rb"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"clusters"
,
"
#{
host
}
.yaml"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"clusters"
,
"
#{
host
}
_generated.yaml"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"clusters"
,
"
#{
host
}
_manual.yaml"
)
command
+=
" "
+
File
.
join
(
root_dir_input
,
site
,
"pdus.rb"
)
command
<<
" -s"
if
ENV
[
'DRY'
]
==
"yes"
...
...
@@ -153,7 +154,7 @@ namespace :oar do
next
end
command
=
"
oaradmin resources
"
command
=
""
case
action
when
"A"
,
"C"
,
"M"
...
...
@@ -168,28 +169,39 @@ namespace :oar do
next
end
if
action
==
"M"
# modification of a file
command
.
concat
(
" -s node=
#{
host
}
"
)
command
.
concat
(
"oarnodesetting -h
#{
host
}
"
)
command
.
concat
(
" -p "
).
concat
(
export
.
to_a
.
map
{
|
(
k
,
v
)
|
if
v
.
nil?
nil
else
"
#{
k
}
=
#{
v
.
inspect
.
gsub
(
"'"
,
"
\\
'"
).
gsub
(
"
\"
"
,
"'"
)
}
"
end
}.
compact
.
join
(
" -p "
)
)
else
# new file
command
.
concat
(
" -a /node=
#{
host
}
/cpu={
#{
node
.
properties
[
'architecture'
][
'smp_size'
]
}
}/core={
#{
export
[
'cpucore'
]
}
}"
)
command
.
concat
(
" --auto-offset"
)
node_number
=
node_uid
.
split
(
"-"
)[
1
]
command
.
concat
(
"oar_resources_add -H 1 --host0
#{
node_number
}
--host-prefix
#{
cluster_uid
}
- --host-suffix .
#{
site_uid
}
.
#{
grid_uid
}
.fr -C
#{
node
.
properties
[
'architecture'
][
'smp_size'
]
}
-c
#{
export
[
'cpucore'
]
}
"
)
command
.
concat
(
" -a"
)
# Add other properties
command
.
concat
(
' -A "'
)
if
ENV
[
'MAINTENANCE'
]
&&
ENV
[
'MAINTENANCE'
]
==
'NO'
command
.
concat
(
' -p maintenance=
"NO"
'
)
command
.
concat
(
' -p maintenance=
\'NO\'
'
)
else
# by default, maintenance is YES when creating new resources
command
.
concat
(
' -p maintenance=
"
YES
"
'
)
command
.
concat
(
' -p maintenance=
\'
YES
\'
'
)
end
# by default, an Alive node has comment "OK"
command
.
concat
(
' -p comment="OK"'
)
command
.
concat
(
' -p comment=\'OK\''
)
command
.
concat
(
" -p "
).
concat
(
export
.
to_a
.
map
{
|
(
k
,
v
)
|
if
v
.
nil?
nil
else
"
#{
k
}
=
#{
v
.
inspect
.
gsub
(
"'"
,
"
\\
'"
).
gsub
(
"
\"
"
,
"'"
)
}
"
end
}.
compact
.
join
(
" -p "
)
)
command
.
concat
(
'"'
)
end
command
.
concat
(
" -p "
).
concat
(
export
.
to_a
.
map
{
|
(
k
,
v
)
|
if
v
.
nil?
nil
else
[
k
,
v
.
inspect
].
join
(
"="
)
end
}.
compact
.
join
(
" -p "
)
)
when
"D"
# deletion of a file
command
.
concat
(
"
-d node=
#{
host
}
"
)
command
.
concat
(
"
oarnodesetting -s Dead -h
#{
host
}
"
)
else
@logger
.
warn
"Don't know what to do with
#{
line
.
inspect
}
. Ignoring."
next
...
...
@@ -264,4 +276,3 @@ namespace :weathermap do
Rake
::
Task
[
'weathermap:execute'
].
invoke
end
end
This diff is collapsed.
Click to expand it.
generators/lib/grid5000/node.rb
+
3
−
3
View file @
daef80e1
...
...
@@ -21,14 +21,14 @@ module Grid5000
h
[
'cluster'
]
=
cluster
.
properties
[
'uid'
]
h
[
'nodemodel'
]
=
cluster
.
properties
[
'model'
]
h
[
'switch'
]
=
main_network_adapter
[
'switch'
]
#
h['besteffort'] = properties['supported_job_types']['besteffort'] ? "YES" : "NO"
#
h['deploy'] = properties['supported_job_types']['deploy'] ? "YES" : "NO"
h
[
'besteffort'
]
=
properties
[
'supported_job_types'
][
'besteffort'
]
?
"YES"
:
"NO"
h
[
'deploy'
]
=
properties
[
'supported_job_types'
][
'deploy'
]
?
"YES"
:
"NO"
h
[
'ip_virtual'
]
=
properties
[
'supported_job_types'
][
'virtual'
]
?
"YES"
:
"NO"
h
[
'virtual'
]
=
properties
[
'supported_job_types'
][
'virtual'
]
h
[
'cpuarch'
]
=
properties
[
'architecture'
][
'platform_type'
]
h
[
'cpucore'
]
=
properties
[
'architecture'
][
'smt_size'
]
/
properties
[
'architecture'
][
'smp_size'
]
h
[
'cputype'
]
=
[
properties
[
'processor'
][
'model'
],
properties
[
'processor'
][
'version'
]].
join
(
" "
)
h
[
'cpufreq'
]
=
properties
[
'processor'
][
'clock_speed'
]
/
1_000_000_000
h
[
'cpufreq'
]
=
properties
[
'processor'
][
'clock_speed'
]
/
1_000_000_000
.0
h
[
'disktype'
]
=
(
properties
[
'storage_devices'
].
first
||
{})[
'interface'
]
h
[
'ethnb'
]
=
properties
[
"network_adapters"
].
select
{
|
na
|
na
[
'interface'
]
=~
/ethernet/i
}.
select
{
|
nb
|
nb
[
'mountable'
]
==
true
}.
length
ib10g
=
properties
[
'network_adapters'
].
detect
{
|
na
|
na
[
'interface'
]
=~
/infiniband/i
&&
na
[
'rate'
]
==
10_000_000_000
}
...
...
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