diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7af86679..b992e1b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,8 @@ jobs: - "ubuntu-22.04-jammy-arm64v8" - "ubuntu-22.04-jammy-ppc64le" - "ubuntu-22.04-jammy-s390x" + # test image for manylinux-wheel build + - "ubuntu-22.04-jammy-amd64" # Then run the remainder - "alpine" - "amazon-2-amd64" @@ -33,12 +35,14 @@ jobs: - "fedora-36-amd64" - "fedora-37-amd64" - "gentoo" - - "manylinux2014-wheel-build" - "ubuntu-18.04-bionic-amd64" - "ubuntu-20.04-focal-amd64" - - "ubuntu-22.04-jammy-amd64" - "ubuntu-22.04-jammy-amd64-valgrind" + # has a dependency on the test image + - "manylinux2014-wheel-build" include: + - image: "manylinux2014-wheel-build" + test-image: "ubuntu-22.04-jammy-amd64" - image: "ubuntu-22.04-jammy-arm64v8" qemu-arch: "aarch64" - image: "ubuntu-22.04-jammy-ppc64le" @@ -65,6 +69,14 @@ jobs: fi sudo chown -R 1000 $(pwd) + - name: Test Image Build + if: "matrix.test-image" + run: | + cd "${{ matrix.test-image }}" + make pull || (sudo chmod a+w . && make update && make build BRANCH=main) + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + - name: Build image id: build run: | @@ -81,6 +93,8 @@ jobs: run: | cd "${{ matrix.image }}" make test BRANCH=main + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - name: Log image size run: | @@ -92,6 +106,8 @@ jobs: && github.ref == 'refs/heads/main' && matrix.target == 'latest'" run: make push-${{ matrix.image }} BRANCH=main + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - name: Post build if: always() diff --git a/Makefile b/Makefile index 2af5a222..d8a6ca6d 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ TARGETS = \ BUILDDIRS = $(TARGETS:%=build-%) PUSHDIRS = $(TARGETS:%=push-%) +PULLDIRS = $(TARGETS:%=pull-%) UPDATEDIRS = $(TARGETS:%=update-%) CLEANDIRS = $(TARGETS:%=clean-%) TESTDIRS = $(TARGETS:%=test-%) @@ -28,6 +29,7 @@ TESTDIRS = $(TARGETS:%=test-%) .PHONY: build update push test $(TARGETS) .PHONY: subdirs $(BUILDDIRS) .PHONY: subdirs $(PUSHDIRS) +.PHONY: subdirs $(PULLDIRS) .PHONY: subdirs $(UPDATEDIRS) .PHONY: subdirs $(CLEANDIRS) .PHONY: subdirs $(TESTDIRS) @@ -41,6 +43,10 @@ push: $(PUSHDIRS) $(PUSHDIRS): $(MAKE) -C $(@:push-%=%) push +pull: $(PULLDIRS) +$(PULLDIRS): + $(MAKE) -C $(@:pull-%=%) pull + update: $(UPDATEDIRS) $(UPDATEDIRS): $(MAKE) -C $(@:update-%=%) update diff --git a/Makefile.sub b/Makefile.sub index e0d362dd..f89dd064 100644 --- a/Makefile.sub +++ b/Makefile.sub @@ -1,9 +1,9 @@ WD = $(shell pwd) -USERNAME := $(shell docker info | grep Username | xargs | cut -d ' ' -f 2) TARGET := $(notdir $(WD)) ROOT := $(abspath $(WD)/../Pillow) -IMAGENAME := $(if $(USERNAME), $(USERNAME)/$(TARGET), $(TARGET)) +IMAGENAME := $(if $(DOCKER_USERNAME), $(DOCKER_USERNAME)/$(TARGET), $(TARGET)) BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +TEST_IMAGE := $(if $(DOCKER_USERNAME), $(DOCKER_USERNAME)/$(TARGET):$(BRANCH), pythonpillow/$(TARGET):main) .PHONY: build build: @@ -23,6 +23,10 @@ test: push: docker push $(IMAGENAME):$(BRANCH) +.PHONY: pull +pull: + docker pull $(TEST_IMAGE) + .PHONY: clean clean: rm -r depends diff --git a/manylinux2014-wheel-build/Makefile b/manylinux2014-wheel-build/Makefile index 74dd73a4..6d93ab51 100644 --- a/manylinux2014-wheel-build/Makefile +++ b/manylinux2014-wheel-build/Makefile @@ -1,11 +1,11 @@ WD = $(shell pwd) -USERNAME := $(shell docker info | grep Username | xargs | cut -d ' ' -f 2) TARGET := $(notdir $(WD)) ROOT := $(abspath $(WD)/../Pillow) -IMAGENAME := $(if $(USERNAME), $(USERNAME)/$(TARGET), $(TARGET)) +IMAGENAME := $(if $(DOCKER_USERNAME), $(DOCKER_USERNAME)/$(TARGET), $(TARGET)) BRANCH := $(shell git rev-parse --abbrev-ref HEAD) -TEST_TARGET = ubuntu-20.04-focal-amd64 -TEST_IMAGE=pythonpillow/$(TEST_TARGET) +TEST_TARGET = ubuntu-22.04-jammy-amd64 +TEST_IMAGE := $(if $(DOCKER_USERNAME), $(DOCKER_USERNAME)/$(TEST_TARGET):$(BRANCH), pythonpillow/$(TEST_TARGET):main) + .PHONY: build build: docker build -t $(IMAGENAME):$(BRANCH) . @@ -27,10 +27,12 @@ wheel: _PYVER=39 $(MAKE) wheel 310: _PYVER=310 $(MAKE) wheel +311: + _PYVER=311 $(MAKE) wheel .PHONY: test -test: 38 - docker run --rm -v $(ROOT):/Pillow -v `pwd`/out:/output $(TEST_IMAGE):$(BRANCH) sh -c "/vpy3/bin/pip install /output/*cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl && cd /Pillow && /vpy3/bin/python selftest.py && /usr/bin/xvfb-run -a /vpy3/bin/pytest -vx" +test: 310 + docker run --rm -v $(ROOT):/Pillow -v `pwd`/out:/output $(TEST_IMAGE) sh -c "/vpy3/bin/pip install /output/*cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl && cd /Pillow && /vpy3/bin/python selftest.py && /usr/bin/xvfb-run -a /vpy3/bin/pytest -vx" .PHONY: push push: diff --git a/manylinux2014-wheel-build/README.md b/manylinux2014-wheel-build/README.md index c4e98c90..865fefb2 100644 --- a/manylinux2014-wheel-build/README.md +++ b/manylinux2014-wheel-build/README.md @@ -16,9 +16,9 @@ symbols for debugging with Valgrind/GDB. The Makefile has several new commands: -* make wheel: Makes a Python 3.8 manylinux2014 wheel, and puts it in the +* make wheel: Makes a Python 3.10 manylinux2014 wheel, and puts it in the ./out directory. -* make 37|38|39|310: These are specific commands to make +* make 37|38|39|310|311: These are specific commands to make the corresponding 3.x version in the ./out directory. The test target here is mainly to validate the image build, it is diff --git a/manylinux2014-wheel-build/build.sh b/manylinux2014-wheel-build/build.sh index d51e89a2..b966191b 100755 --- a/manylinux2014-wheel-build/build.sh +++ b/manylinux2014-wheel-build/build.sh @@ -16,9 +16,9 @@ fi # not strictly necessary, unless running multiple versions from the shell rm -f /tmp/*.whl || true -# Python version, as 37,38,39,310. Defaults to 38. +# Python version, as 37,38,39,310,311. Defaults to 310. # Matches the naming in /opt/python/ -PYVER=${1:-38} +PYVER=${1:-310} PYBIN=$(echo /opt/python/cp${PYVER}*/bin) # We have to clean up the Pillow directories, otherwise we might get