docker.py: always use --rm
PATCH 1/1 docker.py: always use --rm
Avoid that containers pile up.
--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
tests/docker/Makefile.include +0 -1
@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \ $(if $(DEBUG),-ti,) \ $(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \
tests/docker/docker.py +2 -2
@@ -377,7 +377,7 @@ class Docker(object): if self._command[0] == "podman": cmd.insert(0, '--userns=keep-id') - ret = self._do_check(["run", "--label", + ret = self._do_check(["run", "--rm", "--label", "com.qemu.instance.uuid=" + label] + cmd, quiet=quiet) if not keep:
@@ -616,7 +616,7 @@ class CcCommand(SubCommand): if argv and argv[0] == "--": argv = argv[1:] cwd = os.getcwd() - cmd = ["--rm", "-w", cwd, + cmd = ["-w", cwd, "-v", "%s:%s:rw" % (cwd, cwd)] if args.paths: for p in args.paths:
Signature · 1 line
2.26.2
Quoted 13 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)tests/docker/Makefile.include +0
-0
tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 4 lines
tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \
I guess the intention was that if someone is running verbose they might want to get back into the container after a failure. This is certainly a pain for CI though, because running verbose is desirable but keeping around dead containers is not.
The DEBUG=1 option is likely a better general purpose debugging approach than relying on the dead container being left behind, so
Quoted 28 lines
tests/docker/Makefile.include +0
-0$(if $(DEBUG),-ti,) \ $(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \tests/docker/docker.py +2
-2@@ -377,7 +377,7 @@ class Docker(object): if self._command[0] == "podman": cmd.insert(0, '--userns=keep-id') - ret = self._do_check(["run", "--label", + ret = self._do_check(["run", "--rm", "--label", "com.qemu.instance.uuid=" + label] + cmd, quiet=quiet) if not keep:@@ -616,7 +616,7 @@ class CcCommand(SubCommand): if argv and argv[0] == "--": argv = argv[1:] cwd = os.getcwd() - cmd = ["--rm", "-w", cwd, + cmd = ["-w", cwd, "-v", "%s:%s:rw" % (cwd, cwd)] if args.paths: for p in args.paths:Signature · 1 line
2.26.2
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 24 lines · Daniel P. Berrangé
Quoted 13 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)tests/docker/Makefile.include +0
-0tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 4 lines
tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \I guess the intention was that if someone is running verbose they might want to get back into the container after a failure. This is certainly a pain for CI though, because running verbose is desirable but keeping around dead containers is not.
Quoted 4 lines
The DEBUG=1 option is likely a better general purpose debugging approach than relying on the dead container being left behind, so
Reviewed-by Daniel P. Berrangé <[email protected]>
Peter, can you apply this directly in order to unbreak Patchew?
Paolo
Quoted 34 lines
Quoted 30 lines
tests/docker/Makefile.include +0
-0$(if $(DEBUG),-ti,) \ $(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \tests/docker/docker.py +2
-2@@ -377,7 +377,7 @@ class Docker(object): if self._command[0] == "podman": cmd.insert(0, '--userns=keep-id') - ret = self._do_check(["run", "--label", + ret = self._do_check(["run", "--rm", "--label", "com.qemu.instance.uuid=" + label] + cmd, quiet=quiet) if not keep:@@ -616,7 +616,7 @@ class CcCommand(SubCommand): if argv and argv[0] == "--": argv = argv[1:] cwd = os.getcwd() - cmd = ["--rm", "-w", cwd, + cmd = ["-w", cwd, "-v", "%s:%s:rw" % (cwd, cwd)] if args.paths: for p in args.paths:Signature · 1 line
2.26.2Regards,
Daniel
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed build test on FreeBSD host. Please find the details below.
The full log is available at
http://patchew.org/logs/[email protected]/testing.FreeBSD/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 13 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)tests/docker/Makefile.include +0
-0
tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 5 lines
tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \ $(if $(DEBUG),-ti,) \
Alternatively:
- $(if $V,,--rm) - $(if $(DEBUG),-ti,) + $(if $(DEBUG),-ti,--rm)
Anyhow:
Quoted 25 lines
tests/docker/Makefile.include +0
-0$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \tests/docker/docker.py +2
-2@@ -377,7 +377,7 @@ class Docker(object): if self._command[0] == "podman": cmd.insert(0, '--userns=keep-id') - ret = self._do_check(["run", "--label", + ret = self._do_check(["run", "--rm", "--label", "com.qemu.instance.uuid=" + label] + cmd, quiet=quiet) if not keep:@@ -616,7 +616,7 @@ class CcCommand(SubCommand): if argv and argv[0] == "--": argv = argv[1:] cwd = os.getcwd() - cmd = ["--rm", "-w", cwd, + cmd = ["-w", cwd, "-v", "%s:%s:rw" % (cwd, cwd)] if args.paths: for p in args.paths:
Quoted 22 lines · Philippe Mathieu-Daudé
Quoted 13 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)tests/docker/Makefile.include +0
-0tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 5 lines
tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \ $(if $(DEBUG),-ti,) \Alternatively:
Review
Quoted 3 lines
(quoted diff) +1
-2- $(if $V,,--rm) - $(if $(DEBUG),-ti,) + $(if $(DEBUG),-ti,--rm)
Surely that should b:
$(if $(DEBUG),-ti --rm,)
I think being able to keep the container around is useful for debug, I have no problem with changing the behaviour for V=1.
Quoted 29 lines
Anyhow:
Quoted 25 lines
tests/docker/Makefile.include +0
-0$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \tests/docker/docker.py +2
-2@@ -377,7 +377,7 @@ class Docker(object): if self._command[0] == "podman": cmd.insert(0, '--userns=keep-id') - ret = self._do_check(["run", "--label", + ret = self._do_check(["run", "--rm", "--label", "com.qemu.instance.uuid=" + label] + cmd, quiet=quiet) if not keep:@@ -616,7 +616,7 @@ class CcCommand(SubCommand): if argv and argv[0] == "--": argv = argv[1:] cwd = os.getcwd() - cmd = ["--rm", "-w", cwd, + cmd = ["-w", cwd, "-v", "%s:%s:rw" % (cwd, cwd)] if args.paths: for p in args.paths:
Signature · 1 line
Alex Bennée
Il gio 17 set 2020, 18:53 Alex Bennée <[email protected]> ha scritto:
Quoted 30 lines
Quoted 10 lines · Philippe Mathieu-Daudé
Review
Quoted 9 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)(quoted diff) +0
-0b/tests/docker/Makefile.include
Quoted 12 lines
tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 9 lines
index
3daabaa2fd..75704268ff100644tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \ $(if $(DEBUG),-ti,) \Alternatively:
Review
Quoted 3 lines
(quoted diff) +1
-2- $(if $V,,--rm) - $(if $(DEBUG),-ti,) + $(if $(DEBUG),-ti,--rm)
Quoted 7 lines
Surely that should b:
$(if $(DEBUG),-ti --rm,)I think being able to keep the container around is useful for debug, I have no problem with changing the behaviour for V=1.
You probably mean $(if $(DEBUG),-ti,--rm) but that would not work because the patch adds --rm unconditionally in docker.py. But $(DEBUG) gives you a shell to run the test from, so I don't think skipping --rm is useful even in the $(DEBUG) case.
Paolo
Quoted 1 line
Got it.
Quoted 50 lines · On Thu, 17 Sep 2020, 17:58 Paolo Bonzini, <[email protected]> wrote:
Il gio 17 set 2020, 18:53 Alex Bennée <[email protected]> ha scritto:
Quoted 30 lines
Quoted 10 lines · Philippe Mathieu-Daudé
Review
Quoted 9 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)(quoted diff) +0
-0b/tests/docker/Makefile.include
Quoted 12 lines
tests/docker/Makefile.include docker-run: docker-qemu-src · line 246
Quoted 9 lines
index
3daabaa2fd..75704268ff100644tests/docker/Makefile.include +0
-1@@ -243,7 +243,6 @@ docker-run: docker-qemu-src $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,--run-as-current-user) \ --security-opt seccomp=unconfined \ - $(if $V,,--rm) \ $(if $(DEBUG),-ti,) \Alternatively:
Review
Quoted 3 lines
(quoted diff) +1
-2- $(if $V,,--rm) - $(if $(DEBUG),-ti,) + $(if $(DEBUG),-ti,--rm)Quoted 7 lines
Surely that should b:
$(if $(DEBUG),-ti --rm,)I think being able to keep the container around is useful for debug, I have no problem with changing the behaviour for V=1.
You probably mean $(if $(DEBUG),-ti,--rm) but that would not work because the patch adds --rm unconditionally in
docker.py. But $(DEBUG) gives you a shell to run the test from, so I don't think skipping --rm is useful even in the $(DEBUG) case.Paolo
Quoted 1 line
Peter Maydell
AppliedQuoted 8 lines · Paolo Bonzini
Avoid that containers pile up.
Signed-off-by Paolo Bonzini <[email protected]>--- tests/docker/Makefile.include | 1 - tests/docker/docker.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
Applied to master, thanks.
-- PMM