Version 74 (modified by 12 years ago) ( diff ) | ,
---|
SysAdmins
Table of Contents
We can always use SysAdmin support to help out with our infrastructure: developing tools & maintaining sites.
Deployment Cycle
- InstallationGuidelines (if not using the templates on Zen infrastructure)
- Administration Guide
Setting up a New Instance
Eden project have 2 servers kindly donated by Zen Internet.
These run KVM to provide different virtual machines.
We use Proxmox to manage these VMs:
- Type: Fully Virtualized (KVM)
- Installation media: Debian-507-amd64-netinst.iso (if not using the template)
- Disk Storage: Images (Host1) data (Host2)
- Start at Boot: tick
- Disk type: VIRTIO
- Disk size: 22GB
- Guest Type: Linux-2.6
- Network Card: virtio
- Bridge: vmbr0
These documents are secured - ask for access if you are going to contribute:
- IP Addresses/RAM Allocations for Eden Infrastructure
- Setting up a new VM instance on Eden Infrastructure
Copy from Template
We normally copy an instance from a predefined template rather than starting with a fresh OS build.
- consider changing this with scripts similar to ISO/VM builds?
- Turn off template VM instance if on
- SSH into the host machine
If using Host1:
3.
cd /spare/images/images cp 106/vm-106-disk-1.raw 1xx/vm-1xx-disk-1.raw
If using Host2:
3.
#zcat /spare/template/vm_release.gz | dd of=/dev/data/vm-1xx-disk-1 bs=8M dd if=/dev/data/vm-106-disk-1 of=/dev/data/vm-1xx-disk-1 bs=8M
- That'll take a while. You can get it to notify progress by doing a kill -USR1 {process id of the dd}
- start your VM after the copy is complete
- Open VNC Console
- read /home/INSTALL in the vm
- Set the IP (using the spreadsheet)
Upgrading an Instance
Need to decide whether the site will be upgraded straight from Trunk, or whether upgrades are staged via a Test server.
Simple upgrades can be done using the aliases:
We manage complex upgrades using Fabric:
- Add the site to fabfile.py
- If no keys generated yet, then generate some:
fab generate_keys
- deploy keys
fab <site> distribute_keys
- Run the upgrade (as/when required)
fab <site> deploy
Continuous Integration
CI Server results: http://82.71.213.53/eden/admin/result
To run the test suite manually:
sudo sh /etc/cron.custom/web2pystarter
Open another console then:
sudo sh /etc/cron.custom/testsuite
This first updates Eden and Web2py from Github, then runs the functional tests followed by smoke tests.
To just run smoke tests:
cd /home/web2py xvfb-run -a python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A --html-path /home/web2py/applications/eden/static/test_smoke/ --suite smoke --force-debug --link-depth 16 -V 4
We also have an install of Jenkins which should ideally be configured to run this.
Trac Maintenance
To clear blocks from MathCaptcha failures:
- View Blocks: http://eden.sahanafoundation.org/mathcaptcha-attempts
- Clear blocks: http://eden.sahanafoundation.org/mathcaptcha-clear
To reset tickets which have been assigned to nobody:
apache2ctl stop sqlite3 /home/sahana/trac/db/trac.db UPDATE ticket SET status = 'new' WHERE owner = '' and status = 'assigned'; .q apache2ctl start
To delete a ticket:
apache2ctl stop sqlite3 /home/sahana/trac/db/trac.db SELECT * FROM ticket WHERE id is 0000; DELETE FROM ticket WHERE id is 0000; .q apache2ctl start
Backups
http://bitten.edgewall.org/wiki/TracBackup
trac-admin /home/sahana/trac hotcopy /root/trac_backup NOW=$(date +"%Y-%m-%d") tar cvf trac-$NOW.tar /root/trac_backup bzip2 -9 trac-$NOW.tar rm -rf /root/trac_backup
Customizing Trac
Just dropping in a few notes. --Pat
Trac and Trac plugins are installed in:
/usr/local/lib/python2.6/dist-packages/
Trac itself is: Trac-0.12.1-py2.6.egg
The Eden Trac "project" is at:
/home/sahana/trac
Settings
Many settings are available in: /home/sahana/trac/conf/trac.ini
Some interface changes can be made here as well, e.g. icon, order of items in the top menu, labels for same (search for mainnav and metanav).
Interface
http://trac.edgewall.org/wiki/TracInterfaceCustomization
- The official Trac means of customizing individual pages is to use Genshi xsl to replace items in the original pages, which are left untouched. The replacement is done in:
/home/sahana/trac/templates/site.html
- One can also put entire replacement templates in
/home/sahana/trac/templates
but then one will have to merge these when Trac is updated. Putting entire templates here is problematic for plugins, which may define their own local data -- that won't be available outside the plugin context.
Plugins
Watch this space...
Mail Queues
Check if your IP is blacklisted for Spam:
View queue:
mailq
Flush queue (inc Frozen messages):
exim -qff
Remove Frozen messages (remove -r to remove all):
exiqgrep -z -i -r [user]@domain | xargs exim -Mrm
References
Pootle
UserGuidelinesLocalisation#AdministeringPootle
ToDo
Windows Installer
See if we can upgrade the Windows Installer to Python 2.7 to have Foreign-Key support (#900)
Use Esky to provide an auto-update method:
Infrastructure Virtual Machine Template
/home/INSTALL
/root/ChangeTemplate.sh
- scripts in
/usr/local/bin
- Convert to PostgreSQL/PostGIS
- Update Eden
- Update Web2Py (as-required)
- Update OS
- Increase swap to 2048Mb (from 750Mb)
- can we do this in image? Add an emergency swapfile?
- Add extra disk for those instances which need extra capacity
Fabfile
- SQL indexes need restoring after DB upgrades
- Add support for PostgreSQL
- Add support for PostgreSQL to dbstruct (or have an equivalent file)
Test
We have an instance of Jenkins to automatically run through our Selenium tests: SysAdminJenkins
- Fix the current builds
- Trigger builds upon every commit
- Email notifications: set up a mailing list which people can register/unregister themselves
- Add timings to the output
- Add a VPN Server (e.g. PPTPd) to allow NAT'd desktops to contribute tests (e.g. IE7)
Demo
- Have a set of reference data available
OSGeo LiveDVD
- https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/bin/install_sahana.sh
- http://wiki.osgeo.org/wiki/Live_GIS_Add_Project#Install_Script
- http://wiki.osgeo.org/wiki/Live_GIS_Build
- InstallationGuidelinesLinuxScript#Ubuntu
- https://wiki.mozilla.org/Firefox_Rebranding:Worksheet#Bookmarks
Pootle
Trac
- http://eden.sahanafoundation.org/wiki/BluePrintTrac
- Old: TracUpgrade
- Convert from sqlite to PostgreSQL (or MySQL) to improve performance
- Install PostgreSQL
su postgres createuser -s -P trac createdb -O trac -E UTF8 trac
- http://trac-hacks.org/wiki/SqliteToPgScript
vim /home/sahana/trac/conf/trac.ini trac.db.postgres_backend.postgresqlconnector = enabled svn co http://trac-hacks.org/svn/sqlitetopgscript/0.10 sqlitetopgscript cd sqlitetopgscript ./sqlite2pg -e /home/sahana/trac -p 'postgres://tracuser:pass@localhost/trac'
- Install PostgreSQL
Errors:
/usr/local/lib/python2.6/dist-packages/TracScreenshots-0.8dev-py2.6.egg/tracscreenshots/core.py:13: DeprecationWarning: the sets module is deprecated import sets Traceback (most recent call last): File "./sqlite2pg", line 335, in <module> sys.exit(main(sys.argv[1:])) File "./sqlite2pg", line 331, in main Main(opts) File "./sqlite2pg", line 250, in Main rc = tmigration.migrateTable(tname) or rc File "./sqlite2pg", line 72, in migrateTable rc = self.default_copy(table) File "./sqlite2pg", line 93, in default_copy pgcur.execute(insert_into, row) File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.1-py2.6.egg/trac/db/util.py", line 65, in execute return self.cursor.execute(sql_escape_percent(sql), args) psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block
- Add Timing & Estmation Plugin
- Investigate a fix or alternative to http://trac-hacks.org/wiki/MathCaptchaPlugin for allowing Trac users to register bugs anonymously whilst not locking out our testing team.
- See if we can not send emails out to users for the updates they make themselves (maybe fixed in 0.12.x?)
- Investigate a fix for the last section edit doubling-up the footers (maybe fixed in 0.12.x?)
Release Process
- SysAdmin/ReleaseProcess
- Installation scripts or packages for operating systems and distributions that aren't already available (i.e. other than Windows or Debian/Ubuntu).
Translation Process
- Script to update language files:
cd web2py python web2py.py -S eden -R applications/eden/static/scripts/tools/languages.py
- Scripts to automate the conversion 2 PO & upload/download to/from Pootle:
Unfortunately it doesn't seem that we can currently automate the upload back to Pootle:
MeetBot
We could use a MeetBot to log our IRC meetings better:
- https://launchpad.net/meetbot
- example output: http://meetings.jenkins-ci.org/jenkins/2011/jenkins.2011-02-04-23.02.html