Mar 16, 2007

DEBIAN: Apt Checkpoint

Abstract
Sometimes, a GNU/Debian user becomes crazy and install a lot of packages, sometimes with repeated features. Then the user tests the software and want to rollback to previous state.
In other hand, a developer find an issue in a package, then install the build dependencies, and fix the problems. When the problems are fixed the developer may want rollback to her old state, keeping the updates but removing or downgrading the packages installed to satisfy the build dependencies. In this cases, a rollback software will do the life easier.

There is an existing project "apt-checkpoint" on [WWW] sourceforge which has last been worked on in 2004 (version 0.1), written in Python. Maybe it can serve as a basis.

Domain

A user set checkpoints on package system (apt), some packages without possibility to rollback.
A user want to rollback to old system.
A developper want to do a diferencial rollback when finish some project because in his work use a diferent version of gcc, or libraries... set a first differential checkpoint (or a rollback point, it's the same), install build dependencies for something, set a second differential checkpoint. The packages between the first and the second checkpoint will be the ones rollbacked.

Scenario

A system administrator would like to do a snapshot of his GNU/Debian system for some reasons:

  • Check new versions with a go back step if something go wrong
  • Save his "perfect configuration"
  • Clean the system whenever.

Self desing discuss

First we need an exhaustive list of packages which could be problematic to rollback, then we need a system to detect new packages with the same problems.

The security it's no trivial here, we need trust the packages to goback to older versions.

The checkpoint should be like apt tools, and easy to use.

What if a version of a package is not in the repository: ignore, ask,lookfor, give the url? needle to study the best option.
apt-repack maybe a good option when a package version is not in the repository (if we select the option to cache the packages which arent in the repositories)


Use cases

0: Admin--->"apt-checkpoint set": mesagge, "you are going to set a checkpoint in ($now), the follow packages and her dependecies can not be rolledback, are you sure (Y/n)"
1:Admin---> Select yes: save the state of the package system, encript and set date time and ID
2: Admin --->"apt-checkpoint rollback": show a list of posible checkpoints numbered to select one of them.
3:Admin ---> select one checkpoint: show the list of changes and "continue Y/n"
4: Admin --->select Y and enter: the packages rollback to the old state.
5:Admin ---> select no: exit.
6: Developer -->"apt-checkpoint set-differential first": mesagge, "you are going to set a first diferential checkpoint in ($now), are you sure (Y/n)"
7: Developer -->"apt-checkpoint set-differential second": mesagge, "you are going to set a second diferential checkpoint in ($now), the follow packages may be rollback.($list of packages) are you sure (Y/n)"
8: Developer -->"apt-checkpoint diffrollback": Select what differential checkpoint you want ($List of diferential checkpoints, ordered by date)
9: Developer ---> select one checkpoint: show the list of changes and "continue Y/n"
10: Developer --->select Y and enter: the packages rollback to the old state.
11:Developer ---> select no: exit.

Roadmap
  1. Study the possible rollback problems, decide what to do with configuration files (save the checkpointed, ask, nothing...) light task back not trivial
  2. Study the existing apt-get checkpoint project, contact with the developer if is possible. Study code form others usually is complex.
  3. Decide a new name for the project. (semitrivial task :))
  4. Modelize the checkpoint store system, what need to save to rollback, how store (XML gziped..., plain text files, a mix, databased, packages cache...). A hard task, and very important
  5. UML modeling.
  6. Coding to prototype.
  7. Test get some feedback
  8. GOTO 6.
Security problems

the packages and the information checkpoints must be trusted.

Possible problems

For some packages, diferent versions of configuration files has not backward compatibility.

Contributors
Erich Schubert send me two comments, one about apt-repack and other requesting the differrential feature.

2 comments:

Anonymous said...

note that "roadmap" usually means you try to estimate the required timeframes for the steps.

Anonymous said...

Cool stuff. Wondering if you have made any progress with this. We're in the same position now and hit your page when search for apt-snapshot.