...
 
Commits (42)
......@@ -7,3 +7,4 @@ bundle
.bundle
vendor
/tmp
coverage
......@@ -20,7 +20,7 @@ validate-data:
script:
- apt-get update && apt-get -y install ruby ruby-dev build-essential rake wget
- gem install bundler -v 1.17.3
- bundle install
- bundle install --without development
# Add G5K CA certificate
- wget --no-check-certificate -q https://www.grid5000.fr/certs/ca2019.grid5000.fr.crt -O /usr/local/share/ca-certificates/ca2019.grid5000.fr.crt
- /usr/sbin/update-ca-certificates
......@@ -35,7 +35,7 @@ generate-reference-api:
script:
- apt-get update && apt-get -y install ruby ruby-dev build-essential rake git
- gem install bundler -v 1.17.3
- bundle install
- bundle install --without development
- export TZ=Europe/Paris
- rake reference-api
- git status
......
......@@ -9,3 +9,8 @@ gem "dns-zone"
gem "ruby-cute", :require => "cute"
gem "peach"
gem "restfully"
gem "rspec", :group => [:development]
gem "webmock", :group => [:development]
gem "simplecov", :group => [:development]
gem "mutant-rspec", :group => [:development]
gem "code-explorer", :group => [:development]
GEM
remote: https://rubygems.org/
specs:
abstract_method (1.2.1)
abstract_type (0.0.7)
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
anima (0.3.1)
abstract_type (~> 0.0.7)
adamantium (~> 0.2)
equalizer (~> 0.0.11)
ast (2.4.0)
backports (3.15.0)
bond (0.4.3)
cheetah (0.5.0)
abstract_method (~> 1.2)
code-explorer (0.3.0)
cheetah (~> 0)
coderay (~> 1)
parser (~> 2.0)
sinatra (~> 1)
coderay (1.1.2)
concord (0.1.5)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.3)
diffy (3.3.0)
dns-zone (0.3.1)
docile (1.3.2)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
equalizer (0.0.11)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
......@@ -20,14 +46,44 @@ GEM
hashdiff (1.0.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
ice_nine (0.11.2)
ipaddress (0.8.3)
json (1.8.6)
mediawiki_api (0.7.1)
faraday (~> 0.9, >= 0.9.0)
faraday-cookie_jar (~> 0.0, >= 0.0.6)
faraday_middleware (~> 0.10, >= 0.10.0)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
mime-types (2.99.3)
morpher (0.2.6)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.0)
ast (~> 2.2)
concord (~> 0.1.5)
equalizer (~> 0.0.9)
ice_nine (~> 0.11.0)
procto (~> 0.0.2)
multipart-post (2.1.1)
mutant (0.8.24)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.0)
ast (~> 2.2)
concord (~> 0.1.5)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
ice_nine (~> 0.11.1)
memoizable (~> 0.4.2)
morpher (~> 0.2.6)
parser (~> 2.5.1)
procto (~> 0.0.2)
regexp_parser (~> 1.2)
unparser (~> 0.4.2)
mutant-rspec (0.8.24)
mutant (~> 0.8.24)
rspec-core (>= 3.4.0, < 4.0.0)
net-ssh (4.2.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
......@@ -35,12 +91,18 @@ GEM
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
netrc (0.11.0)
parser (2.5.3.0)
ast (~> 2.4.0)
peach (0.5.1)
procto (0.0.3)
public_suffix (3.1.1)
rack (1.6.4)
rack-cache (1.9.0)
rack (>= 0.4)
rack-protection (1.5.5)
rack
rb-readline (0.5.5)
regexp_parser (1.6.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
......@@ -71,25 +133,67 @@ GEM
ripl (>= 0.3.0)
ripl-short_errors (0.1.0)
ripl (>= 0.2.8)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
ruby-cute (0.12)
ipaddress (>= 0.8)
json (>= 1.8)
net-ssh-multi (>= 1.2)
rest-client (>= 1.6)
safe_yaml (1.0.5)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
thread_safe (0.3.6)
tilt (2.0.10)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unparser (0.4.2)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
concord (~> 0.1.5)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
parser (>= 2.3.1.2, < 2.6)
procto (~> 0.0.2)
webmock (3.7.5)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
PLATFORMS
ruby
DEPENDENCIES
code-explorer
diffy
dns-zone
hash_validator
hashdiff
mediawiki_api
mutant-rspec
net-ssh
peach
restfully
rspec
ruby-cute
simplecov
webmock
......@@ -41,3 +41,12 @@ all tools that require to authenticate against Grid'5000 use credentials from ~/
password: password
version: stable
```
# Some development information
* Run rspec tests: `bundler exec rspec`
+ This generates coverage information in the coverage/ directory
* Explore the code using code-explorer: `bundle exec code-explorer`
* Run mutation testing:
+ A specific method: `bundler exec mutant --include lib --require refrepo --use rspec 'OarProperties#get_oar_properties_from_oar'`
+ The whole OAR properties generator (takes a long time): `bundler exec mutant --include lib --require refrepo --use rspec 'OarProperties'`
......@@ -127,29 +127,67 @@ namespace :gen do
exit(ret)
end
desc "Generate OAR properties -- parameters: [SITE={grenoble,...}] [CLUSTER={yeti,...}] [NODE={dahu-1,...}] DO={diff,print,update} [VERBOSE={0,1,2,3}]"
desc "Generate OAR properties -- parameters: SITE=grenoble CLUSTER={yeti,...} DO={print,table,update,diff} [VERBOSE={0,1,2,3}] [OAR_SERVER=192.168.37.10] [OAR_SERVER_USER=g5kadmin]"
task "oar-properties" do
# Manage oar-properties for a given set of Grid'5000 cluster. The task takes the following parameters
# Params:
# +SITE+:: Grid'5000 site (Nantes, Nancy, ...).
# +CLUSTERS+:: a comma separated list of Grid'5000 clusters (econome, ecotype, ...). This argument is optional:
# if no clusters is provided, the script will be run on each cluster of the specified site.
# +Do+:: specify the action to execute:
# - print: computes a mapping (server, cpu, core, gpu) for the given clusters, and shows OAR shell commands
# that would be run on an OAR server to converge to this mapping. This action try to reuse existing OAR
# resource's IDs, by fetching the current state of the OAR database via the OAR REST API (see the
# OAR_API_SERVER and OAR_API_PORT arguments).
# - table: show an ASCII table that illustrates the mapping (server, cpu, core, gpu) computed via action
# "print"
# - update: apply the commands of computed with the "print" task, to a given OAR server (see the OAR_SERVER
# and OAR_SERVER_USER arguments).
# - diff: Compare the mapping (server, cpu, core, gpu) computed with action "print", with the existing mapping
# fetched from the OAR REST API (see the OAR_API_SERVER, OAR_API_PORT).
# +OAR_SERVER+:: IP address fo the OAR server that will serve as a target of the generator. The generator will
# connect via SSH to this server. By default, it targets the OAR server of the Grid'5000 site.
# +OAR_SERVER_USER+:: SSH user that may be used to connect to the OAR server. By default, it targets the OAR server of the Grid'5000 site.
# +OAR_API_SERVER+:: IP address fo the server that hosts the OAR API. The generator will use it to understand the
# existing (server, cpu, core, gpu) mapping.
# +OAR_API_PORT+:: HTTP port used to connect to the REST API
require 'refrepo/gen/oar-properties'
options = {}
options[:sites] = ( ENV['SITE'] ? ENV['SITE'].split(',') : G5K_SITES )
if ENV['CLUSTER']
options[:clusters] = ENV['CLUSTER'].split(',')
end
if ENV['NODE']
options[:nodes] = ENV['NODE'].split(',')
if ENV['SITE']
options[:site] = ENV['SITE']
else
puts "You must specify a site."
exit(1)
end
if not G5K_SITES.include?(options[:site])
puts "Invalid site: #{options[:site]}"
exit(1)
end
if ENV['OAR_SERVER']
options[:ssh] ||= {}
options[:ssh][:host] = ENV['OAR_SERVER']
end
options[:diff] = false
if ENV['OAR_SERVER_USER']
options[:ssh] ||= {}
options[:ssh][:user] = ENV['OAR_SERVER_USER']
end
options[:print] = false
options[:diff] = false
options[:update] = false
options[:table] = false
if ENV['DO']
ENV['DO'].split(',').each do |t|
options[:diff] = true if t == 'diff'
options[:table] = true if t == 'table'
options[:print] = true if t == 'print'
options[:update] = true if t == 'update'
options[:diff] = true if t == 'diff'
end
else
puts "You must specify something to do using DO="
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......
{
"architecture": {
"cpu_core_numbering": "round-robin",
"nb_cores": 32,
"nb_procs": 2,
"nb_threads": 64,
......