Skip to contentSkip to conversation

test/docker/Makefile.include: add a generic docker-run target

RFC In review Alex Bennée 2 participants 7 messages Sep 20, 2016 – Sep 21, 2016

lore
Share & tools
lore
#0 lore raw

RFC 1/1 test/docker/Makefile.include: add a generic docker-run target

This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline verification has been shunted into other target prerequisites before a sub-make is invoked for the docker-run target.

---
NB: I dropped the awk magic that verifies the image exists before running. I couldn't get the thing to work in my shell so wasn't quite sure what it was doing.

---
 tests/docker/Makefile.include | 82 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 20 deletions(-)
tests/docker/Makefile.include +62 -20
index 19d4cc7..ee47085 100644
@@ -101,31 +101,73 @@ docker:
 	@echo '    NOCACHE=1            Ignore cache when build images.'
 	@echo '    EXECUTABLE=<path>    Include executable in image.'
 
-docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
-docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
-docker-run-%: docker-qemu-src
+# This rule if for directly running against an arbitary docker target.
+# It is called by the expanded docker targets (e.g. make
+# docker-test-foo@bar) which will do additional verification.
+#
+# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
+#
+docker-run: docker-qemu-src
 	@mkdir -p "$(DOCKER_CCACHE_DIR)"
-	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
-		then echo "Invalid target"; exit 1; \
+	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
+		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
 	fi
-	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
-		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images | \
-				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
-				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
-				-t \
-				$(if $(DEBUG),-i,--net=none) \
-				-e TARGET_LIST=$(TARGET_LIST) \
+	$(if $(EXECUTABLE),						\
+		$(call quiet-command,					\
+			$(SRC_PATH)/tests/docker/docker.py update 	\
+			$(IMAGE) $(EXECUTABLE)))
+	$(call quiet-command,						\
+		$(SRC_PATH)/tests/docker/docker.py run 			\
+				-t 					\
+				$(if $V,,--rm) 				\
+				$(if $(DEBUG),-i,--net=none) 		\
+				-e TARGET_LIST=$(TARGET_LIST) 		\
 				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
-				-e V=$V -e J=$J -e DEBUG=$(DEBUG)\
-				-e CCACHE_DIR=/var/tmp/ccache \
+				-e V=$V -e J=$J -e DEBUG=$(DEBUG)	\
+				-e CCACHE_DIR=/var/tmp/ccache 		\
 				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
 				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
-				qemu:$(IMAGE) \
-				/var/tmp/qemu/run \
-				$(CMD); \
-			fi \
-			, "  RUN $(CMD) in $(IMAGE)")))
+				$(IMAGE) 				\
+				/var/tmp/qemu/run 			\
+				$(TEST), "  RUN $(TEST) in ${IMAGE}")
+
+#
+# Verification targets
+#
+# These targets help verify the test (CMD) and docker tag (IMAGE) are
+# part of the built in set of tests and images. You can still call the
+# docker-run target directly for testsing against arbitary images.
+#
+
+docker-verify-image-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-verify-image-\([^@]*\)@\(.*\)/\2/')
+docker-verify-image-%:
+	@if test -z "$(IMAGE)";			 	\
+		then echo "Invalid image"; exit 1; 	\
+	fi
+	$(if $(findstring $(IMAGE), $(DOCKER_IMAGES))	\
+		, @echo "Verified $(IMAGE)"		\
+		, @echo "$(IMAGE) is not a known image"; exit 1)
+
+docker-verify-test-%: CMD = $(shell echo '$@' | sed -e 's/docker-verify-test-\([^@]*\)@\(.*\)/\1/')
+docker-verify-test-%:
+	@if test -z "$(CMD)"; 				\
+		then echo "Invalid test"; exit 1; 	\
+	fi
+	$(if $(findstring $(CMD), $(DOCKER_TESTS))	\
+		, @echo "Verified $(CMD)"		\
+		, @echo "$(CMD) is not a known test"; exit 1)
+
+# Run targets
+#
+# This will take a target such as docker-test-foo@bar and verify that:
+#  - the test test-foo is a known test
+#  - the image bar is a known image
+#
+# It will then call the docker-run
+docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
+docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
+docker-run-%: docker-verify-image-% docker-verify-test-%
+	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
 
 docker-clean:
 	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
Signature · 1 line
2.9.3
#1 lore raw
Quoted 11 lines · Alex Bennée

This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline verification has been shunted into other target prerequisites before a sub-make is invoked for the docker-run target.

Hi Alex,

I understand sometimes one can have specialized images, but still: is it possible to convert them to Dockerfile and include in the tree?

Or, is this for testing/debugging purpose?

Quoted 7 lines

---
NB: I dropped the awk magic that verifies the image exists before running. I couldn't get the thing to work in my shell so wasn't quite sure what it was doing.

It was to allow "make docker-test" to skip debian-bootstrap image if it is not there (e.g. when qemu-user not available).

I'm not much too concerned about that though, since most of the time we will use docker-FOO@BAR, for specific combinations, instead of docker-test for a blanket coverage.

Quoted 12 lines
---
 tests/docker/Makefile.include | 82 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 20 deletions(-)
tests/docker/Makefile.include +0 -0
index 19d4cc7..ee47085 100644
@@ -101,31 +101,73 @@ docker:
 	@echo '    NOCACHE=1            Ignore cache when build images.'
 	@echo '    EXECUTABLE=<path>    Include executable in image.'
 

tests/docker/Makefile.include docker: · line 110

Quoted 10 lines
tests/docker/Makefile.include +7 -3
-docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
-docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
-docker-run-%: docker-qemu-src
+# This rule if for directly running against an arbitary docker target.
+# It is called by the expanded docker targets (e.g. make
+# docker-test-foo@bar) which will do additional verification.
+#
+# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
+#
+docker-run: docker-qemu-src

This target should probably be documented in "make docker".

Quoted 36 lines
tests/docker/Makefile.include +14 -17
 	@mkdir -p "$(DOCKER_CCACHE_DIR)"
-	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
-		then echo "Invalid target"; exit 1; \
+	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
+		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
 	fi
-	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
-		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images | \
-				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
-				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
-				-t \
-				$(if $(DEBUG),-i,--net=none) \
-				-e TARGET_LIST=$(TARGET_LIST) \
+	$(if $(EXECUTABLE),						\
+		$(call quiet-command,					\
+			$(SRC_PATH)/tests/docker/docker.py update 	\
+			$(IMAGE) $(EXECUTABLE)))
+	$(call quiet-command,						\
+		$(SRC_PATH)/tests/docker/docker.py run 			\
+				-t 					\
+				$(if $V,,--rm) 				\
+				$(if $(DEBUG),-i,--net=none) 		\
+				-e TARGET_LIST=$(TARGET_LIST) 		\
 				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
-				-e V=$V -e J=$J -e DEBUG=$(DEBUG)\
-				-e CCACHE_DIR=/var/tmp/ccache \
+				-e V=$V -e J=$J -e DEBUG=$(DEBUG)	\
+				-e CCACHE_DIR=/var/tmp/ccache 		\
 				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
 				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
-				qemu:$(IMAGE) \
-				/var/tmp/qemu/run \
-				$(CMD); \
-			fi \
-			, "  RUN $(CMD) in $(IMAGE)")))

tests/docker/Makefile.include docker: · line 139

Quoted 10 lines
tests/docker/Makefile.include +10 -0
+				$(IMAGE) 				\
+				/var/tmp/qemu/run 			\
+				$(TEST), "  RUN $(TEST) in ${IMAGE}")
+
+#
+# Verification targets
+#
+# These targets help verify the test (CMD) and docker tag (IMAGE) are
+# part of the built in set of tests and images. You can still call the
+# docker-run target directly for testsing against arbitary images.

s/arbitary/arbitrary/

One more of this below.

tests/docker/Makefile.include docker: · line 147

Quoted 8 lines
tests/docker/Makefile.include +8 -0
+#
+
+docker-verify-image-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-verify-image-\([^@]*\)@\(.*\)/\2/')
+docker-verify-image-%:
+	@if test -z "$(IMAGE)";			 	\
+		then echo "Invalid image"; exit 1; 	\
+	fi
+	$(if $(findstring $(IMAGE), $(DOCKER_IMAGES))	\

This seems inaccurate. what if it is in a form of "$(findstring abc, abcde)"?

tests/docker/Makefile.include docker: · line 156

Quoted 9 lines
tests/docker/Makefile.include +9 -0
+		, @echo "Verified $(IMAGE)"		\
+		, @echo "$(IMAGE) is not a known image"; exit 1)
+
+docker-verify-test-%: CMD = $(shell echo '$@' | sed -e 's/docker-verify-test-\([^@]*\)@\(.*\)/\1/')
+docker-verify-test-%:
+	@if test -z "$(CMD)"; 				\
+		then echo "Invalid test"; exit 1; 	\
+	fi
+	$(if $(findstring $(CMD), $(DOCKER_TESTS))	\

The same question to findstring as above.

tests/docker/Makefile.include docker: · line 157

Quoted 1 line
tests/docker/Makefile.include +1 -0
+		, @echo "Verified $(CMD)"		\

No need to echo anything in case of verified, or at least use quiet-command please.

Quoted 19 lines
tests/docker/Makefile.include +13 -0
+		, @echo "$(CMD) is not a known test"; exit 1)
+
+# Run targets
+#
+# This will take a target such as docker-test-foo@bar and verify that:
+#  - the test test-foo is a known test
+#  - the image bar is a known image
+#
+# It will then call the docker-run
+docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
+docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
+docker-run-%: docker-verify-image-% docker-verify-test-%
+	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
 
 docker-clean:
 	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
Signature · 1 line
2.9.3

Fam

#2 lore raw
Quoted 13 lines · Fam Zheng
Quoted 11 lines · Alex Bennée

This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline verification has been shunted into other target prerequisites before a sub-make is invoked for the docker-run target.

Quoted 6 lines

Hi Alex,

I understand sometimes one can have specialized images, but still: is it possible to convert them to Dockerfile and include in the tree?

Or, is this for testing/debugging purpose?

A bit of both. In this particular use case I'm using a debootstrap image while updating the binfmt_misc executable. Currently there is a 1->N relationship for debootstrap as we can bootstrap multiple architectures in different images. By splitting the docker-run from the expansions we give ourselves a little more flexibility for running stuff.

But I think it's also useful for testing/debugging. I wrote this up as I was trying to debug a Travis build failure with gcc-6 so I was generating lots of test images and wanting to build against those. I would also like to add a travis Dockerfile at some point but at the moment what exactly goes into one of those is a little opaque to me.

Quoted 11 lines
Quoted 8 lines

---
NB: I dropped the awk magic that verifies the image exists before running. I couldn't get the thing to work in my shell so wasn't quite sure what it was doing.

It was to allow "make docker-test" to skip debian-bootstrap image if it is not there (e.g. when qemu-user not available).

Ahh ok. I got a little confused as the docker images command can filter things based on tag so maybe we can come up with a cleaner test?

Quoted 4 lines

I'm not much too concerned about that though, since most of the time we will use docker-FOO@BAR, for specific combinations, instead of docker-test for a blanket coverage.

What does patchew use?

Quoted 13 lines
Quoted 13 lines
---
 tests/docker/Makefile.include | 82 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 20 deletions(-)
tests/docker/Makefile.include +0 -0
index 19d4cc7..ee47085 100644
@@ -101,31 +101,73 @@ docker:
 	@echo '    NOCACHE=1            Ignore cache when build images.'
 	@echo '    EXECUTABLE=<path>    Include executable in image.'
 
Quoted 12 lines

tests/docker/Makefile.include docker: · line 110

Quoted 10 lines
tests/docker/Makefile.include +7 -3
-docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
-docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
-docker-run-%: docker-qemu-src
+# This rule if for directly running against an arbitary docker target.
+# It is called by the expanded docker targets (e.g. make
+# docker-test-foo@bar) which will do additional verification.
+#
+# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
+#
+docker-run: docker-qemu-src

This target should probably be documented in "make docker".

OK

Quoted 50 lines
Quoted 37 lines
tests/docker/Makefile.include +14 -17
 	@mkdir -p "$(DOCKER_CCACHE_DIR)"
-	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
-		then echo "Invalid target"; exit 1; \
+	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
+		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
 	fi
-	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
-		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images | \
-				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
-				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
-				-t \
-				$(if $(DEBUG),-i,--net=none) \
-				-e TARGET_LIST=$(TARGET_LIST) \
+	$(if $(EXECUTABLE),						\
+		$(call quiet-command,					\
+			$(SRC_PATH)/tests/docker/docker.py update 	\
+			$(IMAGE) $(EXECUTABLE)))
+	$(call quiet-command,						\
+		$(SRC_PATH)/tests/docker/docker.py run 			\
+				-t 					\
+				$(if $V,,--rm) 				\
+				$(if $(DEBUG),-i,--net=none) 		\
+				-e TARGET_LIST=$(TARGET_LIST) 		\
 				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
-				-e V=$V -e J=$J -e DEBUG=$(DEBUG)\
-				-e CCACHE_DIR=/var/tmp/ccache \
+				-e V=$V -e J=$J -e DEBUG=$(DEBUG)	\
+				-e CCACHE_DIR=/var/tmp/ccache 		\
 				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
 				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
-				qemu:$(IMAGE) \
-				/var/tmp/qemu/run \
-				$(CMD); \
-			fi \
-			, "  RUN $(CMD) in $(IMAGE)")))

tests/docker/Makefile.include docker: · line 139

Quoted 10 lines
tests/docker/Makefile.include +10 -0
+				$(IMAGE) 				\
+				/var/tmp/qemu/run 			\
+				$(TEST), "  RUN $(TEST) in ${IMAGE}")
+
+#
+# Verification targets
+#
+# These targets help verify the test (CMD) and docker tag (IMAGE) are
+# part of the built in set of tests and images. You can still call the
+# docker-run target directly for testsing against arbitary images.

s/arbitary/arbitrary/

Quoted 1 line

One more of this below.

OK.

Quoted 12 lines

tests/docker/Makefile.include docker: · line 147

Quoted 9 lines
tests/docker/Makefile.include +8 -0
+#
+
+docker-verify-image-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-verify-image-\([^@]*\)@\(.*\)/\2/')
+docker-verify-image-%:
+	@if test -z "$(IMAGE)";			 	\
+		then echo "Invalid image"; exit 1; 	\
+	fi
+	$(if $(findstring $(IMAGE), $(DOCKER_IMAGES))	\

This seems inaccurate. what if it is in a form of "$(findstring abc, abcde)"?

I'll see if I can replace it with the original filter test.

Quoted 13 lines

tests/docker/Makefile.include docker: · line 156

Quoted 10 lines
tests/docker/Makefile.include +9 -0
+		, @echo "Verified $(IMAGE)"		\
+		, @echo "$(IMAGE) is not a known image"; exit 1)
+
+docker-verify-test-%: CMD = $(shell echo '$@' | sed -e 's/docker-verify-test-\([^@]*\)@\(.*\)/\1/')
+docker-verify-test-%:
+	@if test -z "$(CMD)"; 				\
+		then echo "Invalid test"; exit 1; 	\
+	fi
+	$(if $(findstring $(CMD), $(DOCKER_TESTS))	\

The same question to findstring as above.

Quoted 4 lines

tests/docker/Makefile.include docker: · line 157

Quoted 1 line
tests/docker/Makefile.include +1 -0
+		, @echo "Verified $(CMD)"		\

No need to echo anything in case of verified, or at least use quiet-command please.

Sure. This was mostly convincing me I got my make-fu right ;-)

Quoted 15 lines
Quoted 15 lines
tests/docker/Makefile.include +13 -0
+		, @echo "$(CMD) is not a known test"; exit 1)
+
+# Run targets
+#
+# This will take a target such as docker-test-foo@bar and verify that:
+#  - the test test-foo is a known test
+#  - the image bar is a known image
+#
+# It will then call the docker-run
+docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
+docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
+docker-run-%: docker-verify-image-% docker-verify-test-%
+	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
 
Quoted 7 lines
Quoted 5 lines
tests/docker/Makefile.include +0 -1
 docker-clean:
 	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
--

2.9.3

Fam

--
Alex Bennée

#3 lore raw
Quoted 29 lines · Alex Bennée
Quoted 13 lines · Fam Zheng
Quoted 11 lines · Alex Bennée

This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline verification has been shunted into other target prerequisites before a sub-make is invoked for the docker-run target.

Quoted 6 lines

Hi Alex,

I understand sometimes one can have specialized images, but still: is it possible to convert them to Dockerfile and include in the tree?

Or, is this for testing/debugging purpose?

A bit of both. In this particular use case I'm using a debootstrap image while updating the binfmt_misc executable. Currently there is a 1->N relationship for debootstrap as we can bootstrap multiple architectures in different images. By splitting the docker-run from the expansions we give ourselves a little more flexibility for running stuff.

Quoted 5 lines

But I think it's also useful for testing/debugging. I wrote this up as I was trying to debug a Travis build failure with gcc-6 so I was generating lots of test images and wanting to build against those. I would also like to add a travis Dockerfile at some point but at the moment what exactly goes into one of those is a little opaque to me.

Thanks for clarifying, and I agree this feature is really nice in general.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

---
NB: I dropped the awk magic that verifies the image exists before running. I couldn't get the thing to work in my shell so wasn't quite sure what it was doing.

Quoted 5 lines
Quoted 2 lines

It was to allow "make docker-test" to skip debian-bootstrap image if it is not there (e.g. when qemu-user not available).

Ahh ok. I got a little confused as the docker images command can filter things based on tag so maybe we can come up with a cleaner test?

For once it used a format option of "docker images" that isn't available on RHEL 7, per requested I changed it to the unobvious awk test.

Quoted 7 lines
Quoted 5 lines

I'm not much too concerned about that though, since most of the time we will use docker-FOO@BAR, for specific combinations, instead of docker-test for a blanket coverage.

What does patchew use?

The general strategy of patchew is good coverage of both tests and images, without multiplexing them which could make testing one patch infinitely long on a simple minded tester.

For now, we have:

docker-test-quick@centos6
docker-test-mingw@fedora

And staging (pending because of some mysterious false positives):

docker-test-quick@min-glib

I also plan to extend to centos7 and ubuntu in the middle term, and give cross compiling for OSX a try in the long run (googling says it's technically possible).

I haven't prioritied debootstrap for now, because arm is not too different than x86 in terms of endianness and stuff, and qemu-user is probably much slower than native compilers.

But still, BE images will be a compelling reason, if there comes one.

Fam

#4 lore raw
Quoted 74 lines · Fam Zheng
Quoted 29 lines · Alex Bennée
Quoted 13 lines · Fam Zheng
Quoted 11 lines · Alex Bennée

This re-factors the docker makefile to include a docker-run target which can be controlled entirely from environment variables specified on the make command line. This allows us to run against any given docker image we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline verification has been shunted into other target prerequisites before a sub-make is invoked for the docker-run target.

Quoted 6 lines

Hi Alex,

I understand sometimes one can have specialized images, but still: is it possible to convert them to Dockerfile and include in the tree?

Or, is this for testing/debugging purpose?

A bit of both. In this particular use case I'm using a debootstrap image while updating the binfmt_misc executable. Currently there is a 1->N relationship for debootstrap as we can bootstrap multiple architectures in different images. By splitting the docker-run from the expansions we give ourselves a little more flexibility for running stuff.

Quoted 5 lines

But I think it's also useful for testing/debugging. I wrote this up as I was trying to debug a Travis build failure with gcc-6 so I was generating lots of test images and wanting to build against those. I would also like to add a travis Dockerfile at some point but at the moment what exactly goes into one of those is a little opaque to me.

Thanks for clarifying, and I agree this feature is really nice in general.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines

---
NB: I dropped the awk magic that verifies the image exists before running. I couldn't get the thing to work in my shell so wasn't quite sure what it was doing.

Quoted 5 lines
Quoted 2 lines

It was to allow "make docker-test" to skip debian-bootstrap image if it is not there (e.g. when qemu-user not available).

Ahh ok. I got a little confused as the docker images command can filter things based on tag so maybe we can come up with a cleaner test?

For once it used a format option of "docker images" that isn't available on RHEL 7, per requested I changed it to the unobvious awk test.

Quoted 7 lines
Quoted 5 lines

I'm not much too concerned about that though, since most of the time we will use docker-FOO@BAR, for specific combinations, instead of docker-test for a blanket coverage.

What does patchew use?

The general strategy of patchew is good coverage of both tests and images, without multiplexing them which could make testing one patch infinitely long on a simple minded tester.

For now, we have:

docker-test-quick@centos6
docker-test-mingw@fedora

Quoted 7 lines

And staging (pending because of some mysterious false positives):

docker-test-quick@min-glib

I also plan to extend to centos7 and ubuntu in the middle term, and give cross compiling for OSX a try in the long run (googling says it's technically possible).

FWIW we already have some coverage of the MacOSX builds via Travis (although being able to run it quickly on a dev system would be useful).

Quoted 4 lines

I haven't prioritied debootstrap for now, because arm is not too different than x86 in terms of endianness and stuff, and qemu-user is probably much slower than native compilers.

It is much slower although qemu-user can at least take advantage of all those extra cores on your server ;-)

32 bit builds are also an area that needs good coverage as I'm pretty sure most devs have only x86_64 boxes these days.

Quoted 4 lines

But still, BE images will be a compelling reason, if there comes one.

Fam

--
Alex Bennée

#5 lore raw
Quoted 3 lines · Alex Bennée

FWIW we already have some coverage of the MacOSX builds via Travis (although being able to run it quickly on a dev system would be useful).

Being able to detect breakage earlier than a pull req bounce from Peter would also be good.

Quoted 11 lines
Quoted 5 lines

I haven't prioritied debootstrap for now, because arm is not too different than x86 in terms of endianness and stuff, and qemu-user is probably much slower than native compilers.

It is much slower although qemu-user can at least take advantage of all those extra cores on your server ;-)

32 bit builds are also an area that needs good coverage as I'm pretty sure most devs have only x86_64 boxes these days.

Yes, test-mingw has it.

Fam

#6 lore raw
Quoted 7 lines · Fam Zheng
Quoted 3 lines · Alex Bennée

FWIW we already have some coverage of the MacOSX builds via Travis (although being able to run it quickly on a dev system would be useful).

Being able to detect breakage earlier than a pull req bounce from Peter would also be good.

True. Although more people have started enabling Travis on their private git trees, we just don't see it as much as IRC doesn't get spammed for anything other than runs against the official tree.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I haven't prioritied debootstrap for now, because arm is not too different than x86 in terms of endianness and stuff, and qemu-user is probably much slower than native compilers.

Quoted 7 lines
Quoted 5 lines

It is much slower although qemu-user can at least take advantage of all those extra cores on your server ;-)

32 bit builds are also an area that needs good coverage as I'm pretty sure most devs have only x86_64 boxes these days.

Yes, test-mingw has it.

Ahh cool :-)

--
Alex Bennée