Tart

tart is a fast, greedy repository partitioner. Given a repository R, a value function V : R ? int, a size function S : R ? int and a set of media sizes s1 , . . . , sk , tart produces subrepositories R1 , . . . , Rk satisfying:
  • size(Ri ) ? si
  • R1 ? . . . ? Ri is installable and has no external dependencies
  • the cumulative value of Ri is optimized
Tart is a program that takes care of thinning, i.e. spreading a distribution over different (numbered) media (CDs, DVDs, etc) so that every package on the distribution can be installed using only the medium it is on and preceeding media. For example, all packages on CD 1 can be installed using only the packages from CD 1, all packages on CD 2 can be installed using only the packages from CDs 1 and 2, and so forth.

Running Tart

The easiest way to generate the CNF (conjunctive normal form) files from repositories is using Ceve (q.v.). There is a script called script-002.sh in the dose2/tart/example directory that automates the procedure (there are some variables at the top of the script that you probably have to adjust to your system, such as paths); basically, it does the following:

  • Use Ceve to create a CNF file (deps.tart) from a repository;
  • Use Ceve to create a list of packages (sizes.tart) in that repository with their sizes;
  • Use deb/rpmcheck to find the list of broken packages and eliminate them from deps.tart
(Small note: the script was written under FreeBSD, so it is entirely possible that there are some GNU/BSD-peculiarities in sed or awk, though the script doesn't use them in a very complicated way)

The variables in deps.tart will use the package name format also used in pkglab, which is name'version@architecture (name, single quote, version, at sign, architecture).

You can now use tart on the files thus produced:

tart.opt -cost sizes.tart -thin 4.4e9,4.4e9,4.4e9 -human deps.tart > disks.tart

This will take the packages from deps.tart, and given the sizes enumerated in sizes.tart (which, if generated using the script, will be in bytes), try to spread them over three disks of 4.4 Gb each. The result will be in disks.tart, which will be a file with two columns, first the medium number (with 0 the first medium) and second the package name (in pkglab format).

(Note: whereas in the example all the media have the same size, this is not obligatory)

(Note 2: sadly, the order of parameters is important)

Utility

It is also possible to assign a 'utility number' to packages. This allows you to specify that certain packages should be put on lower-numbered media by preference (for example, if the kernel should be put on the first CD/DVD of a distribution.)

If a utility file is given, the solver will try to optimize its solution so that packages with high utility numbers are put on low-numbered media.

In order to do this, one can create a utility file, which has more or less the same forat as the sizes.tart file: every line should contain first a package name in pkglab format, and then a utility number (an integer). For example:

mozilla-thunderbird-eu'1.5.0.7-1mdv2007.0@i586 42
mozilla-thunderbird-es'1.5.0.7-1mdv2007.0@i586 3
sbiload'1.0.12-2mdv2007.0@i586 15

(Given that all the packages already are in sizes.tart, it would probably be best to use that file and replace the sizes by utility numbers)

Then, use the following command line for tart (assuming that the utility file is called utility.tart):

tart.opt -cost sizes.tart -utility utility.tart -thin 4.4e9,4.4e9,4.4e9 -human deps.tart > disks.tart

Again, the order of parameters is important.

Compiling Tart

Tart is part of Dose, which is in the EDOS SVN at https://protactinium.pps.jussieu.fr:12345/svn/edos/software/dependencies/dose2.

In the dose2 directory, you can run:

make tart
(where make should be a GNU make; it should also be possible to use the ocamlbuild utility distributed with the new OCaml 3.10 release, but this hasn't been maintained for some time and therefore might not work)

After this, the executables tart (bytecode) and tart.opt (native, if applicable) will be in the tart subdirectory.

Version 1.9 last modified by slauriere on 09/09/2007 at 18:47

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Semprini on 2007/04/13 13:03
Copyright EDOS Consortium
1.1.1