Ver código fonte

[ci skip] Fix bug with stopping (#3568)

Mike Smith 7 anos atrás
pai
commit
9fddfc0be0
3 arquivos alterados com 7 adições e 8 exclusões
  1. 1 1
      README.md
  2. 1 1
      deployment/vagrant/bootstrap.sh
  3. 5 6
      toolset/utils/docker_helper.py

+ 1 - 1
README.md

@@ -45,7 +45,7 @@ That run script is pretty wordy, but each and every flag is required. Unfortunat
 
 You may not want to call step 4 from above every time. You can add an `alias` to your `~/.bash_aliases` file to shorten it since it will not change once configured:
 
-`$ alias tfb="docker network create tfb > /dev/null 2>&1 && docker run -it --network=tfb -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=[ABS PATH TO THIS DIR],target=/FrameworkBenchmarks techempower/tfb"`
+`$ alias tfb="docker network create tfb > /dev/null 2>&1; docker run -it --network=tfb -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=[ABS PATH TO THIS DIR],target=/FrameworkBenchmarks techempower/tfb"`
 
 `$ source ~/.bash_aliases`
 

+ 1 - 1
deployment/vagrant/bootstrap.sh

@@ -39,7 +39,7 @@ Welcome to the FrameworkBenchmarks project!
 EOF
 
   cat <<EOF > /home/vagrant/.bash_aliases
-alias tfb="docker network create tfb > /dev/null 2>&1 && docker run -it --network=tfb -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=/home/vagrant/FrameworkBenchmarks,target=/FrameworkBenchmarks techempower/tfb"
+alias tfb="docker network create tfb > /dev/null 2>&1; docker run -it --network=tfb -v /var/run/docker.sock:/var/run/docker.sock --mount type=bind,source=/home/vagrant/FrameworkBenchmarks,target=/FrameworkBenchmarks techempower/tfb"
 EOF
 
   sudo mv motd /etc/

+ 5 - 6
toolset/utils/docker_helper.py

@@ -219,9 +219,6 @@ def stop(benchmarker_config=None,
                     container.image.tags
             ) > 0 and 'techempower' in container.image.tags[0] and 'tfb:latest' not in container.image.tags[0]:
                 container.stop()
-                # 'techempower/tfb.test.gemini:0.1' -> 'techempower/tfb.test.gemini'
-                client.images.remove(
-                    container.image.tags[0].split(':')[0], force=True)
     else:
         # Stop all our running containers
         for container in containers:
@@ -236,12 +233,14 @@ def stop(benchmarker_config=None,
                     container.image.tags
             ) > 0 and 'techempower' in container.image.tags[0] and 'tfb:latest' not in container.image.tags[0]:
                 container.stop()
-                # 'techempower/tfb.test.gemini:0.1' -> 'techempower/tfb.test.gemini'
-                client.images.remove(
-                    container.image.tags[0].split(':')[0], force=True)
     else:
         database_container.stop()
 
+    client.containers.prune()
+
+    if benchmarker_config.server_docker_host != benchmarker_config.database_docker_host:
+        database_client.containers.prune()
+
 
 def find(path, pattern):
     '''