summaryrefslogtreecommitdiffstats
path: root/documentation/toaster-manual/toaster-manual-setup-and-use.xml
blob: f56d67ed37dd0ac1625cd8da8e6b7794e974f73d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >

<chapter id='toaster-manual-setup-and-use'>

<title>Setting Up and Using Toaster</title>

    <para>
        You can set up Toaster as a local instance or as a hosted service.
        Furthermore, you can use Toaster in Analysis Mode or Build Mode
        from both set ups.
    </para>

    <section id='using-toaster-in-analysis-mode'>
        <title>Using Toaster in Analysis Mode</title>

        <para>
            This section describes how to use Toaster in Analysis Mode
            after setting Toaster up as a local instance or as a hosted
            service.
        </para>

        <section id='setting-up-locally-and-running-in-analysis-mode'>
            <title>Setting Up Locally and Running in Analysis Mode</title>

            <para>
                Follow these steps to set up a local instance of Toaster and
                then run in Analysis Mode:
                <orderedlist>
                    <listitem><para><emphasis>Prepare your Build System:</emphasis>
                        Be sure your system has the Toaster requirements
                        by following the steps in the
                        "<link linkend='toaster-establishing-toaster-system-dependencies'>Establishing Toaster System Dependencies</link>"
                        section.
                        </para></listitem>
                    <listitem><para><emphasis>Get Set Up to Use the Yocto Project:</emphasis>
                        Get the requirements set up so that you can use the
                        Yocto Project to build images.
                        See the
                        "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>What You Need and How You Get It</ulink>"
                        section in the Yocto Project Quick Start for information.
                        </para></listitem>
                    <listitem><para><emphasis>Be Sure Ports are Free:</emphasis>
                        Make sure that port 8000 and 8200 are free.
                        In other words, make sure the ports do not have servers
                        on them.
                        </para></listitem>
                    <listitem><para><emphasis>Source your Build Environment Setup Script:</emphasis>
                        From your
                        <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
                        (e.g. <filename>poky/build</filename>), source the build
                        environment setup script (i.e.
                        <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>
                        or
                        <ulink url="&YOCTO_DOCS_REF_URL;#structure-memres-core-script"><filename>oe-init-build-env-memres</filename></ulink>).
                        </para></listitem>
                    <listitem><para><emphasis>Start Toaster:</emphasis>
                        From the
                        <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
                        start Toaster:
                        <literallayout class='monospaced'>
     $ source toaster start
                        </literallayout>
                        </para></listitem>
                    <listitem><para><emphasis>Start Your Build Using BitBake:</emphasis>
                        Use the <filename>bitbake</filename> command to start your
                        build.
                        Here is an example that builds the
                        <filename>core-image-minimal</filename> image:
                        <literallayout class='monospaced'>
     $ bitbake core-image-minimal
                        </literallayout>
                        </para></listitem>
                </orderedlist>
            </para>

            <para>
                For information on how to use Toaster, see the
                "<link linkend='using-the-toaster-interface'>Using the Toaster Interface</link>"
                section.
            </para>
        </section>

        <section id='setting-up-a-hosted-service-and-running-in-analysis-mode'>
            <title>Setting Up a Hosted Service and Running in Analysis Mode</title>

            <para>
                A hosted service resides on a server and allows
                multiple users to take advantage of Toaster.
                In a production environment, you might want to have multiple
                local instances of Toaster, which run on various remote
                build machines, and have those local instances access and use
                a single hosted Toaster service.
            </para>

            <para>
                Starting Toaster with the <filename>toaster</filename> command
                (i.e. the script), causes three things to start:
                <itemizedlist>
                    <listitem><para>
                        The BitBake server.
                        </para></listitem>
                    <listitem><para>
                        The Toaster User Interface, which connects to the
                        BitBake server on one side and to the SQL
                        database on the other side.
                        </para></listitem>
                    <listitem><para>
                        The web server, which reads the database and displays
                        the web user interface.
                        </para></listitem>
                </itemizedlist>
                Rather than starting Toaster with the script, you can set up
                and start multiple instances of Toaster by manually starting
                as many or few of these three components across your
                environment.
                This is possible because it is not required that Toaster starts
                all three of its separate components in order to run.
                Minimally, a local instance of Toaster requires just one of the
                components.
            </para>

            <para>
                The concepts for setting up multiple local instances of
                Toaster that share a single hosted service revolve
                around maintaining a common SQL database and Web server that
                shows data from that common database as well as setting up
                separate local instances of BitBake servers and Toaster user
                interfaces for each of those separate BitBake build
                directories.
            </para>

            <para>
                The common SQL database and the Web server show data from
                all the various BitBake builds.
                Setting the SQL database outside of any
                <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
                maintains a separation layer between the various local builds
                and the common database.
                The database is persistent because the logging database is set
                up external to the BitBake database server (e.g. MySQL).
                It is not even necessary to run the BitBake servers, the SQL
                server, and the Web server on the same machine.
                Each component can be run on its own machine.
            </para>

            <para>
                Follow these steps to set up and run a hosted service and run
                Toaster in Analysis Mode:
                <orderedlist>
                    <listitem><para><emphasis>Prepare your Build System:</emphasis>
                        Be sure your system has the Toaster requirements
                        by following the steps in the
                        "<link linkend='toaster-establishing-toaster-system-dependencies'>Establishing Toaster System Dependencies</link>"
                        section.
                        </para></listitem>
                    <listitem><para><emphasis>Get Set Up to Use the Yocto Project:</emphasis>
                        Get the requirements set up so that you can use the
                        Yocto Project to build images.
                        See the
                        "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>What You Need and How You Get It</ulink>"
                        section in the Yocto Project Quick Start for information.
                        </para></listitem>
                    <listitem><para><emphasis>Be Sure Ports are Free:</emphasis>
                        Make sure that port 8000 and 8200 are free.
                        In other words, make sure the ports do not have servers
                        on them.
                        </para></listitem>
                    <listitem><para><emphasis>Set up the SQL Logging Server and the Web Server:</emphasis>
                        You can use any SQL server out of the box (e.g.
                        <filename>mysgl-server</filename> for an Ubuntu build
                        system).
                        <note>
                            If you are concerned about performance, you might
                            want to hand-tune the server.
                        </note>
                        You must set up proper username and password access on
                        the shared server for everyone that will be using
                        Toaster.
                        You need administration rights for the
                        <filename>mysql</filename> root account, which is not
                        the same thing as root access on the machine.</para>
                        <para>Clone a separate, local Git repository of the
                        Toaster master branch to use for running the Web
                        server.
                        The Git repository for Toaster is part of the
                        Yocto Project
                        <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
                        Consequently, you just need to set up a separate
                        local clone of the Yocto Project Source Directory
                        (e.g. <filename>poky</filename>):
                        <literallayout class='monospaced'>
     $ git clone git://git.yoctoproject.org/poky
                        </literallayout>
                        You do not perform builds on this tree.
                        You need to create this local repository away from any
                        build areas.</para>
                        <para>In the separately cloned tree for the Web server,
                        edit the
                        <filename>bitbake/lib/toaster/toastermain/settings.py</filename>
                        file so that the <filename>DATABASES</filename> value
                        points to the previously created database server.
                        Use the username and password established
                        earlier.</para>
                        <para>Run the database sync scripts to create the
                        needed tables as follows:
                        <literallayout class='monospaced'>
     $ python bitbake/lib/toaster/manage.py syncdb
     $ python bitbake/lib/toaster/manage.py migrate orm
                        </literallayout>
                        You can start the Web server in the foreground or the
                        background using these commands, respectively:
                        <literallayout class='monospaced'>
     $ python bitbake/lib/toaster/manage.py runserver
     $ nohup python bitbake/lib/toaster/manage.py runserver 2>toaster_web.log >toaster_web.log &amp;
                        </literallayout>
                        </para></listitem>
                    <listitem><para><emphasis>Enable Build Logging to the Common SQL Server for Each Build Directory you are Using:</emphasis>
                        For each build system that will be using Toaster and
                        the shared SQL server, you need to edit the
                        <filename>bitbake/lib/toaster/toastermain/settings.py</filename>
                        file to alter the <filename>DATABASES</filename> value
                        so that it points to the common SQL logging server.
                        <note><title>REVIEWER NOTE</title>
                            I don't see how to do this from the Wiki.
                            I need more clarification.
                        </note></para>
                        <para>In the Build Directory, create the required
                        <filename>conf/toaster.conf</filename> file as
                        described in
                        <ulink url='https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster'>BitBake Extra Options</ulink>.
                        Briefly, for each Build Directory, you need to inherit
                        the
                        <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-toaster'>toaster</ulink>
                        class by setting the following in your
                        <filename>local.conf</filename> configuration file:
                        <literallayout class='monospaced'>
     INHERIT += "toaster"
     INHERIT += "buildhistory"
     BUILDHISTORY_COMMIT = "1"
                        </literallayout>
                        Start the BitBake server using the following command:
                        <literallayout class='monospaced'>
     $ bitbake &dash;&dash;postread conf/toaster.conf &dash;&dash;server-only -t xmlrpc -B localhost:0 &amp;&amp; export BBSERVER=localhost:-1
                        </literallayout>
                        Start the logging user interface using the following
                        command:
                        <literallayout class='monospaced'>
     $ nohup bitbake &dash;&dash;observe-only -u toasterui >toaster_ui.log &amp;
                        </literallayout>
                        <note>
                            No hard-coded ports are used as there is enough code
                            to run <filename>autodiscovery</filename>
                            for ports to prevent collisions.
                        </note>
                        </para></listitem>
                    <listitem><para><emphasis>Source your Build Environment Setup Script:</emphasis>
                        From your
                        <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
                        on each of the build systems,
                        (e.g. <filename>poky/build</filename>), source the
                        build environment setup script (i.e.
                        <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>
                        or
                        <ulink url="&YOCTO_DOCS_REF_URL;#structure-memres-core-script"><filename>oe-init-build-env-memres</filename></ulink>).
                        </para></listitem>
                    <listitem><para><emphasis>Start Builds Using BitBake:</emphasis>
                        Use the <filename>bitbake</filename> command to start a
                        build on a build system.
                        Here is an example that builds the
                        <filename>core-image-minimal</filename> image:
                        <literallayout class='monospaced'>
     $ bitbake core-image-minimal
                        </literallayout>
                        When you are finished with a build in a given
                        Build Directory, be sure to <filename>kill</filename>
                        the BitBake server for that build area:
                        <literallayout class='monospaced'>
     $ bitbake -m
                        </literallayout>
                        </para></listitem>
                </orderedlist>
            </para>

            <para>
                For information on how to use Toaster, see the
                "<link linkend='using-the-toaster-interface'>Using the Toaster Interface</link>"
                section.
            </para>
        </section>
    </section>

    <section id='using-toaster-in-build-mode'>
        <title>Using Toaster in Build Mode</title>

        <para>
            This section describes how to use Toaster in Build Mode
            after setting Toaster up as a local instance or as a hosted
            service.
        </para>

        <section id='setting-up-locally-and-running-in-build-mode'>
            <title>Setting Up Locally and Running in Build Mode</title>

            <note><title>REVIEWER NOTE</title>
                I need the information on how to do this.
            </note>
        </section>

        <section id='setting-up-a-hosted-service-and-running-in-build-mode'>
            <title>Setting Up a Hosted Service and Running in Build Mode</title>

            <note><title>REVIEWER NOTE</title>
                Right now, the
                <ulink url='https://wiki.yoctoproject.org/wiki/Setting_up_a_hosted_managed_mode_for_Toaster'>WIKI PAGE</ulink>
                has some information on this but I don't understand it.
                I need more information.
            </note>
        </section>
    </section>

    <section id='using-the-toaster-interface'>
        <title>Using the Toaster Interface</title>

        <para>
            The Toaster interface allows you to examine the following:
            <itemizedlist>
                <listitem><para>
                    Outcome of the build, errors and warnings thrown
                    </para></listitem>
                <listitem><para>
                    Packages included in an image
                    </para></listitem>
                <listitem><para>
                    Image directory structure
                    </para></listitem>
                <listitem><para>
                    Build configuration
                    </para></listitem>
                <listitem><para>
                    Recipes and packages built
                    </para></listitem>
                <listitem><para>
                    Full dependency chain for tasks, recipes and packages
                    </para></listitem>
                <listitem><para>
                    Tasks run by the build system
                    </para></listitem>
                <listitem><para>
                    Performance information such as time, CPU usage, and
                    disk I/O per task
                    </para></listitem>
            </itemizedlist>
            For several useful videos that show how to effectively use the
            Toaster interface, see the
            <ulink url='https://www.yoctoproject.org/documentation/toaster-manual-17'>Toaster Documentation</ulink>
            on the Yocto Project website.
            <note><title>REVIEWER NOTE</title>
               We have agreed to get rid of the manual page on the website,
               contains the links to the GUI videos.
               We have agreed to host the videos on Vimeo and to embed the
               videos in this new Toaster manual.
            </note>
        </para>
    </section>
</chapter>