Merge pull request #7783 from leseb/fix-build-all
build: fix parallel build
This commit is contained in:
4 files changed
+60
-24
No files matched your search
@@ -1,4 +1,4 @@
|
||||
name: MacOS build
|
||||
name: Builds
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
@@ -44,6 +44,29 @@ jobs:
|
||||
working-directory: /Users/runner/go/src/github.com/rook/rook
|
||||
run: tests/scripts/validate_modified_files.sh crd
|
||||
|
||||
- name: setup tmate session for debugging
|
||||
if: failure()
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
|
||||
linux-build-all:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup golang
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: set up QEMU
|
||||
uses: docker/setup-qemu-action@master
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: build.all rook
|
||||
run: tests/scripts/github-action-helper.sh build_rook_all
|
||||
|
||||
- name: setup tmate session for debugging
|
||||
if: failure()
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
##################
|
||||
@@ -76,7 +76,8 @@ ROOK_OP_VERSION=$3
|
||||
#############
|
||||
# VARIABLES #
|
||||
#############
|
||||
SED_I=${SED_CMD:-"sed -i'' -e"}
|
||||
SED_I=(sed -i'' -e)
|
||||
[ -n "$SED_CMD" ] || read -ra SED_CMD <<< "${SED_I[@]}"
|
||||
YQ_CMD_DELETE=($yq delete -i)
|
||||
YQ_CMD_MERGE_OVERWRITE=($yq merge --inplace --overwrite --prettyPrint)
|
||||
YQ_CMD_MERGE=($yq merge --inplace --append -P )
|
||||
@@ -222,26 +223,26 @@ function hack_csv() {
|
||||
# rook-ceph-osd --> serviceAccountName
|
||||
# rook-ceph-osd --> rule
|
||||
|
||||
$SED_I 's/rook-ceph-global/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/rook-ceph-object-bucket/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/rook-ceph-cluster-mgmt/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rook-ceph-global/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rook-ceph-object-bucket/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rook-ceph-cluster-mgmt/rook-ceph-system/' "$CSV_FILE_NAME"
|
||||
|
||||
$SED_I 's/rook-ceph-mgr-cluster/rook-ceph-mgr/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/rook-ceph-mgr-system/rook-ceph-mgr/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rook-ceph-mgr-cluster/rook-ceph-mgr/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rook-ceph-mgr-system/rook-ceph-mgr/' "$CSV_FILE_NAME"
|
||||
|
||||
$SED_I 's/cephfs-csi-nodeplugin/rook-csi-cephfs-plugin-sa/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/cephfs-external-provisioner-runner/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/cephfs-csi-nodeplugin/rook-csi-cephfs-plugin-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/cephfs-external-provisioner-runner/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
|
||||
$SED_I 's/rbd-csi-nodeplugin/rook-csi-rbd-plugin-sa/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/rbd-external-provisioner-runner/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rbd-csi-nodeplugin/rook-csi-rbd-plugin-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rbd-external-provisioner-runner/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
# The operator-sdk also does not properly respect when
|
||||
# Roles differ from the Service Account name
|
||||
# The operator-sdk instead assumes the Role/ClusterRole is the ServiceAccount name
|
||||
#
|
||||
# To account for these mappings, we have to replace Role/ClusterRole names with
|
||||
# the corresponding ServiceAccount.
|
||||
$SED_I 's/cephfs-external-provisioner-cfg/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
$SED_I 's/rbd-external-provisioner-cfg/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/cephfs-external-provisioner-cfg/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
"${SED_I[@]}" 's/rbd-external-provisioner-cfg/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME"
|
||||
}
|
||||
|
||||
function generate_package() {
|
||||
|
||||
+10
-8
@@ -82,14 +82,16 @@ do.build: generate-csv-ceph-templates
|
||||
|
||||
generate-csv-ceph-templates: $(OPERATOR_SDK) $(YQ)
|
||||
@if [ ! "$(INCLUDE_CSV_TEMPLATES)" = "" ]; then\
|
||||
BEFORE_GEN_CRD_SIZE=$$(wc -l < ../../cluster/examples/kubernetes/ceph/crds.yaml);\
|
||||
$(MAKE) -C ../.. NO_OB_OBC_VOL_GEN=true MAX_DESC_LEN=0 crds;\
|
||||
AFTER_GEN_CRD_SIZE=$$(wc -l < ../../cluster/examples/kubernetes/ceph/crds.yaml);\
|
||||
if [ "$$BEFORE_GEN_CRD_SIZE" -le "$$AFTER_GEN_CRD_SIZE" ]; then\
|
||||
echo "the new crd file must be smaller since the description fields were stripped!";\
|
||||
echo "length before $$BEFORE_GEN_CRD_SIZE";\
|
||||
echo "length after $$AFTER_GEN_CRD_SIZE";\
|
||||
exit 1;\
|
||||
if [ "$(GOARCH)" = amd64 ]; then\
|
||||
BEFORE_GEN_CRD_SIZE=$$(wc -l < ../../cluster/examples/kubernetes/ceph/crds.yaml);\
|
||||
$(MAKE) -C ../.. NO_OB_OBC_VOL_GEN=true MAX_DESC_LEN=0 crds;\
|
||||
AFTER_GEN_CRD_SIZE=$$(wc -l < ../../cluster/examples/kubernetes/ceph/crds.yaml);\
|
||||
if [ "$$BEFORE_GEN_CRD_SIZE" -le "$$AFTER_GEN_CRD_SIZE" ]; then\
|
||||
echo "the new crd file must be smaller since the description fields were stripped!";\
|
||||
echo "length before $$BEFORE_GEN_CRD_SIZE";\
|
||||
echo "length after $$AFTER_GEN_CRD_SIZE";\
|
||||
exit 1;\
|
||||
fi;\
|
||||
fi;\
|
||||
../../cluster/olm/ceph/generate-rook-csv-templates.sh;\
|
||||
fi
|
||||
|
||||
@@ -79,13 +79,23 @@ function create_bluestore_partitions_and_pvcs_for_wal(){
|
||||
}
|
||||
|
||||
function build_rook() {
|
||||
build_type=build
|
||||
if [ -n "$1" ]; then
|
||||
build_type=$1
|
||||
fi
|
||||
GOPATH=$(go env GOPATH) make clean
|
||||
# set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version"
|
||||
make -j$nproc IMAGES='ceph' VERSION=0 build
|
||||
make -j$nproc IMAGES='ceph' VERSION=0 "$build_type"
|
||||
# validate build
|
||||
tests/scripts/validate_modified_files.sh build
|
||||
docker images
|
||||
docker tag $(docker images | awk '/build-/ {print $1}') rook/ceph:master
|
||||
if [[ "$build_type" == "build" ]]; then
|
||||
docker tag $(docker images | awk '/build-/ {print $1}') rook/ceph:master
|
||||
fi
|
||||
}
|
||||
|
||||
function build_rook_all() {
|
||||
build_rook build.all
|
||||
}
|
||||
|
||||
function validate_yaml() {
|
||||
|
||||
Reference in new issue
Block a user