Advertisement
Guest User

popolnik.xhtml

a guest
Mar 15th, 2011
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 12.14 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg">
  2. <head>
  3. <title>Popolnik README</title>
  4. <style type="text/css">
  5. html {font-family: Sans-Serif}
  6. h1 {text-align: center}
  7. pre {background-color: lightgray}
  8. </style>
  9. </head>
  10. <body>
  11.  
  12. <!-- mention cpantesters -->
  13. <h1>
  14. Popolnik
  15. </h1>
  16.  
  17. "Have a smoke, it's good for us"
  18.  
  19. <h2>
  20. Overview
  21. </h2>
  22.  
  23. <svg:svg viewBox="0 0 1000 150" width="100%" version="1.2" baseProfile="tiny">
  24.     <svg:path d="M400,50 C400,20 600,20 600,50" stroke="black" stroke-width="1" fill="none"/>
  25.     <svg:path d="M400,50 C400,80 600,80 600,50" stroke="black" stroke-width="1" fill="none"/>
  26.     <svg:ellipse cx="500" cy="50" rx="60" ry="10" fill="black"/>
  27.     <svg:line    x1="400" y1="50" x2="400" y2="90" stroke="black" stroke-width="1"/>
  28.     <svg:line    x1="600" y1="50" x2="600" y2="90" stroke="black" stroke-width="1"/>
  29.     <svg:path     d="M400,90 C400,120 600,120 600,90" stroke="black" stroke-width="1" fill="none"/>
  30.     <svg:line    x1="410" y1="40" x2="452" y2="45" stroke="black" stroke-width="1"/>
  31.     <svg:line    x1="406" y1="43" x2="448" y2="48" stroke="black" stroke-width="1"/>
  32.     <svg:line    x1="548" y1="52" x2="594" y2="57" stroke="black" stroke-width="1"/>
  33.     <svg:line    x1="552" y1="55" x2="590" y2="60" stroke="black" stroke-width="1"/>
  34. </svg:svg>
  35. <br/>
  36.  
  37. You may have heard of "smoke testing".  In hardware, it means "turn it
  38. on and see if any smoke comes out".  You may also know that electrical
  39. devices need "magic smoke" or "blue smoke" to work properly.  If a
  40. component accidentally it can rupture, allowing the smoke to escape,
  41. permanently damaging the component.
  42. <p/>
  43.  
  44. In software, "smoke testing" means running it to see if it works or
  45. fails.  Damage can almost always be repaired by reverting recent
  46. changes.  Computer programmers should often perform smoke tests to check
  47. their work.  A "smoker" is a computer and software configured to
  48. automatically perform smoke tests.
  49. <p/>
  50.  
  51. After you've had a smoke, you're left with a stub.  In software testing,
  52. the stub is a test report.  You should put your stubs in an ashtray.
  53. That is popolnik, in Slovak.
  54. <p/>
  55.  
  56. <h3>
  57. Security
  58. </h3>
  59. Did you know that smoke tests run arbitrary code on your computer?  Now
  60. you do.
  61. <p/>
  62.  
  63. <h2>
  64. Architecture
  65. </h2>
  66.  
  67. <svg:svg viewBox="0 0 1000 150" width="100%" version="1.2" baseProfile="tiny">
  68.     <svg:path d="M400,50 C400,20 600,20 600,50" stroke="black" stroke-width="1" fill="none"/>
  69.     <svg:path d="M400,50 C400,80 600,80 600,50" stroke="black" stroke-width="1" fill="none"/>
  70.     <svg:ellipse cx="500" cy="50" rx="60" ry="10" fill="black"/>
  71.     <svg:line    x1="400" y1="50" x2="400" y2="90" stroke="black" stroke-width="1"/>
  72.     <svg:line    x1="600" y1="50" x2="600" y2="90" stroke="black" stroke-width="1"/>
  73.     <svg:path     d="M400,90 C400,120 600,120 600,90" stroke="black" stroke-width="1" fill="none"/>
  74.     <svg:line    x1="410" y1="40" x2="452" y2="45" stroke="black" stroke-width="1"/>
  75.     <svg:line    x1="406" y1="43" x2="448" y2="48" stroke="black" stroke-width="1"/>
  76.     <svg:line    x1="548" y1="52" x2="594" y2="57" stroke="black" stroke-width="1"/>
  77.     <svg:line    x1="552" y1="55" x2="590" y2="60" stroke="black" stroke-width="1"/>
  78. </svg:svg>
  79. <br/>
  80.  
  81. The foundation of popolnik is an SQL database containing test results.
  82. Smokers put their stubs into popolnik by uploading via scp.  Popolnik
  83. validates the uploads and imports the data.  Any Perl 6 developer can
  84. choose to become a smoker by running a few simple scripts.  Whilst much
  85. detailed information is uploaded, care is taken to preserve anonymity,
  86. so nobody else needs to know that you are a smoker.  That avoids the
  87. "but I didn't inhale" crap.  You can also stop or resume smoking
  88. whenever you want.
  89. <p/>
  90.  
  91. Many software products can be tested because the reports are based on
  92. TAP, the Test Anything Protocol.  The initial products are Perl 6
  93. implementations such as Rakudo, and Perl 6 modules.  Parrot, Perl 5, all
  94. their modules and any other TAP application should fit in as well.  To
  95. prevent an overflow, popolnik restricts uploaded stubs with quotas and
  96. filters.  Fortunately the rejected stubs disappear, rather than spilling
  97. onto the table or the floor.
  98. <p/>
  99.  
  100. To minimize overheads, the central server does not generally perform end
  101. user queries.  Instead, popolnik exports incremental consolidated data
  102. updates hourly into compressed text files.  Subscribers keep copies of
  103. the data synchronized by selectively downloading and importing these
  104. files into their own databases to extract information locally.  Popolnik
  105. includes popular reports and facilities for local customization.  A
  106. separate public web server might also publish results but that is
  107. peripheral to popolnik.
  108. <p/>
  109.  
  110. To curb data explosion, hourly export files are deleted from the central
  111. server after a configurable number of days.  Daily summary export files
  112. are deleted after a longer configurable interval and monthly summary
  113. exports are retained indefinitely, but may be manually deleted by
  114. administrators.  All the data still remains in the central database to
  115. enable custom manual exports.
  116. <p/>
  117.  
  118. The data includes test success and failure, and also speed if that
  119. information is available.  The Rakudo Test.pm can time each test to a
  120. microsecond.  The data can be sliced and diced along multiple dimensions
  121. such as versions of software involved, date and time, commit history,
  122. hardware, operating system, and yet to be determined other factors.
  123. <p/>
  124.  
  125. Test suites change frequently.  The TAP protocol labels each test with a
  126. number and a description (unfortunately often missing or duplicated).
  127. Some queries attempt to use these labels to uniquely identify tests, but
  128. it will be trash in, trash out.  The database keeps the information in
  129. as original a form as possible.  Client software is responsible for
  130. making relevant comparisons.
  131. <p/>
  132.  
  133. Popolnik publishes requests for test results that would be useful
  134. additions to the database.  These requests are stored in a text file
  135. downloadable from the web server, sorted from highest priority.  The
  136. requests list is revised at irregular times, usually only after hours or
  137. days, so smokers should refrain from hitting the server frequently.  A
  138. 'wget --timestamping --user-agent="wget-popolnik" --continue' command is
  139. the most considerate way to stay in sync.
  140. <p/>
  141. In order to make the results reproducible, each line in the request file describes the item to be tested, including
  142. versions of all required software such as Rakudo and GCC versions.
  143. <p/>
  144.  
  145.  
  146. The central server (popolnik.jnthn.net) is a VirtualBox guest running
  147. Debian 6.0, Rakudo Star, PostgreSQL, Perl 5 and Apache.  Its install and
  148. configure procedures are documented below.
  149. <p/>
  150.  
  151. <h2>
  152. Usage
  153. </h2>
  154.  
  155. <h3>
  156. Keeping our ashtray clean
  157. </h3>
  158. You may have little use for your stubs after you've had a smoke, but
  159. Popolnik can benefit by recycling them.  Please place your clean stubs
  160. neatly into our ashtray.  The disposal works best if your stubs are
  161. regular and uncontaminated.  Thank you for your cooperation.
  162. <p/>
  163.  
  164. Clean stubs from smoker clients means uploaded test result files in the
  165. documented format and free of extraneous data.  Popolnik rejects invalid
  166. data and logs the source, but it still wastes resources.
  167. <p/>
  168.  
  169. Timing results are often degraded by loss of CPU time to other processes
  170. and by external factors such as file access delays.  Popolnik tries to
  171. mitigate these by executing the test suite twice and keeping both sets
  172. of results.  Please run smoker tests in a temporary directory on a file system that
  173. performs well.  Usually the second run is faster because caches contain
  174. more of the relevant content, the computer is "warmed up".  Analysing
  175. the difference between the two runs may give some interesting insights.
  176. <p/>
  177.  
  178. <h2>
  179. Host Machine Setup
  180. </h2>
  181.  
  182. Get VirtualBox, preferably version 4.x or later.  Older versions of
  183. VirtualBox might work, but have not (yet) been tested.
  184. <p/>
  185.  
  186. Get the Debian 6.0 Network Install CD for
  187. your processor architecture (available from
  188. <a href="http://www.debian.org/CD/netinst/">http://www.debian.org/CD/netinst/</a>).
  189. <p/>
  190.  
  191. <pre>
  192. sudo apt-get install virtualbox-ose
  193. sudo adduser $USERNAME vboxusers
  194. logout         # to re-login and get new group membership
  195. id             # should include vboxusers now
  196. sudo modprobe vboxdrv
  197. VBoxManage -v
  198. echo creating vm popolnik
  199. VBoxManage createvm -name "popolnik" -register
  200. </pre>
  201.  
  202. <h2>
  203. Guest Machine Creation
  204. </h2>
  205.  
  206. With the prerequisites installed, the host computer needs approximately
  207. 800MB of disk space (or more) for virtual hard drives.
  208. <p/>
  209.  
  210. Install Debian 6.0 with these partition sizes (or bigger):<p/>
  211. <table id="partitions">
  212.     <tr><th>Part #</th><th>Label</th><th>Size (MB)</th></tr>
  213.     <tr><td>1</td><td>popolnik-squeeze</td><td>400MB</td></tr>
  214.     <tr><td>2</td><td>popolnik-swap</td><td>100MB</td></tr>
  215.     <tr><td>3</td><td>popolnik-home</td><td>100MB</td></tr>
  216.     <tr><td>4</td><td>(extended partition)</td><td>200MB</td></tr>
  217.     <tr><td>5</td><td>popolnik-uploads</td><td>100MB</td></tr>
  218.     <tr><td>6</td><td>popolnik-database</td><td>100MB</td></tr>
  219. </table>
  220. <p/>
  221.  
  222. <pre>
  223. echo setting OS type
  224. VBoxManage modifyvm "popolnik" -ostype debian # an ID from 'VBoxManage list ostypes'
  225. echo setting memory size
  226. VBoxManage modifyvm "popolnik" -memory 1024   # megabytes
  227. echo setting video memory
  228. VBoxManage modifyvm "popolnik" -vram 8        # video memory, megabytes
  229.  
  230. echo creating a 2GB drive to install Debian and software
  231. VBoxManage createvdi -filename "popolnik_drive0" -size 2047 -register
  232. </pre>
  233.  
  234. Choose the targeted initrd because the boot drive is not going anywhere
  235. else.  During Tasksel, uncheck the "standard installation", because that
  236. brings in x11 and Gnome, and more than quadruples the size and number of
  237. packages to install.
  238. <p/>
  239.  
  240. After installation, log in using the root account and run
  241. `apt-get install sudo`.  Then `adduser popolnik sudo`.  Log out of the
  242. root session, in future use sudo.
  243. <p/>
  244.  
  245. Log in using the popolnik account.  Run `sudo apt-get install postgresql`.
  246. That installs about 80MB of packages.
  247. <p/>
  248.  
  249. Install perl-doc
  250.  
  251. <h2>
  252. Guest Machine Removal
  253. </h2>
  254. When you've had enough, remove it all to be able to start again
  255.  
  256. <pre>
  257. echo unregistering
  258. VBoxManage unregistervm "popolnik" -delete
  259. echo removing popolnik from ~/.VirtualBox/Machines/
  260. rm -rf ~/.VirtualBox/Machines/popolnik
  261.  
  262.  
  263. # logged in to the virtual machine as root
  264. apt-get install sudo
  265. vi /etc/sudoers # add jnthn and martin as sudoers with all privileges
  266. exit
  267.  
  268. # logged in to the virtual machine as root
  269. sudo apt-get install openssh-server
  270. sudo apt-get install perl-doc
  271. sudo apt-get install gcc
  272. sudo apt-get install make
  273. sudo apt-get install git-core
  274. sudo apt-get install subversion
  275. sudo apt-get install libicu-dev
  276. sudo apt-get install screen
  277. sudo apt-get install mysql-server
  278.  
  279. # logged in as rakudo
  280. git clone git://github.com/rakudo/rakudo.git
  281. cd rakudo
  282. time perl Configure.pl --gen-parrot
  283. time make install testable
  284. </pre>
  285.  
  286. <h2>
  287. Smoker Software
  288. </h2>
  289. - config
  290. - cron
  291. - compilers
  292. - modules
  293. - versions (including rakudo and parrot)
  294. - make test / prove / loudtest
  295. - facter (cosimo)
  296. - scp to popolnik
  297. - Win32_ComputerSystem http://msdn.microsoft.com/en-us/library/aa394102%28VS.85%29.aspx
  298. - Win32 Processor      http://msdn.microsoft.com/en-us/library/aa394373%28VS.85%29.aspx
  299. - Perl WMI example     http://www.activexperts.com/admin/scripts/wmi/perl/0356/
  300.  
  301. <h2>
  302. Popolnik software
  303. </h2>
  304. ssh-server
  305. perl 5
  306. POE filesystem events
  307. timer events (export incremental updates)
  308. PostgreSQL
  309.  
  310.  
  311.  
  312. <h2>
  313. LICENSE and COPYRIGHT
  314. </h2>
  315. Use these files at your risk and without warranty.  Give due credit if
  316. you do.  Written by Martin Berends.
  317.  
  318. <h2>
  319. References
  320. </h2>
  321.  
  322. <h3>
  323. VirtualBox
  324. </h3>
  325. <a href="http://www.virtualbox.org/">http://www.virtualbox.org/</a> home page<br/>
  326. <a href="http://www.virtualbox.org/manual/UserManual.html">http://www.virtualbox.org/manual/UserManual.html</a> user manual<br/>
  327.  
  328. <h3>
  329. Smoke
  330. </h3>
  331. <a href="http://www3.telus.net/bc_triumph_registry/smoke.htm">http://www3.telus.net/bc_triumph_registry/smoke.htm</a> background information about magic smoke in cars<br/>
  332.  
  333. </body>
  334. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement