|
@@ -223,7 +223,11 @@ def stop(benchmarker_config=None,
|
|
container.stop()
|
|
container.stop()
|
|
else:
|
|
else:
|
|
# Stop the running container
|
|
# Stop the running container
|
|
- container.stop()
|
|
|
|
|
|
+ try:
|
|
|
|
+ container.stop()
|
|
|
|
+ except Exception:
|
|
|
|
+ # Suppress "No such container" errors
|
|
|
|
+ pass
|
|
|
|
|
|
database_client = docker.DockerClient(
|
|
database_client = docker.DockerClient(
|
|
base_url=benchmarker_config.database_docker_host)
|
|
base_url=benchmarker_config.database_docker_host)
|
|
@@ -235,7 +239,11 @@ def stop(benchmarker_config=None,
|
|
) > 0 and 'techempower' in container.image.tags[0] and 'tfb:latest' not in container.image.tags[0]:
|
|
) > 0 and 'techempower' in container.image.tags[0] and 'tfb:latest' not in container.image.tags[0]:
|
|
container.stop()
|
|
container.stop()
|
|
else:
|
|
else:
|
|
- database_container.stop()
|
|
|
|
|
|
+ try:
|
|
|
|
+ database_container.stop()
|
|
|
|
+ except Exception:
|
|
|
|
+ # Suppress "No such container" errors
|
|
|
|
+ pass
|
|
|
|
|
|
client.containers.prune()
|
|
client.containers.prune()
|
|
|
|
|
|
@@ -342,6 +350,19 @@ def test_client_connection(benchmarker_config, url):
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
+def server_container_exists(benchmarker_config, container_id_or_name):
|
|
|
|
+ '''
|
|
|
|
+ Returns True if the container still exists on the server.
|
|
|
|
+ '''
|
|
|
|
+ client = docker.DockerClient(
|
|
|
|
+ base_url=benchmarker_config.server_docker_host)
|
|
|
|
+ try:
|
|
|
|
+ client.containers.get(container_id_or_name)
|
|
|
|
+ return True
|
|
|
|
+ except:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+
|
|
def benchmark(benchmarker_config, script, variables, raw_file):
|
|
def benchmark(benchmarker_config, script, variables, raw_file):
|
|
'''
|
|
'''
|
|
Runs the given remote_script on the wrk container on the client machine.
|
|
Runs the given remote_script on the wrk container on the client machine.
|