From 69d2544357e7cd498ff3fd306eb55ced2c2b54e061fa58f076ad7edc613d72b6 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Tue, 27 Jun 2023 04:19:30 +0000 Subject: [PATCH] Accepting request 1095504 from home:tserong:branches:filesystems:ceph - Remove _constraints file, add README-constraints.txt and pre_checkin.env OBS-URL: https://build.opensuse.org/request/show/1095504 OBS-URL: https://build.opensuse.org/package/show/filesystems:ceph/ceph?expand=0&rev=347 --- README-ceph-test.txt | 6 ---- README-constraints.txt | 31 ++++++++++++++++++ _constraints | 72 ------------------------------------------ ceph-test.changes | 5 +++ ceph.changes | 5 +++ pre_checkin.env | 5 +++ pre_checkin.sh | 13 ++++++-- 7 files changed, 57 insertions(+), 80 deletions(-) create mode 100644 README-constraints.txt delete mode 100644 _constraints create mode 100644 pre_checkin.env diff --git a/README-ceph-test.txt b/README-ceph-test.txt index 4f3092f..3338b5a 100644 --- a/README-ceph-test.txt +++ b/README-ceph-test.txt @@ -23,9 +23,3 @@ files for Ceph would be tricky, error-prone, and labor-intensive. Nathan Cutler April 17, 2017 - - -Addendum: ceph-test also requires more disk space to build than ceph. -The pre_checkin.sh script writes #!BuildConstraint lines to both spec -files to set things up correctly. See the comments in _constraints for -more details. diff --git a/README-constraints.txt b/README-constraints.txt new file mode 100644 index 0000000..2f92142 --- /dev/null +++ b/README-constraints.txt @@ -0,0 +1,31 @@ +2023-06-13 - Tim Serong + +Ceph needs plenty of disk space and RAM in order to build. To set +minimum requirements for these, we're using #!BuildConstraint directives +in ceph.spec and ceph-test.spec. We were previously using a _constraints +file, but this was shown to not always work correctly with _multibuild. +For more information about #!BuildConstraint directives see +https://github.com/openSUSE/obs-docu/pull/285, and in particular Darix's +comment that you shouldn't mix _constraints and #!BuildConstraint. + +The #!BuildConstraint directives are added to the spec files automatically +by the pre_checkin.sh script. If the disk and memory constraints need to +be changed in future, adjust the variables in the pre_checkin.env file and +re-run pre_checkin.sh. + +The current constraints are based on builds of ceph 16.2.7 on build.suse.de, +which showed the following resource usage (in MB): + +ceph aarch64 max disk: 41568 max mem: 13698 (on ibs-centriq-6:3 disk: 65536 mem: 18432) +ceph x86_64 max disk: 41621 max mem: 9852 (on sheep74:2 disk: 51200 mem: 12500) +ceph ppc64le max disk: 42005 max mem: 8754 (on ibs-power9-10:1 disk: 61440 mem: 20480) +ceph s390x max disk: 40698 max mem: 8875 (on s390zl36:1 disk: 51200 mem: 10240) +ceph-test x86_64 max disk: 51760 max mem: 16835 (on sheep94:2 disk: 112640 mem: 16384) + +Based on the above, and to hopefully provide a little wiggle room for +the future while at the same time not being too demanding of workers, +the minimum disk size is 50GB for ceph and 60GB for ceph-test. Memory +requirements remain at 8GB and 10GB respectively as they were before I +did the above tests - despite the memory usage shown above, AFAIK we +haven't run out of memory during builds, and this keeps the pool of +possible workers noticeably larger than it would be if we required 16GB. diff --git a/_constraints b/_constraints deleted file mode 100644 index e0676a9..0000000 --- a/_constraints +++ /dev/null @@ -1,72 +0,0 @@ - - - - kvm - - - - - diff --git a/ceph-test.changes b/ceph-test.changes index 8bebb52..0a60075 100644 --- a/ceph-test.changes +++ b/ceph-test.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 27 01:08:52 UTC 2023 - Tim Serong + +- Remove _constraints file, add README-constraints.txt and pre_checkin.env + ------------------------------------------------------------------- Wed May 24 06:26:03 UTC 2023 - Tim Serong diff --git a/ceph.changes b/ceph.changes index 8bebb52..0a60075 100644 --- a/ceph.changes +++ b/ceph.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 27 01:08:52 UTC 2023 - Tim Serong + +- Remove _constraints file, add README-constraints.txt and pre_checkin.env + ------------------------------------------------------------------- Wed May 24 06:26:03 UTC 2023 - Tim Serong diff --git a/pre_checkin.env b/pre_checkin.env new file mode 100644 index 0000000..22a70bb --- /dev/null +++ b/pre_checkin.env @@ -0,0 +1,5 @@ +# build constraints in GB (see README-constraints.txt) +CEPH_BUILD_DISK_SIZE_GB="50" +CEPH_BUILD_MEMORY_SIZE_GB="8" +CEPH_TEST_BUILD_DISK_SIZE_GB="60" +CEPH_TEST_BUILD_MEMORY_SIZE_GB="10" diff --git a/pre_checkin.sh b/pre_checkin.sh index 980647c..3e4ced9 100644 --- a/pre_checkin.sh +++ b/pre_checkin.sh @@ -283,6 +283,15 @@ function set_build_constraints { PACKAGE="ceph-test" SPEC_FILE="ceph.spec" +source ./pre_checkin.env +if [ -z "$CEPH_BUILD_DISK_SIZE_GB" -o \ + -z "$CEPH_BUILD_MEMORY_SIZE_GB" -o \ + -z "$CEPH_TEST_BUILD_DISK_SIZE_GB" -o \ + -z "$CEPH_TEST_BUILD_MEMORY_SIZE_GB" ]; then + echo "ERROR: build constraints not set (see README-constraints.txt)"; + exit 1 +fi + files=`packages_files $SPEC_FILE $PACKAGE` if [[ "$?" == "1" ]]; then echo "ERROR: " @@ -302,5 +311,5 @@ insert_line_before "$PACKAGE.spec" "Source96: pre_checkin.sh" "^Source97:" insert_line_before "$PACKAGE.spec" "Source95: checkin.sh" "^Source96:" insert_line_before "$PACKAGE.spec" "Source94: ceph-rpmlintrc" "^Source95:" copy_changes_file $PACKAGE -set_build_constraints $SPEC_FILE "hardware:disk:size unit=G 50" "hardware:memory:size unit=G 8" -set_build_constraints "$PACKAGE.spec" "hardware:disk:size unit=G 60" "hardware:memory:size unit=G 10" +set_build_constraints $SPEC_FILE "hardware:disk:size unit=G ${CEPH_BUILD_DISK_SIZE_GB}" "hardware:memory:size unit=G ${CEPH_BUILD_MEMORY_SIZE_GB}" +set_build_constraints "$PACKAGE.spec" "hardware:disk:size unit=G ${CEPH_TEST_BUILD_DISK_SIZE_GB}" "hardware:memory:size unit=G ${CEPH_TEST_BUILD_MEMORY_SIZE_GB}"