9a04aefedf4698c0cd57c6a7112a356e6c4edb03
[ikiwiki.git] / docs / howtos / How_To_Create_Official_Synth_Repo / index.mdwn
1 ## How to Create an Official Synth Repo
2
3 ### System Environment
4
5 * Make sure /usr/dports is updated and that it contains no cruft (git pull; git status).  Remove any cruft.
6
7 * Make sure your 'synth' is up-to-date 'pkg upgrade synth'. If you already updated your system you may have to build synth from scratch, from /usr/dports/ports-mgmt/synth.
8
9 * Make sure /etc/make.conf is clean.
10
11 * Update /usr/src to the current master, make sure there is no cruft in it
12
13 * Do a full buildworld, buildkernel, installkernel and installworld
14
15 * Reboot
16
17 ### Synth Environment
18
19 * /usr/local/etc/synth/ contains the synth configuation.  It should contain a synth.ini file (you may have to rename the template), and you will have to create or edit a LiveSystem-make.conf file.
20
21 * System requirements are hefty.  Just linking chromium alone eats at least 30GB, for example.  Concurrent c++ compiles can eat up to 2GB per process.  We recommend at least 100GB of SSD based swap space and 300GB of free space on the filesystem.
22
23 * synth.ini should contain this.  Plus modify the builders and jobs to suit your system.  With 128G of ram, 30/30 or 40/25 works well.  If you have 32G of ram, maybe 8/8 or less.
24
25 <pre>
26     ; Take care when hand editing!
27
28     [Global Configuration]
29     profile_selected= LiveSystem
30
31     [LiveSystem]
32     Operating_system= DragonFly
33     Directory_packages= /build/synth/live_packages
34     Directory_repository= /build/synth/live_packages/All
35     Directory_portsdir= /build/synth/dports
36     Directory_options= /build/synth/options
37     Directory_distfiles= /usr/distfiles
38     Directory_buildbase= /build/synth/build
39     Directory_logs= /build/synth/logs
40     Directory_ccache= disabled
41     Directory_system= /
42     Number_of_builders= 30
43     Max_jobs_per_builder= 30
44     Tmpfs_workdir= true
45     Tmpfs_localbase= true
46     Display_with_ncurses= true
47     leverage_prebuilt= false
48 </pre>
49
50 * LiveSystem-make.conf should contain one line to restrict licensing to only what is allowed to be built as a binary package:
51
52 <pre>
53     LICENSES_ACCEPTED=      NONE
54 </pre>
55
56 * Make sure there is no other cruft in /usr/local/etc/synth/
57
58 * In the example above, the synth working dirs are in "/build/synth".  Make sure the base directories exist.  Clean out any cruft for a fresh build from-scratch:
59
60 <pre>
61     rm -rf /build/synth/live_packages/*
62     rm -rf /build/synth/logs
63     mkdir /build/synth/logs
64 </pre>
65
66 * Run synth everything.  I recommend doing this in a 'screen' session in case you lose your ssh session (assuming you are ssh'd into the build machine).
67
68 <pre>
69     (optionally start a screen session)
70     synth everything
71 </pre>
72
73 * A full synth build takes over 24 hours to run on a 48-core box, around 12 hours to run on a 64-core box.  On a 4-core/8-thread box it will take at least 3 days.  There will be times when swap space is heavily used.  If you have not run synth before, monitor your memory and swap loads to make sure you have configured the jobs properly.  If you are overloading the system, you may have to ^C the synth run, reduce the jobs, and start it again.  It will pick up where it left off.
74
75 * When synth finishes, let it rebuild the database.  You then have a working binary repo.
76
77 * It is usually a good idea to run synth several times to pick up any stuff it couldn't build the first time.  Each of these incremental runs may take a few hours, depending on what it tries to build.
78