Continuous Integration support on system level
- Continuous Integration support on system level
- Requirements
- Risk profile
- Payment profile
- Future development
- Work progress
Stage: development
Startup plan
- Business requirements
- Software requirements
- Detail to tests
- Create initial development plan
Done on Friday Trac
Development plan
TBD - left on Friday Trac
Requirements
Business requirements
Continuous Integration on system level, in customers' environment is desperately needed by business. This is first and most important measure for quality assurance.
In short, there should be tool that would:
- Run on cvs/svn checkin
- Check out top version and run all bundled tests, including, probably, FF and IE-visual tests
- Report status (including errors)by email (short report) and put the report on the web (detailed version)
- If there were no errors, move the predefined label (e.g. Product-Current) to the version, that was checked out and tested.
It should support running in the following virtualisation environments:
- qemu
- xen
- kvm
- openvz
- vserver
Following target OS should be finally supported:
- ALT Linux
- Debian GNU/Linux
- Fedora Core
- CentOS
- Windows
First release should support only openvz and ALT Linux and Debian.
See also:
- http://xenman.sourceforge.net/ (xen only)
- http://www.lxlabs.com/ (commercial)
- http://git.altlinux.org/people/sin/packages/?p=virtualbox.git;a=summary
Architecture
Five components:
- VPS image creation, see TotalHosting and spt
- VPS management software, see TotalHosting
- virtualization solution (qemu/xen/kvm/openvz/vserver)
- test scripts to be run inside VPS
- glue scripts
Test scripts to be run inside VPS are the responsibility of the tested product. Best are the scripts that are also shipped in the form of the package of target OS (e.g. rpm or deb).
Users
Unix users
Data
- Reference image of target VPS
- Script to create the reference image of a target VPS
- Setup script to be executed in the target VPS
- Test script
- Teardown script
- Script to build a package for a target VPS from svn checkout (including test scripts, preferably)
Functions
build reference image
Invocation: shell ci-buildimage <profile> <size> <image>
Uses spt to build tgz image and then transforms it into qemu image.
Event flow:
- System builds altlinux tgz image using supplied spt <profile>
- System creates qemu image <image> of the specified <size>
- System unwinds tgz image into qemu image and makes it bootable.
Timing: less than 30m for local repository
Tests:
- Spt profile is invalid.
- Spt gives errors during tgz build.
- <image> file already exists.
- <size> is invalid, per qemu-img specification
- Success test: minimal bootable alt linux configuratoin on <image>
Tickets: #1
create VPS
Invocation: shell ci-startvps <image> <qemu options>
Event flow:
- System starts the supplied <image> with the specified <qemu options>
- As soon as the <image> is booted up and is net-responsive, it returns the string to be used to connect to the root shell
Timing: less than 10m for minimal system
Tests:
- <image> doesn't exist
- <image> is not a valid qemu image
- <image> is not bootable
- <qemu options> are invalid
- OS boots up but doesn't respond to the network within 10 minutes
- Success test with the minimal bootable configuration, ssh access
Tickets: #2
setup vps
Invocation: shell ci-setupvps <setup.d dir> <connect string ...>
Event flow:
- System uses the <connect string...> to connect the live vps
- Upon successful connect, system executes all files in the <setup.d dir> in the VPS. If any of files fails, it stops execution.
Timing: less than 1m for minimal system with single ls script
Tests:
- VPS is not alive
- No scripts in <setup.d dir>
- Script in <setup.d dir> fails
- Success test.
Tickets: #3
install tested package and test scripts package
Invocation: shell ci-installpkgs <pkg list file> <connect string...>
Event flow:
- System uses the <connect string...> to connect the live vps, fails if it can't.
- System installs every packages listed in the <pkg list file> in the order they've listed. E.g. <pkg list file> contains
package1 package2 package3
Then apt would be invoked for package1 package2 first and, if it is successful, for package3
Timing: less than 5m for two packages and local repository
Tests:
- VPS is not alive
- Empty <pkg list file>
- Package installation fails
- Success test.
Tickets: #4
run tests, store results in the db, dump overview to stdout
Invocation: shell ci-runtests [-k] <tests.d dir> <connect string...>
Event flow:
- System users the <connect string...> to connect to the live VPS, fails if it can not.
- System executes every script in <tests.d dir> in alpabetical order, collecting the results.
- If test script fails and no -k switch (same as in make -k) specified, system stops test run.
- System stores the stdout and strerr of test run in the database and dumps the overview (list of scripts run and their result) to stdout for further consumption (e.g. for ci-runtests ... | mail email@report invocation}}}
Timing: less than 1m for simple 'ls' test
Tests:
- VPS is not alive.
- No tests
- Test fails and no -k switch specified
- Test fail and -k switch specified
- Success test
Tickets: #5
cleanup vps
Invocation: shell ci-cleanup <cleanup.d dir> <connect string...>
Event flow:
- System uses the <connect string...> to connect to the live VPS, fails if it can not.
- System executes every script in <cleanup.d dir> in alphabetical order. If script fails, System stop the execution with an error message.
Timing: less than 1m for simple 'ls' script
Tests:
- VPS is not alive
- No cleanup scripts
- Cleanup script fails
- Success test w/o shutdown
Tickets: #6
destroy vps
Shutdown the vps
Invocation: shell ci-shutdown <connect script...>
Event flow:
- System uses the <connect string...> to connect to the live VPS, fails if it can not.
- System starts shutdown process and returns only when the VPS is not alive.
Timing: less than 10 minutes
Tests:
- VPS is not alive
- Shutdown is not complete for 10m
- Success test with shutdown
Tickets: #7
User interface
Shell
Default configuration
No data.
Hardware and software compatability
- stock PC
- ALT Linux Sisyphus
- python 2.4
- nosetests 0.9
- qemu-0.8.2-alt1
Security and confidentiality
Unix.
License
GPL v2.
Coding language and coding style
- python 2.4
- PEP8
- pylint score 8+
- test coverage 100%
Risk profile
Below the identified project risks are enumerated.
- Requirements change or incomplete
- Tests are incomplete
- Real development velocity too low comparing to initially estimated
- Platform/solution/environment, stated in requirements, makes impossible to satisfy project goals
- Non-development delays (e.g. waiting too long for answers)
- Software defects in the developed Product
- Software defects in 3rd party products
Payment profile
Project considered delivered, when included into TdLinux
Completion criteries:
- all functions implemented
- all tests are automated and passed
- project is packaged as tar.bz2 and ALT rpm
- release tar.bz2 and uploaded to KDS web site and to SourceForge
- rpm is uploaded to Sisyphus
Future development
- vserver support
- openvz support
- xen support
- kvm support
- investigate the tools availability and integration possibilities:
- evaluate DogTail
Work progress
2007.01.09
Done software requirements.
2007.01.11
Done tests.
2007.01.12
Done initial plan.
2007.08.31
Revived due to talk with GlobalLogic and interest from rPath
