armbian-next: cli: distccd launcher for build farm

- relaunched under docker
- possibly much nicer if zeroconf enabled?
- this thing is ignoring signals. can't ctrl-c out of it. why? @TODO
- pt 1, subpt 3: distccd - distcc-pump - avahi
- pt 1, subpt 3: distccd + distcc-pump
- pt 1, subpt 2: distccd + avahi
- pt 1, subpt 1: distccd
This commit is contained in:
Ricardo Pardini
2022-10-28 00:13:12 +02:00
parent da0b3080a0
commit 093336e914
4 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
function cli_distccd_pre_run() {
: <<- 'HEADER'
Sets up an inline extension to include distccd in dependencies.
HEADER
display_alert "cli_distccd_pre_run" "func cli_distccd_run :: ${ARMBIAN_COMMAND}" "warn"
# When being relaunched in Docker, I wanna add port-forwardings to the distccd ports.
declare -g DOCKER_EXTRA_ARGS+=("-p" "3632:3632" "-p" "3633:3633")
# "gimme root on a Linux machine"
cli_standard_relaunch_docker_or_sudo
}
function cli_distccd_run() {
: <<- 'HEADER'
Runs distccd in the foreground.
HEADER
# Initialize the extension manager. distccd has no boards/etc.
initialize_extension_manager
# Install hostdeps. Call directly the requirements cli command, they know what they're doing.
cli_requirements_run
display_alert "cli_distccd_run" "func cli_distccd_run" "warn"
# remove all bash traps
trap - INT TERM EXIT
# @TODO: --zeroconf (not if under Docker)
# @TODO: --jobs (CPU count!)
display_alert "Run it yourself" "distccd --allow-private --verbose --no-detach --daemon --stats --log-level info --log-stderr --listen 0.0.0.0 --zeroconf" "warn"
}

View File

@@ -18,6 +18,7 @@ function armbian_register_commands() {
["json-info"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run ["json-info"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run
["build"]="standard_build" # implemented in cli_standard_build_pre_run and cli_standard_build_run ["build"]="standard_build" # implemented in cli_standard_build_pre_run and cli_standard_build_run
["distccd"]="distccd" # implemented in cli_distccd_pre_run and cli_distccd_run
["undecided"]="undecided" # implemented in cli_undecided_pre_run and cli_undecided_run - relaunches either build or docker ["undecided"]="undecided" # implemented in cli_undecided_pre_run and cli_undecided_run - relaunches either build or docker
) )

View File

@@ -233,6 +233,9 @@ function early_prepare_host_dependencies() {
pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig
u-boot-tools udev uuid-dev whiptail u-boot-tools udev uuid-dev whiptail
zlib1g-dev busybox fdisk zlib1g-dev busybox fdisk
# distcc, experimental, optional; see cli-distcc.sh and kernel.sh
distcc
# python2, including headers, mostly used by some u-boot builds (2017 et al, odroidxu4 and others). # python2, including headers, mostly used by some u-boot builds (2017 et al, odroidxu4 and others).
python2 python2-dev python2 python2-dev

View File

@@ -46,6 +46,15 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
# shellcheck source=lib/functions/cli/cli-configdump.sh # shellcheck source=lib/functions/cli/cli-configdump.sh
source "${SRC}"/lib/functions/cli/cli-configdump.sh source "${SRC}"/lib/functions/cli/cli-configdump.sh
# no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled
set -o errtrace # trace ERR through - enabled
set -o errexit ## set -e : exit the script if any statement returns a non-true return value - enabled
### lib/functions/cli/cli-distccd.sh
# shellcheck source=lib/functions/cli/cli-distccd.sh
source "${SRC}"/lib/functions/cli/cli-distccd.sh
# no errors tolerated. invoked before each sourced file to make sure. # no errors tolerated. invoked before each sourced file to make sure.
#set -o pipefail # trace ERR through pipes - will be enabled "soon" #set -o pipefail # trace ERR through pipes - will be enabled "soon"
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled #set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled