<trclass="field-odd field"><thclass="field-name">Authors:</th><tdclass="field-body">Brian C. Lane <<aclass="reference external"href="mailto:bcl%40redhat.com">bcl<span>@</span>redhat<span>.</span>com</a>></td>
</tr>
</tbody>
</table>
<p><ttclass="docutils literal"><spanclass="pre">composer-cli</span></tt> is used to interact with the <ttclass="docutils literal"><spanclass="pre">lorax-composer</span></tt> API server, managing blueprints, exploring available packages, and building new images.</p>
<p>It requires <aclass="reference external"href="lorax-composer.html">lorax-composer</a> to be installed on the
local system, and the user running it needs to be a member of the <ttclass="docutils literal"><spanclass="pre">weldr</span></tt>
group. They do not need to be root, but all of the <aclass="reference external"href="lorax-composer.html#security">security precautions</a> apply.</p>
<h2>composer-cli cmdline arguments<aclass="headerlink"href="#composer-cli-cmdline-arguments"title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section"id="edit-a-blueprint">
<h2>Edit a Blueprint<aclass="headerlink"href="#edit-a-blueprint"title="Permalink to this headline">¶</a></h2>
<p>Start out by listing the available blueprints using <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">blueprints</span>
<spanclass="pre">list</span></tt>, pick one and save it to the local directory by running <ttclass="docutils literal"><spanclass="pre">composer-cli</span>
<spanclass="pre">blueprints</span><spanclass="pre">save</span><spanclass="pre">http-server</span></tt>. If there are no blueprints available you can
copy one of the examples <aclass="reference external"href="https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/">from the test suite</a>.</p>
<p>Edit the file (it will be saved with a .toml extension) and change the
description, add a package or module to it. Send it back to the server by
running <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">blueprints</span><spanclass="pre">push</span><spanclass="pre">http-server.toml</span></tt>. You can verify that it was
saved by viewing the changelog - <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">blueprints</span><spanclass="pre">changes</span><spanclass="pre">http-server</span></tt>.</p>
</div>
<divclass="section"id="build-an-image">
<h2>Build an image<aclass="headerlink"href="#build-an-image"title="Permalink to this headline">¶</a></h2>
<p>Build a <ttclass="docutils literal"><spanclass="pre">qcow2</span></tt> disk image from this blueprint by running <ttclass="docutils literal"><spanclass="pre">composer-cli</span>
<spanclass="pre">compose</span><spanclass="pre">start</span><spanclass="pre">http-server</span><spanclass="pre">qcow2</span></tt>. It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.</p>
<p>The available types of images is displayed by <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">compose</span><spanclass="pre">types</span></tt>.
Currently this consists of: ext4-filesystem, live-iso, partitioned-disk, qcow2,
tar</p>
</div>
<divclass="section"id="monitor-the-build-status">
<h2>Monitor the build status<aclass="headerlink"href="#monitor-the-build-status"title="Permalink to this headline">¶</a></h2>
<p>Monitor it using <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">compose</span><spanclass="pre">status</span></tt>, which will show the status of
all the builds on the system. You can view the end of the anaconda build logs
once it is in the <ttclass="docutils literal"><spanclass="pre">RUNNING</span></tt> state using <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">compose</span><spanclass="pre">log</span><spanclass="pre">UUID</span></tt>
where UUID is the UUID returned by the start command.</p>
<p>Once the build is in the <ttclass="docutils literal"><spanclass="pre">FINISHED</span></tt> state you can download the image.</p>
</div>
<divclass="section"id="download-the-image">
<h2>Download the image<aclass="headerlink"href="#download-the-image"title="Permalink to this headline">¶</a></h2>
<p>Downloading the final image is done with <ttclass="docutils literal"><spanclass="pre">composer-cli</span><spanclass="pre">compose</span><spanclass="pre">image</span><spanclass="pre">UUID</span></tt> and it will
save the qcow2 image as <ttclass="docutils literal"><spanclass="pre">UUID-disk.qcow2</span></tt> which you can then use to boot a VM like this:</p>