From 2302170da1c3de2cd76ff7617ab43ee2297cb303 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Thu, 20 Mar 2014 16:21:26 +0000 Subject: Update config extension --- distbuild.configure | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/distbuild.configure b/distbuild.configure index 739a5d84..eb2ef04a 100644 --- a/distbuild.configure +++ b/distbuild.configure @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2013 Codethink Limited +# Copyright (C) 2013-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,8 +13,31 @@ # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# This is a "morph deploy" configure extension to configure a Baserock +# build node, as part of a distributed building cluster. It uses the +# following variables from the environment: +# +# * DISTBUILD_CONTROLLER: if 'yes', machine is set up as the controller. +# * DISTBUILD_WORKER: if 'yes', machine is set up as a worker. +# * TROVE_ID: hostname and Trove prefix of the server to pull source +# from and push built artifacts to. +# +# The following variable is optional: +# +# * ARTIFACT_CACHE_SERVER: by default artifacts are pushed to the same +# Trove that served the source, but you can use a different one. +# +# The following variable is required for worker nodes only: +# +# * CONTROLLERHOST: hostname or IP address of distbuild controller machine. +# * WORKER_SSH_KEY: identity used to authenticate with Trove +# +# The following variable is required for the controller node only: +# +# * WORKERS: hostnames or IP address of worker nodes, comma-separated. -set -eu +set -e # If ARTIFACT_CACHE_SERVER isn't set, default to $TROVE_ID. @@ -23,6 +46,8 @@ then ARTIFACT_CACHE_SERVER="$TROVE_ID" fi +set -u + # Create the mount point for extra disk space. install -d -o 0 -g 0 -m 0755 "$1/srv/distbuild" @@ -42,6 +67,7 @@ install -d -o 0 -g 0 -m 0755 "$1/srv/distbuild" cat < "$1/etc/morph.conf" [config] log = /var/log/morph.log +log-max = 100M cachedir = /srv/distbuild tempdir = /srv/distbuild/tmp trove-host = $TROVE_ID @@ -51,12 +77,6 @@ cachedir-min-space = 0 build-ref-prefix = $TROVE_ID artifact-cache-server = http://${ARTIFACT_CACHE_SERVER}:8080/ git-resolve-cache-server = http://${TROVE_ID}:8080/ -repo-alias = freedesktop=git://anongit.freedesktop.org/#ssh://git.freedesktop.org/, - github=git://github.com/%s#ssh://git@github.com/%s, - baserock=git://git.baserock.org/baserock/%s#ssh://git@git.baserock.org/baserock/%s, - gnome=git://git.gnome.org/%s#ssh://git.gnome.org/git/%s, - upstream=git://git.baserock.org/delta/%s#ssh://git@git.baserock.org/delta/%s, - codethink=ssh://git@git.codethink.co.uk/ct098/%s#ssh://git@git.codethink.co.uk/ct098/%s EOF @@ -71,6 +91,7 @@ then cat < "$1/etc/morph-controller.conf" [config] log = /var/log/morph-controller.log +log-max = 100M writeable-cache-server = http://${ARTIFACT_CACHE_SERVER}:8081/ worker = $WORKERS controller-helper-address = 127.0.0.1 @@ -82,6 +103,7 @@ EOF cat < "$1/etc/morph-controller-helper.conf" [config] log = /var/log/morph-controller-helper.log +log-max = 100M parent-port = 5656 parent-address = 127.0.0.1 EOF @@ -99,6 +121,7 @@ then cat < "$1/etc/morph-worker.conf" [config] log = /var/log/morph-worker.log +log-max = 100M controller-initiator-address = EOF @@ -112,6 +135,7 @@ EOF cat < "$1/etc/morph-worker-helper.conf" [config] log = /var/log/morph-worker-helper.log +log-max = 100M parent-address = 127.0.0.1 EOF @@ -127,4 +151,9 @@ direct-mode = True fcgi-server = False EOF +echo "Copy distbuild worker SSH key to system" +mkdir "$1/root/.ssh" +install -m 0600 "$WORKER_SSH_KEY" "$1/root/.ssh/id_rsa" +install -m 0644 "${WORKER_SSH_KEY}.pub" "$1/root/.ssh/id_rsa.pub" + fi -- cgit v1.2.1