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.

orsay.rb 6.98 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
def node_switch(clusters,switch,node)
  cluster,uids,iface = node.split("-")
  clusters[cluster] = [] unless  clusters.has_key? cluster
  min,max = uids.split(",").map{|s| s.to_i}
  nodes = clusters[cluster]
  min.upto(max) {|id|
    nodes[id] = {} if nodes[id].nil?
    ifaces = nodes[id]
    fail "nodes #{cluster}-#{id} already has switch for iface '#{iface}' : #{ifaces.inspect} " unless ifaces[iface].nil?
    ifaces[iface] = switch
  }
end
def cluster_node_switch(clusters,switch)
  switch.each{|sw,v0|
#    puts "sw = #{sw} ; v0 = #{v0}"
    if v0.has_key? "nodes"
      if v0["nodes"].is_a? String
        node_switch clusters, sw, v0["nodes"]
      elsif v0["nodes"].is_a? Array
        v0["nodes"].each{|node| node_switch clusters,sw,node} 
      else
        fail "Nodes must be String or Array."
      end
    end
    if v0.has_key? "next"
      v0["next"].each{|sw| cluster_node_switch clusters,sw}
    end
  }
end

def update_switch(switches,iface,sw_name)
  unless switches.has_key? iface and switches[iface]["name"] == sw_name
33 34
    sw = lookup('orsay-switches',sw_name) 
    fail "Switch '#{sw_name}' not found in 'orsay-switches'" if sw.nil?
35 36 37 38 39 40 41 42 43 44 45 46
    if sw["rate-in"].nil? 
      fail "Switch '#{sw_name}' input rate must be defined : 'rate' or 'rate-in'" if sw["rate"].nil?
      sw["rate-in"] = sw["rate"]
    end
    if sw["rate-out"].nil? 
      fail "Switch '#{sw_name}' output rate must be defined : 'rate' or 'rate-out'" if sw["rate"].nil?
      sw["rate-out"] = sw["rate"]
    end
    sw["name"] = sw_name
    switches[iface] = sw
  end
end
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
def fill_net_ifaces(site_uid,cluster_uid,node_uid,ifaces,switches)
  net_ifaces = []
  ifaces.each{|iface,sw_name|
    next if iface == "rsa"

    node = lookup("#{site_uid}-#{cluster_uid}", "#{node_uid}")
    fail "Node #{node_uid} not found in configuration '#{site_uid}-#{cluster_uid}'" if node.nil?
  
    net =   {
      :interface => (case iface;when "myri0";'Myrinet';else;"Ethernet";end),
      :device => iface,
      :rate => (eval switches[iface]["rate-in"]),
      :mac => node[iface]["mac"],
      :vendor => (case iface;when "myri0";'Myrinet';else;'Broadcom';end),
      :version => (case iface;when "myri0";'10G-PCIE-8A-C';else;'NetXtreme BCM5780';end),
62
      :enabled => (case iface;when "eth1","eth2";(cluster_uid == "gdx") ? false : true;else;true;end),
63
      :management => (case iface;when "bmc";true;else;false;end),
64 65
      :mountable => (case iface;when "myri0","eth0";true;when "eth1","eth2";(cluster_uid == "netgdx") ? true : false;else;false;end),
      :mounted => (case iface;when "myri0","eth0";true;when "eth1","eth2";(cluster_uid == "netgdx") ? true : false;else;false;end),
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
      :driver => (case iface;when "myri0";'mx_driver';else;'tg3';end),
      :network_address => (case iface;when "eth0";"#{node_uid}.#{site_uid}.grid5000.fr";else;"#{node_uid}-#{iface}.#{site_uid}.grid5000.fr";end),
      :ip => node[iface]["ip"],
      :switch =>  ((switches[iface]["name"] == "switch-nil") ? (nil) : (switches[iface]["name"]+".#{site_uid}.grid5000.fr")),
      :switch_ip => switches[iface]["ip"],
      :switch_mac => switches[iface]["mac"]
    } 
    
    if net[:device] == "bmc"
      net.merge!({
      :switch_console => (switches["rsa"]["name"]+".#{site_uid}.grid5000.fr"),
      :switch_console_ip => switches["rsa"]["ip"],
      :switch_console_mac => switches["rsa"]["mac"]
      })
    end
    net_ifaces.push(net)
82
  }  
83
  net_ifaces
84 85
end

Cyril Rohr's avatar
Cyril Rohr committed
86
site :orsay do |site_uid|
Cyril Rohr's avatar
Cyril Rohr committed
87
  name "Orsay"
Gaetan SIMO's avatar
Gaetan SIMO committed
88
  location "Orsay, France" 
89
  web "https://www.grid5000.fr/mediawiki/index.php/Orsay:Home"
Cyril Rohr's avatar
Cyril Rohr committed
90
  description ""
91 92
  latitude 48.7000
  longitude 2.2000
93 94 95 96
  email_contact "orsay-staff@lists.grid5000.fr"
  sys_admin_contact "orsay-staff@lists.grid5000.fr"
  security_contact "orsay-staff@lists.grid5000.fr"
  user_support_contact "orsay-staff@lists.grid5000.fr"
Cyril Rohr's avatar
Cyril Rohr committed
97
  
98 99 100 101 102 103 104 105 106 107 108 109
  links = lookup("orsay-links","switch-to-switch")
#  puts links.inspect
  clusters = {}
  links.each{|sw,v| cluster_node_switch clusters,{sw => v}}
#  puts clusters.inspect
  
  cluster :gdx do |cluster_uid|
    model "IBM eServer 326m"
    created_at nil
    misc "bios:1.28/bcm:1.20.17/bmc:1.10/rsaII:1.00"

    switches = {}
110
    clusters[cluster_uid].each.each_with_index {|ifaces, id|
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
      next if ifaces.nil?
      ifaces.each{|iface,sw_name| update_switch switches, iface, sw_name }
      
      node "#{cluster_uid}-#{id}" do |node_uid|
        cmts = lookup('orsay-gdx', "#{node_uid}", 'comments')
        comments cmts unless cmts.nil?
            
        supported_job_types({:deploy => true, :besteffort => true, :virtual => false})
        architecture({
          :smp_size => 2, 
          :smt_size => 2,
          :platform_type => "x86_64"
          })
        processor({
          :vendor => "AMD",
          :model => "AMD Opteron",
          :version => ( (180 < id and id < 307 ) ? "250" : "246"),
          :clock_speed => ( (180 < id and id < 307 ) ? 2.4.G : 2.G),
          :instruction_set => "",
          :other_description => "",
          :cache_l1 => nil,
          :cache_l1i => nil,
          :cache_l1d => nil,
          :cache_l2 => 1.MiB
        })
        main_memory({
          :ram_size => 2.GiB, # bytes
          :virtual_size => nil
        })
        operating_system({
          :name => "debian-x64-5-prod",
          :release => "5.1.2",
          :version => "5",
          :kernel   => "2.6.26"
        })
        storage_devices [
          {:interface => 'SATA', :size => 80.GB, :driver => "sata_svw"}
          ]

150
        network_adapters (fill_net_ifaces(site_uid,cluster_uid,node_uid,ifaces,switches))
151 152 153
      end        
    }
  end
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
  
  cluster :netgdx do |cluster_uid|
    model "IBM eServer 326m"
    created_at nil
    misc "bios:1.28/bcm:1.20.17/bmc:1.10/rsaII:1.00"

    switches = {}
    clusters[cluster_uid].each.each_with_index {|ifaces, id|
      next if ifaces.nil?
      ifaces.each{|iface,sw_name| update_switch switches, iface, sw_name }

      node "#{cluster_uid}-#{id}" do |node_uid|
        cmts = lookup('orsay-netgdx', "#{node_uid}", 'comments')
        comments cmts unless cmts.nil?
        
        supported_job_types({:deploy => true, :besteffort => true, :virtual => false})
        architecture({
          :smp_size => 2, 
          :smt_size => 2,
          :platform_type => "x86_64"
          })
        processor({
          :vendor => "AMD",
          :model => "AMD Opteron",
          :version => "246",
          :clock_speed => 2.G,
          :instruction_set => "",
          :other_description => "",
          :cache_l1 => nil,
          :cache_l1i => nil,
          :cache_l1d => nil,
          :cache_l2 => 1.MiB
        })
        main_memory({
          :ram_size => 2.GiB, # bytes
          :virtual_size => nil
        })
        operating_system({
192 193 194 195
          :name => "Debian",
          :release => "6.0",
          :version => "1.0",
          :kernel   => "2.6.32"
196 197 198 199 200 201 202 203 204
        })
        storage_devices [
          {:interface => 'SATA', :size => 80.GB, :driver => "sata_svw"}
          ]

        network_adapters (fill_net_ifaces(site_uid,cluster_uid,node_uid,ifaces,switches))      
      end
    }
  end
205
end