update Mon Jun 14 06:37:00 PDT 2010
[pkgsrc.git] / doc / HOWTO-pbulk
1 Step One: Suggested File System Layout
2
3 For the DragonFly builds I'm using:
4 - /bulklog for the bulk meta data and log files of each package
5 - /scratch as WRKOBJDIR
6 - /distfiles as DISTDIR
7 - /packages as PACKAGES
8 - separate physical file systems for /var and /usr/pkg
9 All file systems but those are read-only, /tmp and /dev need platform
10 specific handling either as tmpfs or link. ptyfs helps for /dev.
11
12 For parallel builds, /bulklog, /packages and /usr/pkgsrc are supposed to
13 be shared (null mounts, NFS). /usr/pkg and /var/db/pkg needs to be
14 per-node and /scratch should be per-node.
15
16 The defaults scripts will remove /usr/pkg and /var/db/pkg on the master
17 node as well. When using chroot sandboxes for the build, the master can
18 share a sandbox with one of the build instances.
19
20 Step Two: Preparing pbulk prefix
21
22 Install pkgtools/pbulk and possibly helper programs like screen into
23 LOCALBASE=/usr/pkg_bulk, PKG_DBDIR=/usr/pkg_bulk/.pkgdb. A full
24 bootstrap is the recommended approach. Copy /usr/pkg_bulk to the client
25 nodes for parallel builds.
26
27 The initial bootstrap and install may be performed with the following commands:
28
29     cd /usr/pkgsrc/bootstrap
30     ./bootstrap --prefix=/usr/pkg_bulk --pkgdbdir=/usr/pkg_bulk/.pkgdb 
31
32 If you have already performed a bootstrap into /usr/pkg_bulk then you may need 
33 to remove that directory (rm -fr /usr/pkg_bulk) prior to starting the new
34 bootstrap.
35
36 pbulk may be installed into /usr/pkg_bulk with the following:
37
38 cd /usr/pkgsrc/pkgtools/pbulk
39 env PATH=/usr/pkg_bulk/bin:/usr/pkg_bulk/sbin:${PATH} bmake package
40
41 The mk.conf file in /usr/pkg_bulk/etc/mk.conf should already have the
42 correct LOCALBASE and PKG_DBDIR settings.
43
44 Step Three: Configure pbulk
45
46 (a)
47 Setup general build parameters in mk.conf. Below is an example
48 fragment to add.  On NetBSD this is typically /etc/mk.conf.  For
49 non-NetBSD systems we will create a mk.conf in a temporary location,
50 /tmp/mk.conf for example, and include it in the bootstrap that will
51 be built in step (b).
52
53 (b) [not for NetBSD]
54 Build a binary bootstrap kit and override the included mk.conf with the
55 file created in (a). Compress the tarball with gzip.  This is a new
56 bootstrap that is different from the one created in Step Two above.
57
58 This bootstrap kit is created by the following:
59
60
61     cd /usr/pkgsrc/bootstrap
62     ./bootstrap --mk-fragment /tmp/mk.conf \
63         --gzip-binary-kit bootstrap_kit.tar.gz
64
65 Note that we have specified the make file fragment, /tmp/mk.conf, created
66 in step (a) above.
67
68 (c)
69 Edit /usr/pkg_bulk/etc/pbulk.conf:
70 - For NetBSD:
71   - bootstrapkit should be empty.
72   - make must be changed to /usr/bin/make.
73
74 - For non-NetBSD:
75   - bootstrapkit should be changed to the tarball in (b). Both master
76     and client nodes access this, so keep it in a shared location.
77
78 - master_mode=yes needs a proper list of client nodes.
79 - base_url goes into the report mail, the rsync targets are used
80   for uploads.
81 - for limited bulk builds, set limited_list to a file with one
82   location per line ("x11/gtk2" for example).  Packages that are required
83   as dependencies will be added automatically.
84
85 Step Four: Running pbulk
86
87 /usr/pkg_bulk/bin/bulkbuild runs the full build.  You may wish to run
88 this inside of screen (misc/screen) since a full bulk build may take
89 a very long time.
90
91 /usr/pkg_bulk/libexec/pbulk/{pre-build,scan,build,report,upload} are the
92 individual build phases. They depend on the execution of the phase
93 before. Exceptions are report and upload which both depend on build.
94
95 /usr/pkg_bulk/bin/bulkbuild-restart can be used to resume an aborted
96 build. If it failed after the actual build phase, report and upload should
97 be called individually though.
98
99 --- sample mk.conf fragment ---
100
101 WRKOBJDIR = /scratch
102 PKGSRCDIR = /usr/pkgsrc
103 DISTDIR = /distfiles
104 PACKAGES = /packages
105
106 FAILOVER_FETCH= yes
107
108 X11_TYPE=       modular
109
110 SKIP_LICENSE_CHECK=                     yes
111 ALLOW_VULNERABLE_PACKAGES=      yes
112
113 PKG_DEVELOPER?= yes