build: prevent parallel build collisions for ceph

Prevent parallel build collisions in the 'ceph' image by building
prerequisites for the builds before running the build targets in
parallel. Build targets can collide and try to create the same target at
nearly the same time, causing failures.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
This commit is contained in:
Blaine Gardner committed 2021-11-30 08:09:24 -07:00
1 parent 113e2f849d
commit 51fc36d591
3 files changed
+11 -6

No files matched your search

+1 -1
View File
@@ -111,7 +111,7 @@ build.version:
@mkdir -p $(OUTPUT_DIR)
@echo "$(VERSION)" > $(OUTPUT_DIR)/version
build.common: build.version helm.build mod.check
build.common: build.version helm.build mod.check crds
@$(MAKE) go.init
@$(MAKE) go.validate
@$(MAKE) -C images/ceph list-image
+3 -1
View File
@@ -30,7 +30,9 @@ ceph.%:
@$(MAKE) -C ceph PLATFORM=$*
do.build: ceph.$(PLATFORM) ;
build.all: $(foreach p,$(PLATFORMS), ceph.$(p)) ; ## Build images for all platforms.
build.all: ## Build images for all platforms.
$(MAKE) -C ceph prerequisites
$(MAKE) $(foreach p,$(PLATFORMS), ceph.$(p)) ;
# ====================================================================================
# Help
+7 -4
View File
@@ -84,7 +84,8 @@ do.build:
ifeq ($(INCLUDE_CSV_TEMPLATES),true)
@$(MAKE) CSV_TEMPLATE_DIR=$(TEMP) generate-csv-templates
@$(MAKE) CRD_TEMPLATE_DIR=$(TEMP)/deploy/olm/templates/crds/ get-volume-replication-crds
@$(MAKE) get-volume-replication-crds
cp $(CACHE_DIR)/crds/* $(TEMP)/deploy/olm/templates/crds/.
@cp -r $(TEMP)/deploy/olm/templates $(TEMP)/ceph-csv-templates
else
mkdir $(TEMP)/ceph-csv-templates
@@ -99,6 +100,10 @@ endif
fi
@rm -fr $(TEMP)
# call this before building multiple arches in parallel to prevent parallel build processes from
# conflicting
prerequisites: $(OPERATOR_SDK) $(YQv3) get-volume-replication-crds
# generate CSV template files into the directory defined by the env var CSV_TEMPLATE_DIR
# CSV_TEMPLATE_DIR will be created if it doesn't already exist
generate-csv-templates: $(OPERATOR_SDK) $(YQv3) ## Generate CSV templates for OLM into CSV_TEMPLATE_DIR
@@ -122,13 +127,11 @@ generate-csv-templates: $(OPERATOR_SDK) $(YQv3) ## Generate CSV templates for OL
@echo " === Generated CSV templates can be found at $(CSV_TEMPLATE_DIR)/deploy/olm/templates"
get-volume-replication-crds:
@if [[ -z "$(CRD_TEMPLATE_DIR)" ]]; then echo "CRD_TEMPLATE_DIR is not set"; exit 1; fi
@if [[ ! -d "$(CACHE_DIR)/crds" ]]; then\
if [[ ! -d "$(CACHE_DIR)/crds" ]]; then\
mkdir -p $(CACHE_DIR)/crds;\
curl -L $(VOL_REPL_URL)/$(VOLUME_REPLICATION_CRD) -o $(CACHE_DIR)/crds/$(VOLUME_REPLICATION_CRD);\
curl -L $(VOL_REPL_URL)/$(VOLUME_REPLICATION_CLASS_CRD) -o $(CACHE_DIR)/crds/$(VOLUME_REPLICATION_CLASS_CRD);\
fi
@cp $(CACHE_DIR)/crds/* $(CRD_TEMPLATE_DIR)
$(YQv3):
@echo === installing yq $(YQv3_VERSION) $(REAL_HOST_PLATFORM)