#!/bin/sh # Script to build a defined set of definitions set -ex system_name="$1" system_arch="$2" definitions_dir="$(pwd)/definitions" ybd_dir="$(pwd)/ybd" # Experimentally we have seen no benefit to a single build with greater # than max-jobs: 10, though 8 divides up more nicely, so we previously # had 5 builders with 8 cores each for the parallel build on the meaty # x86 VPS, but we'd like to see some parallelism on the ARM builders, # which have 8 CPUs total, so we'd need to have 4 to see any parallelism. cpus_per_instance=4 # Determine the number of instances to have such that each has at least # the specified number of CPUs but not more than double it. # STYLE NOTE: Substitutions are intentionally not quoted here, since in # some shells arithmetic expansion doesn't follow the traditional POSIX # word splitting, so quotes aren't removed. instances="$(( $(nproc) / $cpus_per_instance == 0 ? 1 : $(nproc) / $cpus_per_instance ))" sudo sed -i "/^instances: /c\\instances: $instances" "$ybd_dir"/ybd.conf # will this build things - No. # "$ybd_dir"/ybd.py "$definitions_dir"/systems/"$system_name" # try changing to the definitions dir then building # ybd seems to set the "target" to be current dir, regardless cd "$definitions_dir" sudo "$ybd_dir"/ybd.py systems/"$system_name" "$system_arch"