Ejemplo n.º 1
0
 def lxd(self, image, runtime):
     container, creation = lxc.init("edvgui/%s-hello-world" % image, ["-e", "--profile", "default"])
     start = lxc.start(container)
     response, execution_time = lxc.exec(container, ["/bin/echo", "Hello World"])
     lxc.kill(container)
     if 'Hello World' not in response:
         print("Error (lxc): wrong response: " + response)
         return -1
     return [creation, creation + start, creation + start + execution_time]
Ejemplo n.º 2
0
 def lxd(self, image, runtime):
     container, creation = lxc.init("edvgui/%s-db-write-%s" % (image, self.size), ["-e", "--profile", "default"])
     start = lxc.start(container)
     response, execution_time = lxc.exec(container, ["./sqlite.sh", "tpcc.db", "write.sqlite"])
     lxc.kill(container)
     if 'Done' not in response:
         print("Error (lxc): wrong response: " + response)
         return -1
     return [creation, creation + start, creation + start + execution_time]
Ejemplo n.º 3
0
 def lxd(self, image, runtime):
     address = "127.0.0.1:3000"
     container, creation = lxc.init("edvgui/%s-http-server" % image, ["-e", "--profile", "default", "--profile",
                                                                      "online", "--profile", "server-3000"])
     start = lxc.start(container)
     response, execution = lxc.exec(container, ["/usr/sbin/lighttpd", "-f", "/etc/lighttpd/lighttpd.conf"])
     result = server_get("http://" + address)
     lxc.kill(container)
     return [creation, creation + start, creation + start + execution,
             creation + start + execution + result] if result != -1 else -1