FreeBSD Test Cluster Automation
Student: Kamil Czekirda
Mentor: Warner Losh
Contents
Project Description:
I would like to work on Testing Infrastructure (FreeBSD cluster).
My goal is complete infrastructure for automatization installs and tests of FreeBSD.
The base of this project will be iPXE and iPXE scripts as a backend to control nodes. For frontend I propose a small python webapplication.
The applications of this project are non-limited (testing kernels, network test, parallel packages building).
Current status
Howto
Scheme
TFTP
http://doc.freenas.org/9.3/freenas_services.html#tftp
Just put undionly.kpxe into main directory in your favourite server.
DHCP
Only add the condition:
if exists user-class and ( option user-class = "iPXE" ) { filename "http://192.168.22.3/menu.ipxe"; } else { filename "undionly.kpxe"; }
into your subnet section
and hosts, from my lab:
host node01 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.22.51; option host-name "node01"; } host node02 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.22.52; option host-name "node02"; } host node03 { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.22.53; option host-name "node03"; }
NFS
http://doc.freenas.org/9.3/freenas_sharing.html#unix-nfs-shares
HTTP
I have two http services, one in standard 80 port, it's for static files, the iso and init menu.ipxe script. The second service is running on port 8080, it's small python webapp (management).
files in repository
dhcp/ dhcp server example ipxe/ iPXE port master/ storage content mfsbsd/ mfsbsd for nodes tftp/ tftp server content www/ http server content
setup
- setup FreeNAS and jail
- install in jail: subversion, py27-sqlite3, rsync, curl, python, apache24
- start servers: dhcp, tftp, http and nfs
- create local copy of freebsd repo: svn checkout svn://svn.freebsd.org/base/head/ /cluster/usr/src/
add node in management - http://192.168.22.3:8080/admin and set take_task.ipxe as boot
- add task (revision number)
workflow
- node starts with take_task status (take_task.ipxe as a boot)
- node sends DHCP request and gives an answer with next-server and filename options (filename "undionly.kpxe")
- node downloads undionly.kpxe by tftp protocol and execute it
iPXE sends DHCP request and gives an answer with filename option: http://192.168.22.3/menu.ipxe
menu.ipxe is iPXE script and asks the management for chainloading next script (chain http://${www}:${port}/menu/${net0/mac})
- management returns static file take_task.ipxe
take_task.ipxe runs next chainloading: chain http://${www}:${port}/admin/take_task/${net0/mac}
- management creates new task by /cluster/new_task.sh script
- management changes node status from take_task to wait
- management chenges task status from new to preparing
- node waits for next chainloading
- when management finish preparing task change node status to cluster.ipxe
- node chainloads cluster.ipxe script and uses sanboot to boot mfsBSD
- mfsBSD mounts storage in /cluster
- mfsBSD runs /cluster/run.sh script
- run.sh script compiles the source, build world, kernel, make ftp and installs dist on hdd (current status is available in storage in nodeXX/run.log file)
- run.sh if everything goes fine changes node status to rebooting and boot to hdd.ipxe
- node reboots and changes boot status to take_task.ipxe
Bugs and not done
Schedule
Week 1 (22) |
May 25, 2015 - June 1, 2015 |
done |
|
Week 2 (23) |
June 2, 2015 - June 8, 2015 |
done |
|
Week 3 (24) |
June 9, 2015 - June 15, 2015 |
(BSDCan) infrastructure for boot a diskless machine from memory |
done |
Week 4 (25) |
June 16, 2015 - June 22, 2015 |
infrastructure for boot a diskless machine from NFS by pxeboot |
failed... |
Week 5 (26) |
June 23, 2015 - June 29, 2015 |
(Mid-term evaluations deadline) iPXE script for booting from disk after finished system installation |
done |
Week 6 (27) |
June 30, 2015 - July 6, 2015 |
done |
|
Week 7 (28) |
July 7, 2015 - July 13, 2015 |
done |
|
Week 8 (29) |
July 14, 2015 - July 20, 2015 |
done |
|
Week 9 (30) |
July 21, 2015 - July 27, 2015 |
done |
|
Week 10 (31) |
July 28, 2015 - August 3, 2015 |
done |
|
Week 11 (32) |
August 4, 2015 - August 10, 2015 |
tests, fixes and documentation |
donee |
Week 12 (33) |
August 11, 2015 - August 17, 2015 |
tests, fixes and documentation |
in progress... |
The Code
Useful Links
Files