func saxComp(s *addie.Sax) spi.Computer { var c spi.Computer c.Name = s.Name c.OSs = []spi.OS{spi.OS{Name: "Ubuntu1404-64-STD", Version: ""}} c.Attributes = []spi.TopDLAttribute{ spi.TopDLAttribute{ Attribute: "type", Value: "dl380g3", }, spi.TopDLAttribute{ Attribute: "containers:openvz_template", Value: "ubuntu-14.04-x86_64", }, spi.TopDLAttribute{ Attribute: "osid", Value: "Ubuntu1404-64-STD", }, spi.TopDLAttribute{ Attribute: "startup", Value: "/proj/cypress/scripts/cyinit.sh", }, } c.Interfaces = append(c.Interfaces, spi.Interface{ Name: "eth0", Substrate: "krynet", Capacity: spi.Capacity{1000.0 * 1000, spi.Kind{"max"}}, Latency: spi.Latency{0, spi.Kind{"max"}}, }, ) for _, i := range s.Interfaces { c.Interfaces = append(c.Interfaces, spi.Interface{ Name: i.Name, Substrate: "TODO", //this gets resolved when the links get added Capacity: spi.Capacity{float64(i.Capacity) * 1000, spi.Kind{"max"}}, Latency: spi.Latency{float64(i.Latency), spi.Kind{"max"}}, }, ) } return c }
func compComp(c *addie.Computer) spi.Computer { var _c spi.Computer _c.Name = c.Name _c.OSs = []spi.OS{spi.OS{Name: c.OS, Version: ""}} _c.Attributes = []spi.TopDLAttribute{ spi.TopDLAttribute{ Attribute: "type", Value: "dl380g3", }, spi.TopDLAttribute{ Attribute: "containers:openvz_template", Value: "ubuntu-14.04-x86_64", }, spi.TopDLAttribute{ Attribute: "osid", Value: "Ubuntu1404-64-STD", }, spi.TopDLAttribute{ Attribute: "startup", Value: "/proj/cypress/scripts/cyinit.sh", }, } for _, i := range c.Interfaces { _c.Interfaces = append(_c.Interfaces, spi.Interface{ Name: i.Name, Substrate: "TODO", //this gets resolved when the links get added Capacity: spi.Capacity{float64(i.Capacity) * 1000, spi.Kind{"max"}}, Latency: spi.Latency{float64(i.Latency), spi.Kind{"max"}}, }, ) } return _c }
func simComp() spi.Computer { var c spi.Computer c.Name = fmt.Sprintf("kry%d", kryCount) kryCount++ c.OSs = []spi.OS{spi.OS{Name: "Ubuntu1404-64-STD", Version: ""}} c.Attributes = []spi.TopDLAttribute{ spi.TopDLAttribute{ Attribute: "type", Value: "dl380g3", }, spi.TopDLAttribute{ Attribute: "containers:openvz_template", Value: "ubuntu-14.04-x86_64", }, spi.TopDLAttribute{ Attribute: "osid", Value: "Ubuntu1404-64-STD", }, spi.TopDLAttribute{ Attribute: "startup", Value: "/proj/cypress/scripts/cyinit.sh", }, } c.Interfaces = append(c.Interfaces, spi.Interface{ Name: "eth0", Substrate: "krynet", Capacity: spi.Capacity{1000.0 * 1000, spi.Kind{"max"}}, Latency: spi.Latency{0, spi.Kind{"max"}}, }, ) return c }
func dnsComp(name string) spi.Computer { var c spi.Computer c.Name = name c.OSs = []spi.OS{spi.OS{Name: "Ubuntu1404-64-STD", Version: "DNS"}} c.Attributes = []spi.TopDLAttribute{ spi.TopDLAttribute{ Attribute: "type", Value: "dl380g3", }, spi.TopDLAttribute{ Attribute: "containers:openvz_template", Value: "ubuntu-14.04-x86_64", }, spi.TopDLAttribute{ Attribute: "osid", Value: "Ubuntu1404-64-STD", }, spi.TopDLAttribute{ Attribute: "startup", Value: "/proj/cypress/scripts/cyinit.sh", }, } c.Interfaces = append(c.Interfaces, spi.Interface{ Name: "ifx0", Substrate: "dnslink", //this gets resolved when the links get added Capacity: spi.Capacity{100 * 1000, spi.Kind{"max"}}, Latency: spi.Latency{0, spi.Kind{"max"}}, }, ) return c }