« Koji » : différence entre les versions

De TartareFR
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
 
(21 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
== Install a Koji Server ==
Koji is the software that builds [http://koji.fedoraproject.org/koji/ RPM packages for the Fedora project]. It uses [http://fedoraproject.org/wiki/Projects/Mock Mock] to create chroot environments for perform builds. To download the source code, report bugs, join the mailing list etc., see the [https://fedorahosted.org/koji/wiki Koji project website] .
Details about installation [[Koji/ServerInstall| Server Install]].


== Bootstrapping the Koji build environment ==
== HowTos ==
For instructions on importing packages and preparing Koji to run builds, see [[Koji/ServerBootstrap| Server Bootstrap]] .


For instructions on using External Repos and preparing Koji to run builds, see [[Koji/ExternalRepoServerBootstrap| External Repo Server Bootstrap]] .
=== Install a Koji Server ===
*Details about [[Koji/ServerInstall|Koji Set installation]].


Useful scripts and config files for setting up a Koji instance are available [http://fedora.danny.cz/koji/ here]
=== Bootstrapping the Koji build environment ===
*For instructions on importing packages and preparing Koji to run builds, see [[Koji/ServerBootstrap|Server Bootstrap]].
*For instructions on using External Repos and preparing Koji to run builds, see [[Koji/ExternalRepoServerBootstrap|External Repo Server Bootstrap]].
*Useful scripts and config files for setting up a Koji instance are available [http://fedora.danny.cz/koji/here].


== Operating the Koji Server ==
=== Operating the Koji Server ===
Details and notes about operating a koji server [[Koji/KojiMisc| Koji Operating]].
*Details and notes about operating a koji server [[Koji/KojiMisc|Koji Operating]].
Using the Koji build system [[Koji/Using| Using Koji]]
*Using the Koji build system [[Koji/Using|Using Koji]].
*[[Koji/BriefSetup|A brief Koji setup]].
*[[Koji/GarbageCollection|Garbage Collection]]
*[[Koji/BuildingImages|Building images with Koji]]
*[[Koji/Policies|Setting up policies on Koji]]
 
=== Signing Server ===
*Install a [[Koji/SigulInstall|Sigul Signing Server]]
*Use a [[Koji/SigulUsing|Sigul Signing Server]]
 
=== Installation d'un serveur Koji personnel ===
*[[Koji/Installation|Installation d'un serveur Koji]] pas à pas avec l’authentification SSL.
*Installation d'un repository avec [[RPM/Mash|Mash]]
 
=== Bootstrap de son serveur Koji ===
*[[Koji/Bootstrap|Bootstrap de Koji]]
 
=== Utilisation de son serveur Koji ===
* [[Koji/Utilisation|Utilisation de Koji]]
* [[Koji/CLI|Utilisation du client Koji en ligne de commande]]
 
== Koji Architecture ==
 
=== Terminology ===
In Koji it is sometimes necessary to distinguish between a package in general, a specific build of a package, and the various rpm files created by a build. When precision is needed, these terms should be interpreted as follows:
 
;Package: The name of a source rpm. This refers to the package in general and not any particular build or subpackage. For example: kernel, glibc, etc.
;Build: A particular build of a package. This refers to the entire build: all arches and subpackages. For example: kernel-2.6.9-34.EL, glibc-2.3.4-2.19.
;RPM: A particular rpm. A specific arch and subpackage of a build. For example: kernel-2.6.9-34.EL.x86_64, kernel-devel-2.6.9-34.EL.s390, glibc-2.3.4-2.19.i686, glibc-common-2.3.4-2.19.ia64
 
== Koji Components ==
 
Koji is comprised of several components:
 
==== Koji-Hub ====
koji-hub is the center of all Koji operations. It is an XML-RPC server running under mod_python in Apache. koji-hub is passive in that it only receives XML-RPC calls and relies upon the build daemons and other components to initiate communication. koji-hub is the only component that has direct access to the database and is one of the two components that have write access to the file system.
 
==== Kojid ====
kojid is the build daemon that runs on each of the build machines. Its primary responsibility is polling for incoming build requests and handling them accordingly. Essentially kojid asks koji-hub for work. Koji also has support for tasks other than building. Creating install images is one example. kojid is responsible for handling these tasks as well. kojid uses mock for building. It also creates a fresh buildroot for every build. kojid is written in Python and communicates with koji-hub via XML-RPC.
 
=== Koji-Web ===
koji-web is a set of scripts that run in mod_python and use the Cheetah templating engine to provide a web interface to Koji. It acts as a client to koji-hub providing a visual interface to preform a limited amount of administration. koji-web exposes a lot of information and also provides a means for certain operations, such as cancelling builds.
 
=== Koji-client ===
koji-client is a CLI written in Python that provides many hooks into Koji. It allows the user to query much of the data as well as perform actions such as adding users and initiating build requests.
 
=== Kojira ===
kojira is a daemon that keeps the build root repodata updated. It is responsible for removing redundant build roots and cleaning up after a build request is completed.
 
== Package Organization ==
 
==== Tags and Targets ====
 
Koji organizes packages using tags:
 
* Tags are tracked in the database but not on disk
* Tags support multiple inheritance
* Each tag has its own list of valid packages (inheritable)
* Package ownership can be set per-tag (inheritable)
* Tag inheritance is more configurable
* When you build you specify a target rather than a tag
 
A build target specifies where a package should be built and how it should be tagged afterwards. This allows target names to remain fixed as tags change through releases. You can get a full list of build targets with the following command:
 
<pre>
$ koji list-targets
</pre>
 
You can see just a single target with the --name option:
 
<pre>
$ koji list-targets --name dist-fc7
 
Name                          Buildroot                      Destination
---------------------------------------------------------------------------------------------
dist-fc7                      dist-fc7-build                dist-fc7
</pre>
 
This tells you a build for target dist-fc7 will use a buildroot with packages from the tag dist-fc7-build and tag the resulting packages as dist-fc7.
 
You can get a list of tags with the following command:
 
<pre>
$ koji list-tags
</pre>
 
==== Package lists ====
 
As mentioned above, each tag has its own list of packages that may be placed in the tag. To see that list for a tag, use the list-pkgs command:
 
<pre>
$ koji list-pkgs --tag dist-fc7
 
Package                Tag                    Extra Arches    Owner
----------------------- ----------------------- ---------------- ----------------
ElectricFence          dist-fc6                                pmachata
GConf2                  dist-fc6                                rstrode
lucene                  dist-fc6                                dbhole
lvm2                    dist-fc6                                lvm-team
ImageMagick            dist-fc6                                nmurray
m17n-db                dist-fc6                                majain
m17n-lib                dist-fc6                                majain
MAKEDEV                dist-fc6                                clumens
[...]
</pre>
 
The first column is the name of the package, the second tells you which tag the package entry has been inherited from, and the third tells you the owner of the package.
 
==== Latest Builds ====
 
To see the latest builds for a tag, use the latest-pkg command:
 
<pre>
$ koji latest-pkg --all dist-fc7
 
Build                                    Tag                  Built by
----------------------------------------  --------------------  ----------------
ConsoleKit-0.1.0-5.fc7                    dist-fc7              davidz
ElectricFence-2.2.2-20.2.2                dist-fc6              jkeating
GConf2-2.16.0-6.fc7                      dist-fc7              mclasen
ImageMagick-6.2.8.0-3.fc6.1              dist-fc6-updates      nmurray
MAKEDEV-3.23-1.2                          dist-fc6              nalin
MySQL-python-1.2.1_p2-2                  dist-fc7              katzj
NetworkManager-0.6.5-0.3.cvs20061025.fc7  dist-fc7              caillon
ORBit2-2.14.6-1.fc7                      dist-fc7              mclasen
</pre>
 
The output gives you not only the latest builds, but which tag they have been inherited from and who built them (note: for builds imported from beehive the "built by" field may be misleading).
 
==== Documentation ====
 
We've tried to make Koji self-documenting wherever possible. The command line tool will print a list of valid commands and each command supports --help. For example:
 
<pre>
$ koji help
 
Koji commands are:
build                Build a package from source
cancel-task          Cancel a task
help                List available commands
latest-build        Print the latest rpms for a tag
latest-pkg          Print the latest builds for a tag
[...]
</pre>
 
<pre>
$ koji build --help
 
usage: koji build [options]  tag URL
(Specify the --help global option for a list of other help options)
 
options:
-h, --help            show this help message and exit
--skip-tag            Do not attempt to tag package
--scratch            Perform a scratch build
--nowait              Don't wait on build
[...]
</pre>
 
You can see administrator-only command help with --admin. Most users will never use these additional commands, but if you're setting up your own Koji system, you may find them very useful.
<pre>
$koji help --admin
Available commands:
        add-external-repo        Create an external repo and/or add one to a tag
        add-group                Add a group to a tag
        add-group-pkg            Add a package to a group's package listing
[...]
</pre>
 
= Runs Here Also=
 
Koji is also know to be used in many places, [[/RunsHere| Known koji installations]].  Feel free to add your own.
[[Catégorie:RPM|Summary Koji]]
[[Catégorie:Koji|Summary]]

Dernière version du 2 septembre 2012 à 14:17

Koji is the software that builds RPM packages for the Fedora project. It uses Mock to create chroot environments for perform builds. To download the source code, report bugs, join the mailing list etc., see the Koji project website .

HowTos

Install a Koji Server

Bootstrapping the Koji build environment

  • For instructions on importing packages and preparing Koji to run builds, see Server Bootstrap.
  • For instructions on using External Repos and preparing Koji to run builds, see External Repo Server Bootstrap.
  • Useful scripts and config files for setting up a Koji instance are available [1].

Operating the Koji Server

Signing Server

Installation d'un serveur Koji personnel

Bootstrap de son serveur Koji

Utilisation de son serveur Koji

Koji Architecture

Terminology

In Koji it is sometimes necessary to distinguish between a package in general, a specific build of a package, and the various rpm files created by a build. When precision is needed, these terms should be interpreted as follows:

Package
The name of a source rpm. This refers to the package in general and not any particular build or subpackage. For example: kernel, glibc, etc.
Build
A particular build of a package. This refers to the entire build: all arches and subpackages. For example: kernel-2.6.9-34.EL, glibc-2.3.4-2.19.
RPM
A particular rpm. A specific arch and subpackage of a build. For example: kernel-2.6.9-34.EL.x86_64, kernel-devel-2.6.9-34.EL.s390, glibc-2.3.4-2.19.i686, glibc-common-2.3.4-2.19.ia64

Koji Components

Koji is comprised of several components:

Koji-Hub

koji-hub is the center of all Koji operations. It is an XML-RPC server running under mod_python in Apache. koji-hub is passive in that it only receives XML-RPC calls and relies upon the build daemons and other components to initiate communication. koji-hub is the only component that has direct access to the database and is one of the two components that have write access to the file system.

Kojid

kojid is the build daemon that runs on each of the build machines. Its primary responsibility is polling for incoming build requests and handling them accordingly. Essentially kojid asks koji-hub for work. Koji also has support for tasks other than building. Creating install images is one example. kojid is responsible for handling these tasks as well. kojid uses mock for building. It also creates a fresh buildroot for every build. kojid is written in Python and communicates with koji-hub via XML-RPC.

Koji-Web

koji-web is a set of scripts that run in mod_python and use the Cheetah templating engine to provide a web interface to Koji. It acts as a client to koji-hub providing a visual interface to preform a limited amount of administration. koji-web exposes a lot of information and also provides a means for certain operations, such as cancelling builds.

Koji-client

koji-client is a CLI written in Python that provides many hooks into Koji. It allows the user to query much of the data as well as perform actions such as adding users and initiating build requests.

Kojira

kojira is a daemon that keeps the build root repodata updated. It is responsible for removing redundant build roots and cleaning up after a build request is completed.

Package Organization

Tags and Targets

Koji organizes packages using tags:

  • Tags are tracked in the database but not on disk
  • Tags support multiple inheritance
  • Each tag has its own list of valid packages (inheritable)
  • Package ownership can be set per-tag (inheritable)
  • Tag inheritance is more configurable
  • When you build you specify a target rather than a tag

A build target specifies where a package should be built and how it should be tagged afterwards. This allows target names to remain fixed as tags change through releases. You can get a full list of build targets with the following command:

$ koji list-targets

You can see just a single target with the --name option:

$ koji list-targets --name dist-fc7

Name                           Buildroot                      Destination
---------------------------------------------------------------------------------------------
dist-fc7                       dist-fc7-build                 dist-fc7

This tells you a build for target dist-fc7 will use a buildroot with packages from the tag dist-fc7-build and tag the resulting packages as dist-fc7.

You can get a list of tags with the following command:

$ koji list-tags

Package lists

As mentioned above, each tag has its own list of packages that may be placed in the tag. To see that list for a tag, use the list-pkgs command:

$ koji list-pkgs --tag dist-fc7

Package                 Tag                     Extra Arches     Owner
----------------------- ----------------------- ---------------- ----------------
ElectricFence           dist-fc6                                 pmachata
GConf2                  dist-fc6                                 rstrode
lucene                  dist-fc6                                 dbhole
lvm2                    dist-fc6                                 lvm-team
ImageMagick             dist-fc6                                 nmurray
m17n-db                 dist-fc6                                 majain
m17n-lib                dist-fc6                                 majain
MAKEDEV                 dist-fc6                                 clumens
[...] 

The first column is the name of the package, the second tells you which tag the package entry has been inherited from, and the third tells you the owner of the package.

Latest Builds

To see the latest builds for a tag, use the latest-pkg command:

$ koji latest-pkg --all dist-fc7

Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
ConsoleKit-0.1.0-5.fc7                    dist-fc7              davidz
ElectricFence-2.2.2-20.2.2                dist-fc6              jkeating
GConf2-2.16.0-6.fc7                       dist-fc7              mclasen
ImageMagick-6.2.8.0-3.fc6.1               dist-fc6-updates      nmurray
MAKEDEV-3.23-1.2                          dist-fc6              nalin
MySQL-python-1.2.1_p2-2                   dist-fc7              katzj
NetworkManager-0.6.5-0.3.cvs20061025.fc7  dist-fc7              caillon
ORBit2-2.14.6-1.fc7                       dist-fc7              mclasen

The output gives you not only the latest builds, but which tag they have been inherited from and who built them (note: for builds imported from beehive the "built by" field may be misleading).

Documentation

We've tried to make Koji self-documenting wherever possible. The command line tool will print a list of valid commands and each command supports --help. For example:

$ koji help

Koji commands are:
build                Build a package from source
cancel-task          Cancel a task
help                 List available commands
latest-build         Print the latest rpms for a tag
latest-pkg           Print the latest builds for a tag
[...] 
$ koji build --help

usage: koji build [options]  tag URL
(Specify the --help global option for a list of other help options)

options:
-h, --help            show this help message and exit
--skip-tag            Do not attempt to tag package
--scratch             Perform a scratch build
--nowait              Don't wait on build
[...] 

You can see administrator-only command help with --admin. Most users will never use these additional commands, but if you're setting up your own Koji system, you may find them very useful.

$koji help --admin
Available commands:
        add-external-repo         Create an external repo and/or add one to a tag
        add-group                 Add a group to a tag
        add-group-pkg             Add a package to a group's package listing
[...]

Runs Here Also

Koji is also know to be used in many places, Known koji installations. Feel free to add your own.