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.4.
Show more breadcrumbs
grid5000
reference-repository
Commits
b68b7aff
Commit
b68b7aff
authored
9 years ago
by
Jérémie Gaidamour
Browse files
Options
Downloads
Patches
Plain Diff
[dev] Added an option for ssh keys
parent
4d519e3d
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
generators/oar-properties/lib/lib-oar-properties.rb
+2
-2
2 additions, 2 deletions
generators/oar-properties/lib/lib-oar-properties.rb
generators/oar-properties/oar-properties.rb
+7
-2
7 additions, 2 deletions
generators/oar-properties/oar-properties.rb
with
9 additions
and
4 deletions
generators/oar-properties/lib/lib-oar-properties.rb
+
2
−
2
View file @
b68b7aff
...
...
@@ -196,7 +196,7 @@ end
# Get the OAR properties from the OAR scheduler
# This is only needed for the -d option
def
oarcmd_get_nodelist_properties
(
site_uid
,
filename
=
nil
)
def
oarcmd_get_nodelist_properties
(
site_uid
,
filename
=
nil
,
sshkeys
=
[]
)
oarnodes_yaml
=
""
if
filename
and
File
.
exist?
(
filename
)
...
...
@@ -207,7 +207,7 @@ def oarcmd_get_nodelist_properties(site_uid, filename=nil)
# Download the oar properties from the oar server
puts
"Downloading 'oarnodes -Y' from oar.
#{
site_uid
}
.g5kadmin ..."
Net
::
SSH
.
start
(
"oar.
#{
site_uid
}
.g5kadmin"
,
'g5kadmin'
,
:keys
=>
[
'~/.ssh/id_rsa_g5kadmin.pub'
]
)
{
|
ssh
|
Net
::
SSH
.
start
(
"oar.
#{
site_uid
}
.g5kadmin"
,
'g5kadmin'
,
:keys
=>
sshkeys
)
{
|
ssh
|
# capture all stderr and stdout output from a remote process
oarnodes_yaml
=
ssh
.
exec!
(
'oarnodes -Y'
)
}
...
...
This diff is collapsed.
Click to expand it.
generators/oar-properties/oar-properties.rb
+
7
−
2
View file @
b68b7aff
...
...
@@ -19,6 +19,7 @@ require '../lib/input_loader'
options
=
{}
options
[
:sites
]
=
%w{grenoble lille luxembourg lyon nancy nantes reims rennes sophia}
options
[
:diff
]
=
false
options
[
:sshkeys
]
=
[]
OptionParser
.
new
do
|
opts
|
opts
.
banner
=
"Usage: oar-properties.rb [options]"
...
...
@@ -57,6 +58,10 @@ OptionParser.new do |opts|
opts
.
on
(
'-e'
,
'--exec'
,
'Directly apply the changes to the OAR server'
)
do
|
e
|
options
[
:exec
]
=
e
end
opts
.
on
(
'-k'
,
'--ssh-keys k1,k2,k3'
,
Array
,
'SSH keys'
)
do
|
k
|
options
[
:sshkeys
]
=
k
end
opts
.
on
(
"-d"
,
"--diff [YAML filename]"
,
"Only generates the minimal list of commands needed to update the site configuration"
,
...
...
@@ -112,7 +117,7 @@ options[:sites].each { |site_uid|
# This is only needed for the -d option
if
options
[
:diff
]
filename
=
options
[
:diff
].
is_a?
(
String
)
?
options
[
:diff
].
gsub
(
"%s"
,
site_uid
)
:
nil
nodelist_properties
[
"oar"
][
site_uid
]
=
oarcmd_get_nodelist_properties
(
site_uid
,
filename
)
nodelist_properties
[
"oar"
][
site_uid
]
=
oarcmd_get_nodelist_properties
(
site_uid
,
filename
,
options
[
:sshkeys
]
)
end
}
...
...
@@ -191,7 +196,7 @@ if options[:exec]
nodelist_properties
[
opt
].
each
{
|
site_uid
,
site_properties
|
puts
"Connecting
#{
site_uid
}
..."
Net
::
SSH
.
start
(
"oar.
#{
site_uid
}
.g5kadmin"
,
'g5kadmin'
,
:keys
=>
[
'~/.ssh/id_rsa_g5kadmin.pub'
])
{
|
ssh
|
Net
::
SSH
.
start
(
"oar.
#{
site_uid
}
.g5kadmin"
,
'g5kadmin'
,
:keys
=>
options
[
:sshkeys
])
{
|
ssh
|
site_properties
.
each_filtered_node_uid
(
options
[
:clusters
],
options
[
:nodes
])
{
|
node_uid
,
node_properties
|
cmd
=
oarcmd_set_node_properties
(
node_uid
,
node_properties
)
...
...
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