Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Simple Service Offering with Python, Solaris, OCCI and DTrace
1. Create a simple Service Offering with Python & Solaris Python with Solaris Zones, Dtrace & OCCI MUCOSUG meeting, June 16th, 2011
2. Create a simple Service Offering with Python & Solaris Warning:Clouds ahead Python with Solaris Zones, Dtrace & OCCI MUCOSUG meeting, June 16th, 2011
3. Intention: present why Python and Solaris are a perfect fit… 2011 (c) Thijs MetschThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
4. This is just a showcase to demonstrate all necessary ingredients...
7. Why Python, OCCI and Solaris? Innovation RESTful Python Powered Standard Cloud Protocol Containers Robustness ZFS SMF DTrace Performance
8. Why Python, OCCI and Solaris? Innovation RESTful Readability Simplicity Python Powered Maintainability BDFL Standard Cloud Protocol Development Speed Containers Robustness ZFS SMF DTrace Performance
9. Why Python, OCCI and Solaris? Innovation RESTful Readability Simplicity Python Powered Maintainability BDFL Standard Cloud Protocol Development Speed Fastest way to create a service and start earning money! Containers Robustness ZFS SMF DTrace Performance
22. Testframe written in Python„The Open Cloud Computing Interface (OCCI) is a RESTfulProtocol and API for all kinds of Management tasks. OCCI was originally initiated to create a remote management API for IaaS model based Services. It has since evolved into a flexible API with a strong focus on integration, portability, interoperability and innovation while still offering a high degree of extensibility. The current release of the Open Cloud Computing Interface is suitable to serve many other models in addition to IaaS, including e.g. PaaS and SaaS.” – http://www.occi-wg.org
26. Testframe written in Python„The Open Cloud Computing Interface (OCCI) is a RESTfulProtocol and API for all kinds of Management tasks. OCCI was originally initiated to create a remote management API for IaaS model based Services. It has since evolved into a flexible API with a strong focus on integration, portability, interoperability and innovation while still offering a high degree of extensibility. The current release of the Open Cloud Computing Interface is suitable to serve many other models in addition to IaaS, including e.g. PaaS and SaaS.” – http://www.occi-wg.org Python based OCCI implementation: pyOCCI
28. Python is ideal to create a (Scalable/Cloud) Service -Very easy to integrate with other services (e.g. For Authentication, DBs, Messaging, SCM...)
29. Python is ideal to create a (Scalable/Cloud) Service -Very easy to integrate with other services (e.g. For Authentication, DBs, Messaging, SCM...) For Data transfer: e.g. Uploading the WSGI through mercurial
31. Now let‘s handle Resource Pools & Zones (OS Integration) with Python
32. Wrapping zone.h with SWIG... $ make all swig -Wall -python pyzone.i gcc -I/usr/include/python2.6 -c pyzone_wrap.c ld -shared pyzone_wrap.o -o _pyzone.so $ cat test.py import pyzone zones = pyzone.zone_list() print len(zones) # equal to: pyzone.get_nr_of_act_zones() print zones $ python test.py 2 ['global', 'foo'] I can release this if there is interest…
34. Batteries included (for the Client) ... importhttplib connection=httplib.HTTPConnection('localhost:8080') connection.request('GET','/') r1=connection.getresponse() printr1.status,r1.reason importjson printjson.dumps({'msg':'Hello World'},sort_keys=True,indent=2) Python also offers many GUI frameworks – also build-in (and therefore available on all platforms/clients) is Tk (Easy to use with pytkgen*)... * Creates Tk based GUIs from JSON definition files.
39. Check if Python probes are available $ pfexec dtrace -ln 'python*:::' ID PROVIDER MODULE FUNCTION NAME 9398 python861 libpython2.6.so.1.0 PyEval_EvalFrameEx function-entry 9399 python861 libpython2.6.so.1.0 dtrace_entry function-entry 9400 python861 libpython2.6.so.1.0 PyEval_EvalFrameEx function-return 9401 python861 libpython2.6.so.1.0 dtrace_return function-return
40. Check if Python probes are available $ pfexec dtrace -ln 'python*:::' ID PROVIDER MODULE FUNCTION NAME 9398 python861 libpython2.6.so.1.0 PyEval_EvalFrameEx function-entry 9399 python861 libpython2.6.so.1.0 dtrace_entry function-entry 9400 python861 libpython2.6.so.1.0 PyEval_EvalFrameEx function-return 9401 python861 libpython2.6.so.1.0 dtrace_return function-return If you need more you could tinker around with ceval.c in the Python sources
47. Also for Development BTW (See Blog post) Python + Solaris = Perfect Platform* Cool Technology * http://www.nohuddleoffense.de/2011/02/21/my-software-development-environment-for-python/