Installation

Timotheus Pokorra edited this page May 21, 2018 · 36 revisions

Goal

In the end, we want to build LightBuildServer packages for Ubuntu and for Fedora, so that the server can easily be installed: the server builds itself, so to speak :)

Current situation

We only support CentOS7, Fedora 27 and Ubuntu 18.04 as hosts for the build containers at the moment. More Linux distributions might follow if there is enough interest.

For the control server, there is now an UWSGI based setup for Fedora 27. If there are volunteers, feel free to contribute packages for other distributions as well!

Quick Install script (dply)

We have an install script that runs on CentOS 7, and sets up a demo server very easily!

You can create a free server for 2 hours at dply.co by hitting this button:

CentOS 7 as host of the build containers

yum install yum-utils epel-release
yum-config-manager --add-repo https://download.solidcharity.com/repos/tpokorra/lbs/centos/7/lbs-tpokorra-lbs.repo
yum install lxc-scripts
systemctl enable libvirtd
systemctl start libvirtd
/usr/share/lxc-scripts/initLXC.sh
/usr/share/lxc-scripts/initIPTables.sh
# only if you are using lxc
/usr/share/lxc-scripts/tunnelport.sh 5 22
# for switching from lxc to docker, do this: 
/usr/share/lxc-scripts/tunnelport.sh 5 -22

Ubuntu 18.04 as host of the build containers

Add the repository for the lxc scripts that are needed for configuring the containers:

echo 'deb https://lbs.solidcharity.com/repos/tpokorra/lbs/ubuntu/bionic/ bionic main' >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x4796B710919684AC

Now install:

apt-get update
apt-get install lxc cgroup-lite python3-lxc lxc-scripts
/usr/share/lxc-scripts/initLXC.sh
/usr/share/lxc-scripts/initIPTables.sh
# only if you are using lxc
/usr/share/lxc-scripts/tunnelport.sh 5 22
# for switching from lxc to docker, do this: 
/usr/share/lxc-scripts/tunnelport.sh 5 -22

Fedora 27 as host of the build containers

dnf install 'dnf-command(config-manager)'
dnf config-manager --add-repo https://download.solidcharity.com/repos/tpokorra/lbs/fedora/27/lbs-tpokorra-lbs.repo
dnf install lxc-scripts
systemctl enable libvirtd
systemctl start libvirtd
/usr/share/lxc-scripts/initLXC.sh
/usr/share/lxc-scripts/initIPTables.sh
# only if you are using lxc
/usr/share/lxc-scripts/tunnelport.sh 5 22
# for switching from lxc to docker, do this: 
/usr/share/lxc-scripts/tunnelport.sh 5 -22

Fedora 27: install the control server

dnf install 'dnf-command(config-manager)'
dnf config-manager --add-repo https://download.solidcharity.com/repos/tpokorra/lbs/fedora/27/lbs-tpokorra-lbs.repo
dnf install lightbuildserver
# when asked for a password, leave it empty! this key will be used to connect to the hosts for the build containers
/usr/share/lightbuildserver/init.sh
mysql
    CREATE DATABASE lbs  DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
    GRANT ALL ON lbs.* TO lbs@localhost IDENTIFIED BY 'TODOsecret';

At the moment, the website will only run on http://localhost. Please insert the hostname in /etc/nginx/conf.d/lightbuildserver.conf

Upload the public key to the container:

container="build02.lbs.solidcharity.com"
echo "put /etc/lightbuildserver/container/container_rsa.pub" | sftp root@$container
ssh root@$container -C "mkdir -p .ssh; chmod 700 .ssh; echo >> .ssh/authorized_keys; chmod 700 ssh/authorized_keys; cat container_rsa.pub >> .ssh/authorized_keys; rm container_rsa.pub; passwd -d root"

Getting started

See config files for details how you can configure your LightBuildServer!

See Project and Package Layout how you can define how packages should be built!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.