Esempio n. 1
0
File: spi.go Progetto: cycps/addie
func connectToDns(c *spi.Computer) {
	c.Interfaces = append(c.Interfaces,
		spi.Interface{
			Name:      fmt.Sprintf("ifx%d", len(c.Interfaces)),
			Substrate: "dnslink",
			Capacity:  spi.Capacity{100 * 1000, spi.Kind{"max"}},
			Latency:   spi.Latency{0, spi.Kind{"max"}},
		})
}
Esempio n. 2
0
File: spi.go Progetto: cycps/addie
func rtrComp(r *addie.Router) spi.Computer {

	var c spi.Computer
	c.Name = r.Name
	c.OSs = []spi.OS{spi.OS{Name: "Ubuntu1404-64-STD", Version: "Router"}}
	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 r.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

}
Esempio n. 3
0
File: spi.go Progetto: cycps/addie
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

}
Esempio n. 4
0
File: spi.go Progetto: cycps/addie
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

}