def docker(self, image, runtime): options = ["--rm", "--network", "none"] if runtime is not None: options.extend(["--runtime", runtime]) container, creation = docker.create("edvgui/%s-hello-world" % image, options=options) _, start = docker.start(container) response, execution = docker.exec(container, ["/bin/echo", "Hello World"]) docker.kill(container) if 'Hello World' not in response: print('Error (docker): wrong response: ' + response) return -1 return [creation, creation + start, creation + start + execution]
def docker(self, image, runtime): address = "127.0.0.1:3000" options = ["--rm", "-p", address + ":80"] if runtime is not None: options.extend(["--runtime", runtime]) container, creation = docker.create("edvgui/%s-http-server" % image, options=options) _, start = docker.start(container) _, execution = docker.exec(container, ["/usr/sbin/lighttpd", "-f", "/etc/lighttpd/lighttpd.conf"]) result = server_get("http://" + address) docker.kill(container) return [creation, creation + start, creation + start + execution, creation + start + execution + result] if result != -1 else -1
def docker(self, image, runtime): options = ["--rm", "--network", "none"] if runtime is not None: options.extend(["--runtime", runtime]) container, creation = docker.create("edvgui/%s-db-write-%s" % (image, self.size), options=options) _, start = docker.start(container) response, execution = docker.exec(container, ["/run/run.sh", "/home/tpcc.db", "/run/write.sqlite"]) docker.kill(container) if 'Done' not in response: print("Error (docker_alpine): wrong response: " + response) return -1 return [creation, creation + start, creation + start + execution]