Optimize image build/publish jobs

Zuul jobs are running out of space and failing. This attempts to
resolve by cleaning up between the build/publish of each image.

Switched to the ansible command module, since the make module doesn't
support multiple make targets.

Added a clean target to any image which didn't already have one, which
was just the ipa-downloader-image.

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: I36747a7cd858eef612f654f50a5c65f596e4a59d
This commit is contained in:
Sean Eagan 2021-04-02 12:48:33 -05:00
parent 2453c913a3
commit ec7e6f3fc9
4 changed files with 38 additions and 34 deletions

View File

@ -1,4 +1,4 @@
TOPTGTS := images lint all docs run_images tests TOPTGTS := images lint all docs run_images tests clean
IMAGES := $(wildcard */Makefile) IMAGES := $(wildcard */Makefile)
$(TOPTGTS): $(IMAGES) $(TOPTGTS): $(IMAGES)

View File

@ -90,4 +90,8 @@ images: build_ipa
tests: tests:
echo TODO echo TODO
.PHONY: images build_ipa tests clean:
docker image rm $(IMAGE)
# TODO: Clean up ipa builder container/image/artifacts
.PHONY: images build_ipa tests clean

View File

@ -38,10 +38,10 @@
when: pre_build_role is defined when: pre_build_role is defined
- name: Publish images - name: Publish images
block: block:
- make: - command: make images clean
args:
chdir: "{{ makefile_chdir }}" chdir: "{{ makefile_chdir }}"
target: "images" environment:
params:
AZ_SDK: "{{ az_sdk }}" AZ_SDK: "{{ az_sdk }}"
COMMIT: "{{ zuul.newrev | default('') }}" COMMIT: "{{ zuul.newrev | default('') }}"
DOCKER_REGISTRY: "{{ docker_registry }}" DOCKER_REGISTRY: "{{ docker_registry }}"

View File

@ -44,10 +44,10 @@
password: "{{ airship_images_quay_creds.password }}" password: "{{ airship_images_quay_creds.password }}"
registry_url: "{{ docker_registry }}" registry_url: "{{ docker_registry }}"
- name: Push Images with Latest and Commit Tags - name: Push Images with Latest and Commit Tags
make: command: make images clean
args:
chdir: "{{ makefile_chdir }}" chdir: "{{ makefile_chdir }}"
target: "images" environment:
params:
AZ_SDK: "{{ az_sdk }}" AZ_SDK: "{{ az_sdk }}"
COMMIT: "{{ zuul.newrev | default('') }}" COMMIT: "{{ zuul.newrev | default('') }}"
DOCKER_REGISTRY: "{{ docker_registry }}" DOCKER_REGISTRY: "{{ docker_registry }}"