Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit b51a9415 authored by Pierre Neyron's avatar Pierre Neyron 🚴
Browse files

Merge branch 'oar-properties-pyxis' into 'master'

Oar properties pyxis

See merge request !90
parents 27f6d19a eeb339d7
Pipeline #129129 passed with stages
in 3 minutes and 38 seconds
{
"architecture": {
"cpu_core_numbering": "contiguous",
"cpu_core_numbering": "contiguous-including-threads",
"nb_cores": 64,
"nb_procs": 2,
"nb_threads": 256,
......
{
"architecture": {
"cpu_core_numbering": "contiguous",
"cpu_core_numbering": "contiguous-including-threads",
"nb_cores": 64,
"nb_procs": 2,
"nb_threads": 256,
......
{
"architecture": {
"cpu_core_numbering": "contiguous",
"cpu_core_numbering": "contiguous-including-threads",
"nb_cores": 64,
"nb_procs": 2,
"nb_threads": 256,
......
{
"architecture": {
"cpu_core_numbering": "contiguous",
"cpu_core_numbering": "contiguous-including-threads",
"nb_cores": 64,
"nb_procs": 2,
"nb_threads": 256,
......
......@@ -2,7 +2,7 @@
---
pyxis-1:
architecture:
cpu_core_numbering: contiguous
cpu_core_numbering: contiguous-including-threads
nb_cores: 64
nb_procs: 2
nb_threads: 256
......
......@@ -2,7 +2,7 @@
---
pyxis-2:
architecture:
cpu_core_numbering: contiguous
cpu_core_numbering: contiguous-including-threads
nb_cores: 64
nb_procs: 2
nb_threads: 256
......
......@@ -2,7 +2,7 @@
---
pyxis-3:
architecture:
cpu_core_numbering: contiguous
cpu_core_numbering: contiguous-including-threads
nb_cores: 64
nb_procs: 2
nb_threads: 256
......
......@@ -2,7 +2,7 @@
---
pyxis-4:
architecture:
cpu_core_numbering: contiguous
cpu_core_numbering: contiguous-including-threads
nb_cores: 64
nb_procs: 2
nb_threads: 256
......
......@@ -1232,7 +1232,8 @@ def extract_clusters_description(clusters, site_name, options, data_hierarchy, s
cpu_count = first_node['architecture']['nb_procs']
core_count = first_node['architecture']['nb_cores'] / cpu_count
cpu_core_count = first_node['architecture']['nb_cores'] / cpu_count
cpu_thread_count = first_node['architecture']['nb_threads'] / cpu_count
gpu_count = first_node.key?("gpu_devices") ? first_node["gpu_devices"].length : 0
cpu_model = "#{first_node['processor']['model']} #{first_node['processor']['version']}"
......@@ -1251,17 +1252,17 @@ def extract_clusters_description(clusters, site_name, options, data_hierarchy, s
phys_rsc_map = {
"cpu" => {
:current_ids => [],
:per_server_count => first_node['architecture']['nb_procs'],
:per_server_count => cpu_count,
:per_cluster_count => node_count * cpu_count
},
"core" => {
:current_ids => [],
:per_server_count => first_node['architecture']['nb_cores'] / cpu_count,
:per_cluster_count => node_count * cpu_count * core_count
:per_server_count => cpu_core_count,
:per_cluster_count => node_count * cpu_count * cpu_core_count
},
"gpu" => {
:current_ids => [],
:per_server_count => first_node.key?("gpu_devices") ? first_node["gpu_devices"].length : 0,
:per_server_count => gpu_count,
:per_cluster_count => node_count * gpu_count
},
}
......@@ -1346,13 +1347,13 @@ def extract_clusters_description(clusters, site_name, options, data_hierarchy, s
############################################
# Suite of (2-a): Iterate over CPUs of the server. (rest: cores)
############################################
(0...phys_rsc_map["cpu"][:per_server_count]).each do |cpu_num|
(0...cpu_count).each do |cpu_num|
############################################
# Suite of (2-a): Iterate over CORES of the CPU
############################################
(0...phys_rsc_map["core"][:per_server_count]).each do |core_num|
(0...cpu_core_count).each do |core_num|
# Compute cpu and core ID
oar_resource_id = oar_resource_ids[core_idx]
......@@ -1387,9 +1388,11 @@ def extract_clusters_description(clusters, site_name, options, data_hierarchy, s
# (2-d) Associate a cpuset to each core
############################################
if core_numbering == 'contiguous'
row[:cpuset] = cpu_num * phys_rsc_map["core"][:per_server_count] + core_num
row[:cpuset] = cpu_num * cpu_core_count + core_num
elsif core_numbering == 'contiguous-including-threads'
row[:cpuset] = cpu_num * cpu_thread_count + core_num
elsif core_numbering == 'round-robin'
row[:cpuset] = cpu_num + core_num * phys_rsc_map["cpu"][:per_server_count]
row[:cpuset] = cpu_num + core_num * cpu_count
else
raise
end
......@@ -1412,13 +1415,13 @@ def extract_clusters_description(clusters, site_name, options, data_hierarchy, s
raise "Could not find a GPU on CPU #{cpu_num} for core #{row[:cpuset]}"
end
else
gpu_idx = core_num / (phys_rsc_map["core"][:per_server_count] / numa_gpus.length)
gpu_idx = core_num / (cpu_core_count / numa_gpus.length)
selected_gpu = numa_gpus[gpu_idx]
end
# id of the selected GPU in the node
local_id = node_description["gpu_devices"].values.index(selected_gpu)
row[:gpu] = phys_rsc_map["gpu"][:current_ids][node_index0 * phys_rsc_map["gpu"][:per_server_count] + local_id]
row[:gpu] = phys_rsc_map["gpu"][:current_ids][node_index0 * gpu_count + local_id]
row[:gpudevice] = local_id
row[:gpudevicepath] = selected_gpu['device']
row[:gpumodel] = selected_gpu['model']
......
......@@ -702,6 +702,150 @@ oarnodesetting --sql "host='clustera-2.fakesite.grid5000.fr' and type='default'"
end
end
context 'interracting with an empty OAR server (contiguous_including_threads cpusets)' do
before do
prepare_stubs("dump_oar_api_empty_server.json", "load_data_hierarchy_stubbed_data_contiguous-including-threads_cpusets.json")
end
it 'should generate correctly a table of nodes' do
uri = URI(conf["uri"])
response = Net::HTTP.get(uri)
expect(response).to be_an_instance_of(String)
options = {
:table => true,
:print => false,
:update => false,
:diff => false,
:site => "fakesite",
:clusters => ["clustera"]
}
expected_header = <<-TXT
+---------- + -------------------- + ----- + ----- + -------- + ---- + -------------------- + ------------------------------ + ------------------------------+
| cluster | host | cpu | core | cpuset | gpu | gpudevice | cpumodel | gpumodel |
+---------- + -------------------- + ----- + ----- + -------- + ---- + -------------------- + ------------------------------ + ------------------------------+
TXT
expected_clustera1_begin_desc = <<-TXT
| clustera | clustera-1 | 1 | 1 | 0 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 2 | 1 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 3 | 2 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 4 | 3 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 5 | 4 | | | ThunderX2 99xx | |
TXT
expected_clustera1_middle_desc = <<-TXT
| clustera | clustera-1 | 1 | 29 | 28 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 30 | 29 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 31 | 30 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 1 | 32 | 31 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 2 | 33 | 128 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 2 | 34 | 129 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 2 | 35 | 130 | | | ThunderX2 99xx | |
| clustera | clustera-1 | 2 | 36 | 131 | | | ThunderX2 99xx | |
TXT
expected_clustera2_middle_desc = <<-TXT
| clustera | clustera-2 | 3 | 93 | 28 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 3 | 94 | 29 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 3 | 95 | 30 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 3 | 96 | 31 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 97 | 128 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 98 | 129 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 99 | 130 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 100 | 131 | | | ThunderX2 99xx | |
TXT
expected_clustera2_end_desc = <<-TXT
| clustera | clustera-2 | 4 | 125 | 156 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 126 | 157 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 127 | 158 | | | ThunderX2 99xx | |
| clustera | clustera-2 | 4 | 128 | 159 | | | ThunderX2 99xx | |
+---------- + -------------------- + ----- + ----- + -------- + ---- + -------------------- + ------------------------------ + ------------------------------+
TXT
generator_output = capture do
generate_oar_properties(options)
end
expect(generator_output[:stdout]).to include(expected_header)
expect(generator_output[:stdout]).to include(expected_clustera1_begin_desc)
expect(generator_output[:stdout]).to include(expected_clustera1_middle_desc)
expect(generator_output[:stdout]).to include(expected_clustera2_middle_desc)
expect(generator_output[:stdout]).to include(expected_clustera2_end_desc)
end
it 'should generate correctly all the commands to update OAR' do
uri = URI(conf["uri"])
response = Net::HTTP.get(uri)
expect(response).to be_an_instance_of(String)
options = {
:table => false,
:print => true,
:update => false,
:diff => false,
:site => "fakesite",
:clusters => ["clustera"]
}
expected_header = <<-TXT
#############################################
# Create OAR properties that were created by 'oar_resources_add'
#############################################
property_exist 'host' || oarproperty -a host --varchar
property_exist 'cpu' || oarproperty -a cpu
property_exist 'core' || oarproperty -a core
property_exist 'gpudevice' || oarproperty -a gpudevice
property_exist 'gpu' || oarproperty -a gpu
property_exist 'gpu_model' || oarproperty -a gpu_model --varchar
TXT
expected_clustera1_cmds = <<-TXT
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=1 -p core=29 -p cpuset=28
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=1 -p core=30 -p cpuset=29
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=1 -p core=31 -p cpuset=30
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=1 -p core=32 -p cpuset=31
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=2 -p core=33 -p cpuset=128
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=2 -p core=34 -p cpuset=129
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=2 -p core=35 -p cpuset=130
oarnodesetting -a -h 'clustera-1.fakesite.grid5000.fr' -p host='clustera-1.fakesite.grid5000.fr' -p cpu=2 -p core=36 -p cpuset=131
TXT
expected_clustera2_cmds = <<-TXT
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=3 -p core=93 -p cpuset=28
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=3 -p core=94 -p cpuset=29
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=3 -p core=95 -p cpuset=30
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=3 -p core=96 -p cpuset=31
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=4 -p core=97 -p cpuset=128
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=4 -p core=98 -p cpuset=129
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=4 -p core=99 -p cpuset=130
oarnodesetting -a -h 'clustera-2.fakesite.grid5000.fr' -p host='clustera-2.fakesite.grid5000.fr' -p cpu=4 -p core=100 -p cpuset=131
TXT
expected_clustera3_cmds = <<-TXT
oarnodesetting --sql "host='clustera-2.fakesite.grid5000.fr' and type='default'" -p ip='172.16.54.2' -p cluster='clustera' -p nodemodel='Dell PowerEdge T640' -p switch='gw' -p besteffort='YES' -p deploy='YES' -p virtual='arm64' -p cpuarch='aarch64' -p cpucore=32 -p cputype='ThunderX2 99xx' -p cpufreq='2.2' -p disktype='SAS' -p eth_count=1 -p eth_rate=10 -p ib_count=0 -p ib_rate=0 -p ib='NO' -p opa_count=0 -p opa_rate=0 -p myri_count=0 -p myri_rate=0 -p myri='NO' -p memcore=4096 -p memcpu=131072 -p memnode=262144 -p gpu_count=0 -p mic='NO' -p wattmeter='NO' -p cluster_priority=201906 -p max_walltime=0 -p production='NO' -p maintenance='YES' -p disk_reservation_count=0
TXT
generator_output = capture do
generate_oar_properties(options)
end
expect(generator_output[:stdout]).to include(expected_header)
expect(generator_output[:stdout]).to include(expected_clustera1_cmds)
expect(generator_output[:stdout]).to include(expected_clustera2_cmds)
expect(generator_output[:stdout]).to include(expected_clustera3_cmds)
end
end
context 'interracting with an empty OAR server (cluster with disk)' do
before do
prepare_stubs("dump_oar_api_empty_server.json", "load_data_hierarchy_stubbed_data_with_disk.json")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment