6570
Comment:
|
6336
fix parallel issue
|
Deletions are marked like this. | Additions are marked like this. |
Line 26: | Line 26: |
apt-get install libdbi-perl libyaml-tiny-perl libhash-merge-perl libstring-format-perl libtimedate-perl libdpkg-perl libdbd-pg-perl dctrl-tools | apt-get install libdbi-perl libyaml-tiny-perl libhash-merge-perl libstring-format-perl libtimedate-perl libdpkg-perl libdbd-pg-perl dctrl-tools moreutils |
Line 28: | Line 28: |
wanna-build needs {{{parallel}}} from package moreutils and not from package parallel |
|
Line 182: | Line 184: |
If the error message is: {{{ Tue Jul 10 20:13:29 CEST 2012: Running trigger for local ... Tue Jul 10 20:13:29 CEST 2012: Processing local/sid ... parallel: Error: Command (--Pas) starts with '-'. Is this a wrong option? Tue Jul 10 20:13:29 CEST 2012: local/sid done }}} Apply the patch [[attachment:trigger_common.patch]] |
Setting up a Wanna-Build Infrastructure on One Server
On this page, the wanna-build database setup is detailed and the configuration of build tools on one server. This may also regarded as the simplest case.
Getting wanna-build
Download wanna-build from the git repository.
mkdir /org cd /org/ git clone git://git.debian.org/mirror/wanna-build.git ln -s /org/wanna-build/bin/wanna-build /usr/local/bin/wanna-build
Note that /org is hardcoded in wanna-build.
Setting up Perl for wanna-build
wanna-build uses Perl and requires some additional modules.
apt-get install libdbi-perl libyaml-tiny-perl libhash-merge-perl libstring-format-perl libtimedate-perl libdpkg-perl libdbd-pg-perl dctrl-tools moreutils
wanna-build needs parallel from package moreutils and not from package parallel
Installing database
In this example, PostgreSQL will be used as database.
apt-get install postgresql
Generating SQLs for wanna-build
The database schema depends on the architectures which will be supported. So the first thing to do is to specify which architectures will be supported:
cd /org/wanna-build/schema/ vim arches-tables.sh
In the file arches-tables.sh, modify the ARCHES variable.
ARCHES="amd64 i386"
Then execute the script to generate SQL for the architecture specific data:
./arches-tables.sh
The file arches-tables.sql will be generated.
Importing the database
Switch to the PostgreSQL's superuser and start a client.
su postgres psql
Then create database and user for wanna-build.
CREATE DATABASE wannadb; CREATE USER wbadm WITH PASSWORD 'wannapass'; GRANT ALL PRIVILEGES ON DATABASE wannadb to wbadm; ALTER USER wbadm CREATEUSER CREATEROLE;
Finally, exit the client and import the SQL files of wanna-build:
psql -d wannadb -f roles.sql psql -d wannadb -f wanna-build.sql psql -d wannadb -f arches-tables.sql
Create the system user wbadm and a temp directory for it(it will be the account accessing to the database)
adduser --disabled-password --gecos "" wbadm mkdir -p /org/wanna-build/tmp chmod 750 /org/wanna-build/tmp/ chown wbadm. /org/wanna-build/tmp/
Configuring PostgreSQL to work with wanna-build
You need to configure services for wanna-build. There is a sample configuration file in /usr/share/postgresql/<version>/
# in Debian stable cp /usr/share/postgresql/8.4/pg_service.conf.sample /etc/postgresql-common/pg_service.conf # or cp /usr/share/postgresql/9.1/pg_service.conf.sample /etc/postgresql-common/pg_service.conf cat >> /etc/postgresql-common/pg_service.conf [wanna-build] dbname=wannadb user=wbadm [wanna-build-privileged] dbname=wannadb user=wbadm
Then press Ctrl+d to write the changes to the file.
You have to enable wanna-build to access the database. The simplest way to do that is to make all local connections to PostgreSQL trusted for the wanna-build user:
vim /etc/postgresql/8.4/main/pg_hba.conf
or
vim /etc/postgresql/9.1/main/pg_hba.conf
Add a line for the user wbadm to trust local access:
local all wbadm trust
WARNING Make sure that this is the first line that matches local login for wbadm.
Finally, restart PostgreSQL.
/etc/init.d/postgresql restart
Installing additional packages
Some of the tools that come with wanna-build require additional packages to work. In order to use these tools, you have to install these packages:
apt-get install parallel edos-debcheck
Note that Debian backports are necessary for parallel in a Debian Squeeze.
Insert architecture and distribution information into the database
Now we're going to insert some data into the database of wanna-build.
# as wbadm psql wannadb
We have to tell wanna-build the architectures and the distributions that we're going to support. We're also going to need additional entries for each (distribution,architecture) that wanna-build uses to lock the tables (thus preventing concurrency problems).
INSERT INTO distributions(distribution,build_dep_resolver,archive) VALUES ('sid','',''); INSERT INTO architectures(architecture) VALUES ('amd64'),('i386'); INSERT INTO distribution_architectures(distribution,architecture) VALUES ('sid','amd64'),('sid','i386'); INSERT INTO locks(distribution,architecture) VALUES ('sid','amd64'),('sid','i386');
Each distribution has zero or more aliases (alternative names). In this example we're going to create one alias to demonstrate the idea.
INSERT INTO distribution_aliases(distribution,alias) VALUES('sid','unstable');
Add packages to the database
Depending on your need you will want to use the official Debian repository or a custom one. In the triggers/ directory there are a number of scripts that will help you feed your wanna-build database with packages and sources information. There is a separate script for each archive (debian, security, volatile, etc.).
If you want to get packages and sources from a local repository you can use the trigger.local script. You may want to change the REPOSITORY variable in the script to where your repository is located.
Whatever script you choose to run, you have to do it with the wbadm user so that the script can access the database.
su wbadm triggers/trigger.local
Download trigger.local
Next steps
The next steps will concern the setup of buildd/sbuild and reprepro