tag:blogger.com,1999:blog-298263562024-03-05T05:40:29.807+01:00Sharing my work and thoughtsThis is my personal blog.kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-29826356.post-39850240751267931672009-05-06T14:43:00.002+02:002009-05-06T14:46:27.194+02:00Designing a RESTful api for YaST<p>
As we move YaST to the Web, we also want to give it a web-like
architecture offering its functionality for widespread consumption.
</p><p>
So we started off by separating the client frontend (user interface) from the
server backend (functionality) and settling for a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>ful
api between them. We also decided on using <a href="http://www.blogger.com/post-create.g?blogID=29826356">Ruby on Rails</a> (usually just
named 'Rails') to implement both layers. Besides its widespread
adoption outside of <a href="http://en.opensuse.org/">OpenSUSE</a>, Rails is used in
a couple of company projects like</p><ul>
<li> <a href="http://studio.suse.com/">SUSE Studio</a></li>
<li> <a href="http://build.opensuse.org/">OpenSUSE buildservice</a> (frontend)</li>
<li> <a href="http://features.opensuse.org/">OpenFATE</a></li>
</ul>
Rails comes as a natural choice as we can build upon a rich knowledge
base with developers sitting (literally) next door. Rails was also one of the early adopters for RESTful and offers
a nice encapsulation layer named <em>ActiveResource</em>.<p></p>
<h4>ActiveResource ...</h4>
<p>
<a href="http://api.rubyonrails.org/files/vendor/rails/activeresource/README.html">ActiveResource</a>
gives you an object-oriented interface for resources, hiding all the
HTTP protocol or serialization issues from you.</p><p> Following the <a href="http://en.wikipedia.org/wiki/Model-view-controller">model-view-controller</a>
principle of Rails, resources are separated into their model,
behaviour, and visualization. The resource model is expressed as a ruby class below
<tt>app/models</tt>, the resource behaviour and basic lifecycle
operations (create-read-update-delete) is
implemented in a <i>Controller</i> class living below
<tt>app/controllers</tt>, and <tt>app/views</tt> hosts the
visualization files.</p>
<p>A <tt>device</tt> resource would be modelled as
<tt>app/models/device.rb</tt>, implemented as
<tt>app/controllers/devices_controller.rb</tt>, and viewed through
<tt>app/views/devices</tt>. (Note that controllers
are always plural, even for singleton resources.)
</p>
<h4>... and routing</h4>
<p>
To make resource accessible from the outside, routing
information must be placed inside <tt>config/routes.rb</tt>. Routing assigns a URL to the resource,
making it accessible from the outside and uniquely identifying it.</p><p>
For the device resource, a <tt>map.resources :device</tt> call inside
<tt>config/routes.rb</tt> would publish the resource as
<tt>/devices</tt>, effectively offering a set of URLs and HTTP methods:
<table border="1">
<tbody><tr>
<th>HTTP verb</th>
<th>URL</th>
<th>action</th>
<th>used for</th>
</tr>
<tr>
<td>GET</td>
<td>/devices</td>
<td>index</td>
<td>display a list of all devices</td>
</tr>
<tr>
<td>POST</td>
<td>/devices</td>
<td>create</td>
<td>create a new device</td>
</tr>
<tr>
<td>GET</td>
<td>/devices/1</td>
<td>show</td>
<td>display a specific device</td>
</tr>
<tr>
<td>PUT</td>
<td>/devices/1</td>
<td>update</td>
<td>update a specific device</td>
</tr>
<tr>
<td>DELETE</td>
<td>/devices/1</td>
<td>destroy</td>
<td>delete a specific device</td>
</tr>
</tbody></table>
(taken from <a href="http://guides.rubyonrails.org/routing.html">RailsGuides</a>)
</p>
<h4>Limitations of the routing scheme</h4>
<p>
This scheme of identifying resources via URLs works well for a limited
number of resources which all have models below app/models and
controllers inside app/controllers.
</p><p>
But it is hard to follow if you allow resources as plugins,
which you cannot control and prevent them stomping on another plugins
feet. Imagine a printer plugin offering <em>devices</em>
and a network plugin doing the same. The <tt>/devices</tt> URL cannot uniquely
identify the resource, a simple </p><pre>map.resources :devices</pre> routing is not
sufficient.<p></p>
<h4>Pluggable resources</h4>
<p>
To make pluggable resources work, you have to centralize the routing
and restrain from defining URLs. This also matches well with the
RESTful principle of <a href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven">hypertext
driven APIs</a> and narrowing the URL exposure window.
</p><p>
A resource plugin for the <a href="http://git.opensuse.org/?p=projects/yast/rest-service.git;a=summary">rest-service</a>
of YaST is identified by the <i>interface</i> it offers and the
<i>controller</i> implementing it.</p>
<p>
This is done with a config file in <a href="http://en.wikipedia.org/wiki/YAML">yaml</a> format.
It specifies the interface and controller as
</p><pre lang="yaml">
interface: org.opensuse.yast.printer.devices
controller: yast/printer/devices
</pre>
in a <tt>.yml</tt> file below <tt>config/resources</tt>. A resource
plugin can offer any number of resources this way.
<p></p><p>
Interfaces are <i>qualified names</i> like
<tt>org.opensuse.yast.system.language</tt> or
<tt>org.opensuse.yast.system.users</tt>. Ideally, these names should
match the prefix for the PolicyKit action controlling access to the resource.
</p>
<h4>Implementation details</h4>
<p>
To minimize name clashes, the controller implementing the resource
must be inside a namespace. Rails supports this by allowing
subdirectories below <tt>app/controllers</tt> and automatically wrapping
controller classes within modules matching the directory names.
</p><p>
Thus a <tt>network/device_controller</tt> and a <tt>printer/device_controller</tt> can
live side-by-side an be accessed as <tt>Network::DeviceController</tt> and
<tt>Printer::DeviceController</tt>. You could even nest more deeply like
<tt>Org::Opensuse::Yast::System::Users</tt>, but let's not overdo it.
</p><p>
Rails resource routing puts another restriction on URLs: Rails manages
routes as a set of maps, describing URLs as a combination of
controller (implementing the resource) and action. Thus the file name
and path of the controller define the URL, you cannot name them
independently. So the <tt>controller:</tt> value in the resource description directly affects the resulting URL. Different resource plugins should use different namespaces to effectively prevent name clashes.</p>
<h4>Querying the rest-service</h4>
<p>
The rest-service only publishes a single url, namely <tt>/resources</tt>, where clients can query for the URL offering a specific interface.
</p><p>
This URL follows RESTful principles since a HTTP GET request returns a
list of all resources. Its also possible to request a specific output
format, either by setting the <tt>Accept</tt> header of the http
request or by appending <tt>.xml</tt> or <tt>.html</tt>.
</p>
<p>You can easily try it out by starting the rest-service and pointing a browser to <a href="http://localhost:3000/resources">http://localhost:3000/resources</a>.</p>
<p>
To find the right resource URL, the client just needs to pass the interface name as <tt>?interface=<i>name</i></tt> and extract the reference from the result. Stay tuned for a future post exploring the client side in more detail.</p>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com4tag:blogger.com,1999:blog-29826356.post-40688359432088197482009-04-17T12:03:00.002+02:002009-04-17T12:06:30.406+02:00A closer look at REST<p><a href="http://en.opensuse.org/Yast">YaST</a>, the openSUSE installation
and configuration tool, is about to get <a href="http://news.opensuse.org/2009/03/05/112-roadmap-and-fixed-release-cycle-for-opensuse">a web based user interface</a>.</p><p>The interesting part of this is the proposed <a href="http://en.opensuse.org/YaST/Research#YaST_as_a_Service">service-oriented architecture</a>. <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>, Representational State Transfer, is currently the holy grail for managing resources (objects) using http.<br/>REST is not a protocol but an <em>architectural style</em> making best use of the properties of http. And the Internet is the best proof that this style performs and scales well with a distributed client/server architecture.</p><a href="http://en.wikipedia.org/wiki/Roy_Fielding">Roy Fielding</a>, one of the authors of the <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">http protocol</a>, has written a complete <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm">doctoral dissertation</a> on this topic. For the purpose of this blog entry, seeing it as a lightweight alternative to e.g. <a href="http://en.wikipedia.org/wiki/XML-RPC">XML-RPC</a> or <a href="http://en.wikipedia.org/wiki/SOAP_(protocol)">SOAP</a> is sufficient.</p>
<h4>How does it relate to YaST ?</h4>
<p>As Stefan has explained on <a href="http://lizards.opensuse.org/2009/02/03/yast-web/">his blog</a> before, a web based YaST will be splitted into client and server parts. This forms a <a href="http://en.wikipedia.org/wiki/Multitier_architecture">three tiered</a> architecture, where the server runs on the managed system and exposes a REST-style API to access YaST functionality.</p><p>Getting this API <em>right</em> in terms of extensibility, flexibility or conformance to REST best practices is an important design goal.</p>
<h4>Now whats good REST style ?</h4>
<p>There is no fixed list of requirements for REST or a
<it>conformance</it> testing tool. Designing a well behaved REST
implementation is mostly about learning from others experience and follow
common practice.</p>
<p>Browsing through <a href="http://delicious.com/popular/rest">popular REST</a> related bookmarks at <a href="http://delicious.com">delicious.com</a> gives me a much better signal-to-noise ratio than Google. And it pointed me to a couple of useful references for the do's and dont's when planning a REST-style architecture.
<ol>
<!--1--><li><a name="rest1" href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven">REST APIs must be hypertext-driven</a></li>
<!--2--><li><a name="rest2" href="http://barelyenough.org/blog/2008/05/versioning-rest-web-services">Versioning REST Web Services</a></li>
<!--3--><li><a name="rest3" href="http://www.prescod.net/rest/mistakes">Common REST Mistakes</a></li>
</ol>
<h5>Hypertext style</h5>
<p>The <a href="#rest1">first</a> is the most interesting (IMHO). Its
about exposing only a very limited set of explicit URIs. This also
prevents hard-coding them into the client but let the client query the
server instead. So you start from a single URI and hop from there
(thats what hypertext is all about!) to the right resource. Thats like moving from node to node in a state diagram.</p>
<h5>Versioning in media types</h5>
<p>When doing API versioning on the web, one might be tempted to do an all-or-nothing approach and embed a version specifier (like <tt>.../v1/...</tt>) into the URL. The <a href="#rest2">second link</a> above explains why this is a bad idea and comes up with a better one: media types. The client can tell the server how to format the response to an http request by setting the <tt>Accept</tt> field in the http header. Its like calling a function and telling it the expected return type.</p>
<p>And REST explicitly supports this style as it does not make any
assumption on the representation of a resource. Client and server are
free to agree on the actual format. Using XML for object serialization
is a smart move as it allows for extensibility. Clients just pick the
xml tags they need and ignore all others.</p>
<h5>Stateless</h5>
<p>REST, being based on http, stipulates a stateless protocol. Doing stateful REST is listed as one of the typical <a href="#rest3">mistakes</a> in implementing REST-style.<br/>Considering the proposed YaST web architecture, this means keeping state (session) information in the client and not in the server.</p>
<h4>More recommended reading</h4>
<p><ul>
<li><a href="http://www.xml.com/pub/a/2004/12/01/restful-web.html">How to Create a REST Protocol</a></li>
<li><a href="http://www.25hoursaday.com/weblog/2008/08/17/ExplainingRESTToDamienKatz.aspx">Explaining REST to Damien Katz</a></li>
<li><a href="http://www.xfront.com/REST.html">Roger L. Costello: REST</a></li>
</ul></p>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-86867445896189987542009-03-12T13:29:00.005+01:002010-04-29T16:20:43.728+02:00Satsolver bindings documentation available<p>One of the outstanding features of openSUSE is the <a href="http://en.opensuse.org/Package_Management/Sat_Solver">Sat solver</a> for package dependency resolution.</p><p>Somewhat unknown to most developers, Satsolver provides bindings for the three major scripting languages: Perl, Python and Ruby. The bindings provide an easy way to learn about the Satsolver API, to explore package metadata and play <em>what-if</em> scenarios installing, updating and deleting packages.</p><p>The bindings are created using <a href="http://www.swig.org/">SWIG</a> together with an <a href="http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=tree;f=applayer">application layer</a> on top of the raw libsatsolver. The focus is on usability and support of the scripting language, while hiding internals of the Satsolver implementation.</p><p>The bindings documentation are hosted at <a href="http://www.suse.de/~kkaempf/satsolver-bindings-ruby">http://www.suse.de/~kkaempf/satsolver-bindings-ruby</a> for now. I hope to find a permanent place at <tt>opensuse.org</tt> in the future.</p> <p>The documentation is created using <a href="http://rdoc.sourceforge.net/">rdoc</a> with a SWIG specific parser. rdoc comes with Ruby, just install the ruby package for the rdoc framework. The swig parser is currently hosted inside the <a href="http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=blob;f=bindings/ruby/parse_swig.rb">Satsolver git repo</a>.</p><p>Although based on a Ruby specific tool, the use of SWIG ensures portability across languages. Example uses of the bindings are available for <a href="http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=tree;f=bindings/perl/tests">Perl</a>, <a href="http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=tree;f=bindings/python/tests">Python</a> and <a href="http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=tree;f=bindings/ruby/tests">Ruby</a>
If you need Satsolver bindings for other languages, drop the <a href="mailto:zypp-devel@opensuse.org">ZYpp developers</a> a mail.</p>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com3tag:blogger.com,1999:blog-29826356.post-47236838092568926432009-03-09T12:34:00.000+01:002009-03-09T12:35:53.189+01:00D-Bus service on demand<p>Here is the last part of my mini-series about D-Bus, this time on <em>D-Bus activation</em></p>
<p>In <a href="http://kkaempf.blogspot.com/2009/02/driving-d-bus-with-ruby.html">my last blog entry</a> I talked about implementing a D-Bus service in Ruby. Running the service was done as a background daemon, started by root (or with other credentials).</p>
<p>D-Bus also provides an on-demand service creation, named <em>activation</em>. Here the D-Bus daemon creates the service as soon as a client is requesting it. Shutdown of the service is at the
discretion of the implementation, the D-Bus deamon does not automatically deactivate a running service.</p>
<h3>About D-Bus activation</h3>
<p>For D-Bus actication, you have to create a <tt>.service</tt> file. This is an <a href="http://en.wikipedia.org/wiki/Initialization_file">INI-style</a> format file containing<ul>
<li>the name of the service</li>
<li>the file to run, implementing the service</li>
<li>the user name to run the service as</li>
</ul></p><p>Since the D-Bus daemon runs as user 'messagebus' and thus is unprivileged. It cannot directly run the service or assume the correct user credentials.</p><p>Instead, it uses a <em>service helper</em> which is <a href="http://en.wikipedia.org/wiki/Setuid">setuid root</a> to start the service. This helper is configured within <tt>/etc/dbus-1/system.conf</tt> as <em><servicehelper></em> and typically resides below <tt>/lib/dbus-1/dbus-daemon-launch-helper</tt> (/lib64/dbus-1/dbus-daemon-launch-helper on 64bit systems).</p>
<p>dbus-daemon-launch-helper is extra-picky when it comes to security and checks its own configuration at startup. If your D-Bus service fails to get activated, maybe dbus-daemon-launch-helper is not correctly installed.</p>
<h3>Writing the .service file</h3>
<p>The name of the service file must be equal to the service name with a <tt>.service</tt> extension.</p>
<p>A typical service file for my.awesome.Service would be named <tt>my.awesome.Service.service</tt> and contain
<pre>
# DBus service activation config
[D-BUS Service]
Name=my.awesome.Service
Exec=/usr/bin/awesome
User=the_dude
</pre></p>
<p><em>Name</em> is the name of the service, <em>Exec</em> the path to the executable implementing the service and <em>User</em> the user name to run the service. Be careful when using <em>User=root</em>, only very few services actually need root rights.</p>
<p>The <em>Exec</em> line can also contain arguments to be passed to the executable. This can be used to e.g. implement multiple services in a single binary and pass the actual service name as a parameter.</p>
<h3>Installing the .service file</h3>
<p>Just copy the service file to either <tt>/usr/share/dbus-1/system-services</tt> (for a system bus service) or to <tt>/usr/share/dbus-1/services</tt> (for a session bus service).</p>
<p>Your service is now ready to run. The D-Bus daemon will automatically pick up changes in the service directories and find the new file.</p>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com4tag:blogger.com,1999:blog-29826356.post-34875588940455655562009-02-23T21:53:00.001+01:002009-03-27T14:59:09.409+01:00Driving the D-Bus with Ruby<!-- Driving the D-Bus with Ruby -->
<div xmlns='http://www.w3.org/1999/xhtml'>
<p>Having looked at the D-Bus from the client perspective <a href="http://kkaempf.blogspot.com/2009/02/riding-d-bus-with-ruby-last-time-i.html">before</a>, its now time to get behind the wheel.</p>
<p>In order to drive the D-Bus, you need to decide on a couple of things:<ul>
<li>which bus to drive<br/>you can choose between the system(-wide) bus or the (per-)session bus</li>
<li>the service name<br/>this is the name other clients can find your service, the name has dotted notation, e.g. <tt>my.awesome.Service</tt></li>
<li>the objects to publish<br/>each service can provide any number of objects, denoted a slash-separated path name, e.g. <tt>/my/awesome/Service/thing</tt></li>
<li>the interface name<br/>methods offered by objects are grouped by interface name. Usually its used to flag object capabilities. Interface names have dotted notation, usually prefixed by the service name, e.g. <tt>my.awesome.Service.Greeting</tt></li>
<li>the methods<br/>these are the exported functions of the objects. Methods, also called <i>members</i> in D-Bus speak, have input parameters and a return value.</li></ul></p>
<h4>Obtaining a drivers license</h4>
<p>Allowance for driving the D-Bus is controlled by config files below <tt>/etc/dbus-1</tt>. <tt>/etc/dbus-1/system.conf</tt> controls the system bus, <tt>/etc/dbus-1/session.conf</tt> controls the session bus. Both load additional configuration files from sub-directories
(<tt>/etc/dbus-1/system.d/</tt> resp. <tt>/etc/dbus-1/session.d/</tt>)</p>
<p>These config files are xml-based <em>busconfig</em> snippets, defining policies on who's allowed to own a service who can use which interfaces of the service.</p>
<p>A typical service configuration looks like this
<pre>
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="my.awesome.Service" />
<allow send_destination="my.awesome.Service" />
</policy>
<policy context="default">
<allow send_destination="my.awesome.Service"
send_interface="my.awesome.Service.Greeting" />
<!-- introspection is allowed -->
<allow send_destination="my.awesome.Service"
send_interface="org.freedesktop.DBus.Introspectable" />
</policy>
</busconfig>
</pre>
It gives <em>root</em> the right to own the service <em>my.awesome.Service</em> and to use it as a client. Any other user can only use the <em>my.awesome.Service.Greeting</em>
interface of <em>my.awesome.Service</em> and can introspect it.</p>
<p>Convention tells you to name this busconfig file after your service with a <tt>.conf</tt> extension, e.g <tt>my.awesome.Service.conf</tt>. Place it below <tt>/etc/dbus-1/session.d/</tt> or <tt>/etc/dbus-1/system.d/</tt>, depending which bus you want to drive.</p>
<h4>Coding a D-Bus service</h4>
<p>Examples for creating a D-Bus service using C are <a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html#glib-server">scarce</a> and <a href="http://raphael.slinckx.net/blog/documents/dbus-tutorial">scary</a>. Esp. programming in C while avoiding Glib, things become really <a href="http://lists.freedesktop.org/archives/dbus/2005-June/002764.html">ugly</a>.</p>
<p>As we will see, using the <a href="https://trac.luon.net/ruby-dbus/">ruby-dbus</a> extension to Ruby makes creating D-Bus services a breeze.</p>
<p>We start with creating a <em>DBus::Object</em> defining (dbus_)methods under a (dbus_)interface.
<pre name="code" class="ruby">
#!/usr/bin/env ruby
require 'dbus'
class Awesome < DBus::Object
# Create an interface.
dbus_interface "my.awesome.Service.Greeting" do
dbus_method :hola, "in name:s" do |name|
puts "Hola #{name}!"
end
dbus_method :hello, "in name:s, out res:s" do |name|
"hello #{name}!"
end
dbus_method :ahoj, "in name:s, in title:s" do |name,title|
puts "Ahoj #{title} #{name}!"
end
end
end
</pre>
<p>The <tt>dbus_method</tt> call get the method name passed as a symbol, followed by its signature. The signature describes the input (<em>"in"</em>) and output (<em>"out"</em>) parameters by name (before the colon) and type (after the colon).
The parameter names are just syntactic sugar, but the type is essential and enforced by D-Bus. Look at D-Bus <a href="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures">type signatures</a> to find out how to specify types.</p>
<p>ruby-dbus uses the method name and signature to automatically generate an XML representation of the interface needed for <a href="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus introspection</a>. This allows clients to find out about available interfaces and their methods at runtime.</p>
<p>The following <tt>do ... end</tt> block contains the method implementation. Every "in" parameter is passed as a value to the block in typical ruby fashion.</p>
<p>Next is connecting to the bus and obtaining the service. You can easily export multiple services if the bus configuration allows that.</p>
<pre name="code" class="ruby">
# Choose the bus (could also be DBus::session_bus)
bus = DBus::system_bus
# Define the service name
service = bus.request_service("my.awesome.Service")
</pre>
<p>Then we create the object and export it through the service.</p>
<pre name="code" class="ruby">
# Set the object path
obj = Awesome.new("/my/awesome/Service/thing")
# Export it!
service.export(obj)
</pre>
<p>Note that there is no requirement to create and export objects in advance. You can start with a simple object and method, creating additional objects as requested by the client. <a href="http://freedesktop.org/wiki/Software/hal">Hal</a> is a typical example for such a service.</p>
<p>Finally we start the listener and wait for incoming requests.</p>
<pre name="code" class="ruby">
# Now listen to incoming requests
main = DBus::Main.new
main << bus
main.run
</pre>
<p><tt>main.run</tt> never returns, as you would expect from a service daemon. Either <em>kill(1)</em> it, code a timeout signal or implement a method calling <em>exit</em>.</p>
<h4>Running the service</h4>
<p>Running the D-Bus service is as easy as running any other Ruby program:
<pre>
kkaempf> ruby my_service.rb
</pre>
This, however, will get you a <tt>Exception `DBus::Error' at (eval):26 - org.freedesktop.DBus.Error.AccessDenied: Connection ":1.967" is not allowed to own the service "my.awesome.Service" due to security policies in the configuration file</tt></p>
<p>Looking at our <em>busconfig</em> defined above immediately reveals the error. Only user root is allowed to <em>own</em> the service. So we better do a <pre>
kkaempf> sudo ruby my_service.rb
</pre>
to get this running.</p>
<p>Now congrats for passing your drivers exam ! ;-)</p>
</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com2tag:blogger.com,1999:blog-29826356.post-36782750471230623082009-02-13T16:45:00.000+01:002009-03-27T14:59:09.410+01:00<h3>Riding the D-Bus with Ruby</h3>
The last time I looked at <a href="http://en.wikipedia.org/wiki/D-Bus">D-Bus</a> is a couple of years ago. What I saw back then was promising in technology but ugly in (C-)programming. D-Bus has come a long way 'til then.
<p>
And so have my programming skills with scripting languages, esp. with Ruby. The <a href="https://trac.luon.net/ruby-dbus/">ruby-dbus</a> project provides a nice and easy-to-use programming API, once one has mastered the lack of examples and the D-Bus nomenclature.
</p>
<h4>About D-Bus</h4>
<p>
There is <a href="http://www.redhat.com/magazine/003jan05/features/dbus/">plenty</a> of <a href="http://doc.trolltech.com/4.2/intro-to-dbus.html">information</a> available on D-Bus. I personally found the <a href="http://www.freedesktop.org/wiki/IntroductionToDBus">Introduction to D-Bus</a> most valuable from a developers point of view.
</p><p>
D-Bus originates from the <a href="http://www.freedesktop.org">freedesktop.org</a> initiative and is hosted at <a href="http://www.freedesktop.org/wiki/Software/dbus">www.freedesktop.org</a>
</p><p>
Basically, D-Bus is a RPC (remote procedure call) mechanism, allowing different programs to talk to each other and provide services in a standardized way.
</p><p>
The transport used for talking is called a bus, meaning everyone can ride (connect to) it. Usually there are two independent buses available
<ul>
<li>System bus<br/>This is for system-wide services, like hardware information (usually provided by <a href="http://en.wikipedia.org/wiki/Hardware_abstraction_layer">HAL</a>)
</li>
<li>Session bus<br/>This is for per-login services, like a Gnome Desktop session.
</li>
</ul>
Talking is done in a client/server fashion. The server code connects to the bus offering a service to be used by the clients.
In order to find each other, services are names in a dotted syntax. E.g. <tt>org.freedesktop.Hal</tt> is offered by the HAL daemon providing hardware information.
<p>
The nice thing about D-Bus is that it allows introspection. You can ask a service about its capabilities. And the D-Bus itself is a service, so you just need to know about <tt>org.freedesktop.DBus</tt> to find all other services.
</p><p>
Services provide objects. These are organized in a tree-like fashion and typically addressed using slash-separated paths, just like filenames. Iterating over the objects of <tt>org.freedesktop.Hal</tt> gives you all devices.
</p></p>
Objects then have members. Members are methods to call, providing the functionality of the service. To make things more <s>complicated</s>structured, members are grouped in interfaces. Interfaces are comparable to capabilities of an object.
For example the Hal object <tt>/org/freedesktop/Hal/devices/storage_model_DVDRW_LH_20A1S</tt> has the <tt>org.freedesktop.Hal.Device.Storage.Removable</tt> interface with the <tt>bool CheckForMedia()</tt> method.
<p/><p>
Putting it all together gives you this chain<br/>
Bus (System/Session)<br/>
-> Service (e.g. <tt>org.freedesktop.Hal</tt>)<br/>
-> Object (e.g. <tt>/org/freedesktop/Hal/devices/storage_model_DVDRW_LH_20A1S</tt>)<br/>
-> Interface (e.g. <tt>org.freedesktop.Hal.Device.Storage.Removable</tt>)<br/>
-> Member (e.g. <tt>bool CheckForMedia()</tt>)
</p>
There's more to D-Bus, like signals and signatures and activation and ... follow the documentation links given above if you want to learn it all. The explanation up to now should be sufficient to understand the basics of the ruby-dbus interface, however.
<h4>Using ruby-dbus</h4>
Connecting to the bus in Ruby is as easy as
<pre name="code" class="ruby">
require 'dbus'
bus = DBus::SystemBus.instance
# resp. 'bus = DBus::SessionBus.instance'
</pre>
<tt>DBus::SystemBus</tt> is a Singleton, hence the <tt>.instance</tt> instead of the usual <tt>.new</tt> for creating the object.
<p>
Now you can create a proxy object. Its named 'proxy' because the real object lives on the other side of the connection, in the service. The proxy object is in your application and proxy-ing calls via D-Bus to the service object.
You can use this to find all services on the bus
</p>
<pre name="code" class="ruby">
require 'dbus'
bus = DBus::SystemBus.instance
bus.proxy.ListNames[0].each do |service|
puts "Service: #{service}"
end
</pre>
Given a known service, D-Bus introspection allows to find its objects, subnodes and interfaces
<pre name="code" class="ruby">
require 'dbus'
bus = DBus::SystemBus.instance
# Create the proxy object
proxy = bus.introspect "org.freedesktop.Hal", "/"
# proxy.bus gives you the bus
# proxy.path is the object path
# proxy.destination is the service name
# Print object interfaces
proxy.interfaces.each do |interface|
puts "Object #{proxy.path} provides #{interface}"
end
# Print object subnodes
proxy.subnodes.each do |path|
puts "-> #{proxy.path}/#{path}"
end
</pre>
A specific interface of an object can be accessed by the <tt>[]</tt> operator. And the interface knows about the signature of its methods.
<pre name="code" class="ruby">
require 'dbus'
bus = DBus::SystemBus.instance
# create proxy for the 'computer' device
proxy = bus.introspect "org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer"
# Print object interfaces
proxy.interfaces.each do |interface|
puts "Object #{proxy.path} provides #{interface}"
proxy[interface].methods.each do |key,value|
puts " #{value.rets} #{key}( #{value.params} )"
end
end
</pre>
Due to the dynamic nature of Ruby, Object methods are directly accessible in normal Ruby conventions. One just has to select the right interface first.
<pre name="code" class="ruby">
require 'dbus'
bus = DBus::SystemBus.instance
proxy = bus.introspect "org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer"
iface = proxy["org.freedesktop.Hal.Device.CPUFreq"]
freq = iface.GetCPUFreqPerformance
gov = iface.GetCPUFreqGovernor
puts "Frequency #{freq}, Governor #{gov}"
</pre>
Riding the D-Bus with Ruby is easy and fun !kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-7105647266700057152009-01-16T13:45:00.002+01:002009-03-27T14:59:09.410+01:00About memory ownership in SWIG and Python<div xmlns='http://www.w3.org/1999/xhtml'>Today, a <a href='https://bugzilla.novell.com/show_bug.cgi?id=427372'>long-standing bug</a> in <a href='http://svn.opensuse.org/svn/yast/trunk/libyui-bindings'>libyui-bindings</a> was finally fixed.
<h4>About libyui and libyui-bindings</h4>
libyui-bindings provides <a href='http://www.swig.org'>SWIG</a> based bindings for Ruby, Python and Perl to access <a href='http://svn.opensuse.org/svn/yast/trunk/libyui'>libyui</a> functionality. libyui is the YaST user interface library, allowing to write dialogs in a generic way so they can be displayed in text (ncurses) or graphical (Qt) environments.
<h4>Reference counting</h4>
The core of the problem is libyui relying on YaST data structures. These data structures implement reference counting, so one doesn't have to release allocated memory explicitly. That all fine, as long as you use YaST's YCP programming language to code dialogs. But coding YCP is not necessarily something a lot of developers are looking forward to.<br/>
Thats where libyui-bindings enter stage and remove the YCP restriction. I've <a href='http://kkaempf.blogspot.com/2008/05/declaring-ui-independence-earlier-this.html'>blogged about</a> it ealier and <a href='http://en.opensuse.org/User:Dl9pf'>Jan-Simon</a> was especially active in providing lot of <a href='http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/python/examples'>Python examples</a>.
<h4>Competing on memory ownership</h4>
Now Python is a nice scripting language but has the bad habit of doing <a href='http://www.python.org/doc/1.5.2p2/ext/refcountsInPython.html'>reference counting</a> itself. This makes coding Python extensions in C quite awkward and clashes with libyui. Speaking of bad habits, libyui also has one - claiming ownership of memory passed as pointers to some functions.<br/>
Fun starts when freeing memory. libyui and Python enter a nasty fight which Linux ends with a SIGSEGV.
Jan-Simon reported this <a href='https://bugzilla.novell.com/show_bug.cgi?id=427372'>as a bug</a> and provided a nice test case.
<h4>Swig typemaps</h4>
After some googling and reading the <a href='http://www.swig.org/doc.html'>SWIG documentation</a> a couple of times, SWIGs <tt>DISOWN</tt> typemap was the solution. Documentation for this is sparse and well hidden within the <a href='http://www.swig.org/Doc1.3/Chicken.html#collection'><em>Chicken</em> language</a> chapter. Grrr.<br/>
<a href='http://www.swig.org/Doc1.3/Typemaps.html'>SWIG typemaps</a> apply to function parameters and match the parameter type and name. One cannot specify per-function typemaps, only per-parameter. Fixing the bug required libyui to explicitly <a href='https://bugzilla.novell.com/show_bug.cgi?id=427372#c16'>name parameters</a> claiming ownership of memory. All such parameters within the libyui API are now ending with <tt>_disown</tt>.
<h4>Solving the case</h4>
Applying the typemap is done using the <a href='http://www.swig.org/Doc1.3/Typemaps.html#Typemaps_nn48'><tt>%apply</tt></a> directive:
<pre>
%apply SWIGTYPE *DISOWN { YItem *item_disown };
%apply SWIGTYPE *DISOWN { YEvent *event_disown };
%apply SWIGTYPE *DISOWN { YTableCell *cell_disown };
%apply SWIGTYPE *DISOWN { YWidgetID *newId_disown };
%apply SWIGTYPE *DISOWN { YTableHeader *header_disown };
%apply SWIGTYPE *DISOWN { YTableHeader *header_disown };
%apply SWIGTYPE *DISOWN { YWidget *parent_disown };
</pre>
Now Python gives up ownership for structures passed through a <tt>_disown</tt> parameter to libyui and all <a href='http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/python/examples'>libyui Python examples</a> run without coredumps. Case closed.</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com1tag:blogger.com,1999:blog-29826356.post-74930914112166249492009-01-13T16:15:00.005+01:002009-01-15T16:36:46.753+01:00Report from Fourth Annual Management Developers ConferenceThe fourth <a href="http://www.mandevcon.com/">Management Developers Conference</a> (mandevcon) took place November 17 - 20 2008, in Santa Clara, California.<br/>
<br/>
This is the annual get together of people involved and interested in systems management technologies and standards as defined by the <a href="http://www.dmtf.org/">Distributed Management Task Force</a> (DMTF).<br/>
<br/>
The DMTF is an industry organization defining systems management standards such as the <a href="http://www.dmtf.org/standards/cim">Common Information Model</a> (CIM) or <a href="http://www.dmtf.org/standards/wsman">Web Services for Management</a> (WS-Management).<br/>
<br/>
For my employer, these standards play an important role as they're part of the <a href="http://www.novell.com/news/pressmicrosoft_and_novell_announce_broad_collaboration_on_windows_and_linux_interoperability_and_support">Novell/Microsoft technical collaboration agreement</a> about interoperable systems management.<br/>
<br/>
Compared to last year, attendance to the conference was very low. I guess only about a third of last years attendance numbers were reached. This decline was mostly attributed to slashed travel budgets due to the tough economy. However, hallway conversations also hinted towards lack of scope of the conference, trying to be everything for everyone. A split into research, development and deployment topics is probably needed.<br/>
<br/>
Presentations during the three days of the conference are divided into three parallel tracks. These were<ul><li>the DMTF industry initiatives (http://www.dmtf.org/initiatives)<br/>
like<ul><li>SMI (storage management)</li><li>CDM (diagnostic)</li><li>CMDB (configuration database)</li><li>Virtualization</li><li>SMASH (server hardware)</li><li>DASH (desktop hardware)</li></ul></li><li>CIM core technology</li><li>Web Services for Management</li><li>Developers</li></ul>The full conference schedule can be obtained from <a href="http://www.mandevcon.com/schedule.html">here</a>.<br/>Sadly, the presentation slides (mostly PDF) are only available to attendees (authorization needed).<br/>
<br/>
Being busy with my own slides, I wasn't able to attend as many presentations as I wanted. But I still made it to the following presentations of the first day:<br/>
<br/><h4>Python CIM providers</h4>Writing CIM instrumentation has a long history of being complicated and needing C or C++. <a href="http://pywbem.wiki.sourceforge.net/space/showimage/MDC_2008_Python_Providers.pdf">Bart Whiteley of Novell presented</a> <a href="http://pywbem.wiki.sourceforge.net/">pywbem</a>, showing how to write CIM providers in a modern scripting language. Pywbem also comes with a provider generator, spitting out a Python skeleton provider from the definition of its CIM classes.<br/>
<br/><h4>Multi-Tenant CIMOM, Fact or Fiction</h4>There are a couple of CIM object managers (CIMOMs) available, mostly as open-source. However, CIM providers are mostly CIMOM-specific and can't be easily ported. With the <a href="http://www.openpegasus.org/uploads/40/3390/cmpi-overview.pdf">Common Manageablity Programming Interface</a> (CMPI), a standard ABI for CIM providers is established. Still configuration information required to install a provider is different from CIMOM to CIMOM.<br/>
<br/>
This presentation showed typical obstacles in writing portable providers and gave rules and recommendations to make a provider cimom-agnostic.<br/>
<br/><h4>cmpi-bindings - Compiler Free Provider Development</h4>This was the first of my own presentations. <a href="http://omc.svn.sourceforge.net/viewvc/omc/cmpi-bindings/trunk/doc/cmpi-bindings.pdf">Cmpi-bindings</a> serves a similar purpose like pywbem, freeing CIM provider developers from the need for C or C++.<br/>
<br/>
<a href="http://developer.novell.com/wiki/index.php/CMPI-bindings">cmpi-bindings</a> uses <a href="http://www.blogger.com/www.swig.org">SWIG</a> to generate bindings between the Common Manageablity Programming Interface (CMPI, the ABI between a CIMOM and a CIM provider) and a scripting language. Currently supported are Python, Ruby and Perl. Any other SWIG supported language can be added fairly easily. cmpi-bindings use SWIG in an innovative way, allowing to call into the scripting language from the CIMOM. This effectively reverses the typical flow of control for SWIG, which is calling a C or C++ library from a scripting language.<br/>
<br/><h4>Testing with PyWBEM</h4>Automated testing of CIM providers is often neglegted and developers use plain CIM browsers to explore their code.<br/>
<br/>
<a href="http://samba.org/%7Etpot/mdc2008/MDC2008-Testing%20Providers%20with%20PyWBEM.pdf">Tim Potter showed</a> various ways for testing providers with the help of Python and pywbem. Most interesting was learning about <a href="http://twistedmatrix.com/">Twisted</a>, a Python networking framework for asynchronous programming. This stuff makes your brain hurt and the <a href="http://www.oreilly.com/catalog/covers/twistedadn.s.gif">O'Reilly book title illustration</a> is worth a thousand words ;-)<br/>
<br/>
<hr /><br/>
On day 2, I had the opportunity to attend Microsofts 'Strategic Architect Forum' in San Francisco. So I skipped the mandevcon presentations for that day. I'll blog later about the Microsoft conference.<br/>
<hr /><br/>
The last day had a complete track on WS-Management.<br/>
It started with a generic introduction by Josh Cohen from Microsoft. Josh is leading the WS-Management work group within the DMTF and the driving force behind Microsofts adaption of an open standard for systems management. Too bad his presentation isn't available online.<br/>
<br/><h4>Openwsman swig bindings</h4>Anas Nashif, of AutoYaST fame, showed the Openwsman swig bindings <a href="http://www.openwsman.org/">Openwsman</a> is an open source implementation of the WS-Management protocol, used e.g. by <a href="http://msdn.microsoft.com/en-us/library/aa384426%28VS.85%29.aspx">Microsoft Windows for remote systems management</a>.<br/>
<br/>
These bindings allow for easy ws-management client programming using one's favorite programming language. Fully supported currently are Python, Ruby and Java (yuck!).<br/>
<br/><h4>Scripting openwsman server plugins</h4><a href="http://www.dmtf.org/standards/wsman">WS-Managment</a> is a generic protocol for resource management. Each resource is identified by a universal resource identifier (URI), which onsists of a namespace and a resource part. The openwsman server maps namespaces to plugins and lets the plugin handle the specific resource implementation.<br/>
<br/>
Openwsman includes default plugins for the generic Identify operation and for CIM operations (WS-CIM). Writing plugins in C is easy, using a scripting language makes it even easier.<br/>
<br/>
<a href="http://www.openwsman.org/files/openwsman_server_plugins.pdf">My presentation</a> shows how the problem was approached and describes the implementation. It is in an alpha state currently and needs some more work to become fully functional. This will also require some changes in the openwsman plugin API to fully support plugins.<br/>
The code is part of the <a href="https://openwsman.svn.sourceforge.net/svnroot/openwsman">openwsman svn repository</a> and available <a href="http://openwsman.svn.sourceforge.net/viewvc/openwsman/openwsman/trunk/src/plugins/swig">here</a>.<br/>
<br/><h4>ActiveWSMAN</h4>One thing that bothers me when coding against the openwsman client API is the amount of protocol knowledge needed. Doing a simple enumeration call requires one to know about the enumerate, pull and release protocol functions. Not to mention keeping track of the context.<br/>
<br/>
Having enjoyed the <a href="http://en.wikipedia.org/wiki/Active_record_pattern">ActiveRecord pattern</a> as implemented in <a href="http://www.rubyonrails.org/">Ruby On Rails</a>, I collected some thoughts around using this for WS-Management client programming.<br/>
<br/>
<a href="http://www.openwsman.org/files/activewsman.pdf">The presentation</a> shows a concept on how to make a developers life much easier. It focuses on resources and their semantics, completely hiding the internals of the ws-management protocol.<br/>
<br/>
A proof-of-concept implementation based on ActiveRecord exists and I itend to complete it in the next couple of weeks.<br/>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-77317971487704482012008-05-20T11:09:00.001+02:002008-05-20T11:25:54.954+02:00<h4>Declaring UI independence</h4>Earlier this year, <a href="http://lists.opensuse.org/yast-devel/2008-02/msg00139.html">Stefan announced</a> the availability of the YaST user interface engine separate from YaST itself.<br/>
The user interface engine, packaged in <tt>yast2-libyui</tt> (source code <a href="http://svn.opensuse.org/svn/yast/trunk/libyui">here</a>),provides the abstraction from graphical user interfaces (Qt, Gtk) and text based (ncurses) user interfaces. It now can be used independently of YaST2 for generic (C++) applications.<br/>
Now what can you do with it ? First of all, you can use C++ to code YaST-like dialogs which display either in graphical mode (Qt or Gtk style) or text mode. This independence from the output media is a main feature of YaST.<br/>Being separated from YaST, one can use the UI engine for stand-alone programs. A trivial example is a simple window with a text label and an 'Ok' button:
<a style="display:block; color: #888;" href="http://svn.opensuse.org/svn/yast/trunk/libyui/examples/HelloWorld.cc">
<img style="border: 1px solid ; margin: 10px; padding: 5px;" src="http://lh5.ggpht.com/kkaempf/SDKExy4HqNI/AAAAAAAAAHU/s-uwIwKpi0g/s800/helloworld-cc.png" alt="HelloWorld.cc"/>HelloWorld.cc</a>
Compile with
<pre>g++ -I/usr/include/YaST2/yui -lyui HelloWorld.cc -o HelloWorld</pre>
and run it via
<pre>./HelloWorld</pre>
Depending on the <tt>DISPLAY</tt> environment variable the UI engine automatically determines and loads the right plugin to render the dialog.
<div style="width: 500px;">
<img style="margin: 30px; width: 101px; float: left;" src="http://lh6.ggpht.com/kkaempf/SDGDVS4Hp9I/AAAAAAAAAD8/UKwgSPmNiWU/s288/helloworld-qt.png" />
<img style="width: 300px;" src="http://lh6.ggpht.com/kkaempf/SDGBzS4Hp6I/AAAAAAAAADk/V_j8pDC2k5w/s288/helloworld-ncurses.png" />
</div>
A simple <tt>unset DISPLAY</tt> will give you the ncurses look.
<h4>Enter SWIG</h4>Coding dialogs in C++ takes away the highly useful <em>edit</em>-<em>run</em> mode of development which is possible with YaSTs <a href="http://forgeftp.novell.com/yast/doc/SL10.2/tdg/big_over_modules.html">YCP language</a>.<br/>
With the help of <a href="http://www.swig.org">SWIG</a>, a generator for language bindings, one can now use his <a href="http://www.swig.org/compat.html">favorite programming language</a> for coding dialogs.
The <a href="http://svn.opensuse.org/svn/yast/trunk/libyui-bindings">initial release</a> of the bindings supports <a href="http://www.ruby-lang.org/">Ruby</a> (<tt>libyui-ruby</tt>),
<a href="http://www.python.org/">Python</a> (<tt>libyui-python</tt>) and <a href="http://www.perl.org/">Perl</a> (<tt>perl-libyui</tt>).<br/>
Swig can directly translate the C++ classes into e.g. Ruby classes making conversion of the above C++ code to Ruby straightforward:
<a style="display:block; color: #888;" href="http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/ruby/examples/hello_world.rb">
<img style="border: 1px solid ; margin: 10px; padding: 5px;" src="http://lh4.ggpht.com/kkaempf/SDKGui4HqQI/AAAAAAAAAH4/LCsDkG5vUbI/s800/helloworld-rb.png" border="0" alt="hello_world.rb" />hello_world.rb</a>
Translation to object-oriented Python gives you
<a style="display:block; color: #888;" href="http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/python/examples/hello_world.py">
<img style="border: 1px solid ; margin: 10px; padding: 5px;" src="http://lh6.ggpht.com/kkaempf/SDKIlC4HqSI/AAAAAAAAAIQ/iwE2xVk3WRM/s800/helloworld-py.png" border="0" alt="hello_world.py" />hello_world.py</a>
Even Perl, although not object-oriented, gives reasonable code. But internals of the Swig-generated bindings are not for the faint-hearted ...
<a style="display:block; color: #888;" href="http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/perl/examples/hello_world.pl">
<img style="border: 1px solid ; margin: 10px; padding: 5px;" src="http://lh5.ggpht.com/kkaempf/SDKHFy4HqRI/AAAAAAAAAIE/riGQY9eDJ9c/s800/helloworld-pl.png" alt="hello_world.pl" />hello_world.pl</a>
<a href="http://svn.opensuse.org/svn/yast/trunk/libyui">yast2-libyui</a> comes with a <a href="http://svn.opensuse.org/svn/yast/trunk/libyui/examples">couple of more examples</a>.<br/>
<a href="http://svn.opensuse.org/svn/yast/trunk/libyui/examples/SelectionBox1.cc">SelectionBox1.cc</a> shows how to fill a selection list, use buttons and update labels.
<div>
<img style="margin: 30px 0 0 30px;" src="http://lh6.ggpht.com/kkaempf/SDGBzS4Hp8I/AAAAAAAAAD0/r2LcTD0ftwc/selectionbox1-qt.png"/>
(SelectionBox1)</div>
Here's the Ruby version:
<a style="display:block; color: #888;" href="http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/ruby/examples/selection_box1.rb">
<img style="border: 1px solid ; margin: 10px; padding: 5px;" src="http://lh6.ggpht.com/kkaempf/SDKEgC4HqMI/AAAAAAAAAHI/lW6FDfpM5r4/s800/selectionbox1-rb.png" alt="selection_box1.rb" />selection_box1.rb</a>
Enjoy !kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com7tag:blogger.com,1999:blog-29826356.post-20895770410853617792008-02-02T21:56:00.001+01:002009-03-27T14:58:35.096+01:00Open Source Meets Business - Day 3 (final)<div xmlns="http://www.w3.org/1999/xhtml">(continued from <a href="http://www.blogger.com/%3Cbr/%3Ehttp://kkaempf.blogspot.com/2008/01/open-source-meets-business-day-2.html">here</a>)
The last day of <a href="http://www.heise.de/events/2008/open_source_meets_business">open source meets business</a> had presentations in the morning and put a spotlight on Microsoft in the afternoon.
<h4>Systems monitoring with open source</h4>Again, a talk about <a href="http://www.nagios.org/">Nagios</a>. And again, Nagios was choosen for its cost effectiveness. It seems like most commercial monitoring tools charge per monitored device - customers really dislike this.
<a href="http://www.oberschwabenklinik.de/">Oberschwaben Klinik</a> uses Nagios to monitor interfaces, infrastructure, services, applications and devices distributed across 200 hosts, 500 services in 6 locations. Total deployment time for Nagios was a single month:<ul><li>3 days initial setup</li><li>1 week learning the tool</li><li>2 days adaption to infrastructure</li>
<li>3 weeks betaphase (getting the alarm thresholds right)</li><li>3 days finetuning</li></ul>And they only needed about one week of external consulting.
Besides Nagios, the use <a href="http://www.cacti.net/">Cacti</a> for QoS monitoring.
<h4>Software for knowledge worker</h4><a href="http://www.pflaeging.net/">Peter Pfläging</a>, working for the City of Wien, pointed out that job roles have changed over the years from being topic specific towards knowledge workers, which he characterizes as<ul><li>having many tasks</li><li>no applicable standards to approach problems</li><li>coerced to lifetime learning</li><li>lots of brainstorming to find solutions</li><li>decisions makers</li></ul>and having to explain the stuff to upper management.
They all face the problem of organizing information, prioritizing tasks and documentation (for themselves and others). Peter presented (his choice of) open source tools supporting this style of work on multiple operating systems.<ol><li>Mind maps
<a href="http://en.wikipedia.org/wiki/OPML">OPML</a>: xml data format, <a href="http://freemind.sourceforge.net/">Freemind</a>, <a href="http://www.deepamehta.de/">DeepaMetha</a>, <a href="http://wikkawiki.org/">WikkaWiki</a>, <a href="http://rubyforge.org/projects/pimki">Pimki</a>
</li><li>Task prioritization
<a href="http://en.wikipedia.org/wiki/Getting_Things_Done">GtD</a>, <a href="http://www.thinkingrock.com.au/">ThinkingRock</a>, <a href="http://www.dcubed.ca/">d3/dcubed.ca</a>, <a href="http://gtd-php.com/">gtd-php</a>, (Bloggers note: <a href="http://www.rousette.org.uk/projects">Tracks</a>)
</li><li>Wiki
<a href="http://en.wikipedia.org/wiki/Personal_Wiki">Personal Wiki</a>, <a href="http://moinmo.in/">Moin Moin</a>, <a href="http://www.tiddlywiki.com/">TiddlyWiki</a>
</li><li>Blogging
Weblog with private entries, document your knowledge. <a href="http://wordpress.org/">WordPress</a>, <a href="http://typo3.org/">Typo</a>, <a href="http://blojsom.com/">Blojsom</a>
</li><li>Desktop search
For Windows there is <a href="http://desktop.google.com/">Google desktop</a> and <a href="http://www.copernic.com/">Copernic</a>. On Linux <a href="http://beagle-project.org/">Beagle</a> doesn't have a real competitor.
</li></ol>You should also prevent others from changing your document by using signed pdfs. Creating pdfs is a breeze on Linux but one needs <a href="http://www.pdfforge.org/">PDFcreator</a> on Windows. Then you can use Peters <a href="http://portablesigner.sourceforge.net/">PortableSigner</a> for signing.
<h4>LiMux</h4>Here one learned about the current state of <a href="http://www.muenchen.de/limux">LiMux</a>. The City of Munich choosed to develop their own 'base client' (running on Debian Linux)
One thousand workstations are currently migrated (first 100 in 2006, 900 more last year) and about 5000 PCs already use OpenOffice. The base client is 'usability TUV IT certified' (<i>Gebrauchstauglicher Basisclient</i>) and their <i>Linux Lernwelt</i> learning tool won the European E-Learning award last year.
The 'base client' core consist of (Debian) Linux, OpenOffice, Firefox and Gimp. Specific applications run browser-based, vintage (windows based) applications use <a href="http://www.winehq.org/">Wine</a>, virtualization or <a href="http://en.wikipedia.org/wiki/Terminal_Server">terminal server</a>.
The clients are managed by <a href="http://gosa-project.org/">GOsa</a> using <a href="http://www.informatik.uni-koeln.de/fai">FAI</a> for deployment. GOsa itself is a set of PHP5 scripts used for deployment and configuration management (users, groups, mail, dns, dhcp, ...) using LDAP as a central <a href="http://en.wikipedia.org/wiki/CMDB">CMDB</a>. For update deployment <a href="http://www.informatik.uni-koeln.de/fai">FAI</a> is currently used, doing inventory, license managementt, log analysis (audit) and hardware-monitoring. The upcoming version 2.6 of GOsa will support scheduled and load balanced mass deployment, replacing FAI.
<h4>Nagios at Stadtwerke Amberg</h4>The <a href="http://www.amberg.de/">city of Amberg</a> suffers from an understuffed IT department and outsourced monitoring. This works fine with Nagios and the external consulting company is soo great, blah, blah, blah ...
<h4>How open is Microsoft after the EU ruling ?</h4>This was mostly about the <a href="http://news.samba.org/announcements/pfif">Samba/Microsoft agreement</a> as detailed on <a href="http://www.groklaw.net/articlebasic.php?story=20071220124013919">Groklaw</a>.
Conclusion: with the current business model (public company, maximizing shareholder value), Microsoft will not open up too much.
<h4>Open source and Microsoft</h4>Sam Ramji, director Open Source and Linux Strategy at Microsoft, tried to put his employer in a good light by pointing out that 50% of all open source deployments are on Windows. Half of all sourceforge projects run on Windows, 3000 are for Windows only.
He continued to outline Microsofts open source strategy with Windows at its core, surrounded by OSS applications. (see also <a href="http://blogs.zdnet.com/microsoft/?p=1142">this post</a>)
A Microsoft based infrastructure (Active Directory, Systems Center, SQL Server) will grow Windows with help of OSS applications. Microsoft will develop free software to support the interface layer between the free and the proprietary world. This is done in the Open Source Software Labs (OSSL), currently established in Redmond and Cambridge, Mass. These labs focus on strategy, technical research and development of document formats, network protocols, security&identy, systems management, virtualization and application platforms.
The long term goal is "<i>respectful relationship</quote> to <quote>produce insights and technology to compete, interoperate and collaborate</i>".
Best quote (Ramji on Ballmer): "<i>Its time to reset peoples perception of what he means when he talks</i>"
<h4>Panel Discussion: Microsoft and open source</h4>Dr Oliver Diederich (Heise Verlag) assembled Roger Levy (Novell), Jim Zemlin (Linux Foundation) , Paul Cormier (RedHat), Sam Ramji (Microsoft) and Dr Johannes Helbig (Deutsche Post) to discuss the relationship of Microsoft and the open source movement. The complete discussion was recorded and is available <a href="http://www.heise.de/open/webcast">here</a>.
</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com3tag:blogger.com,1999:blog-29826356.post-37956494599900259842008-02-01T14:28:00.001+01:002009-03-27T14:58:06.989+01:00Novell Brainshare registration fun<div xmlns='http://www.w3.org/1999/xhtml'><a href='http://www.novell.com/brainshare/'>Novell Brainshare</a> will be held March 16-21. 2008 at the Salt Palace Convention Center in Salt Lake City, UT.
Registration is open now and you can also apply for <a href="http://www.novell.com/brainshare/connect.html">Brainshare Connect</a> to find other conference registrants with similar interests.
The application form asks for your area of expertise, some work information, areas of interest and to choose your hobbies from a predefined list. Among this list are <a href='http://www.majorleagueeating.com/'>competitive eating</a> and <a href='http://en.wikipedia.org/wiki/Dumpster_diving'>dumpster diving</a>. I just wonder if these groups will do a BOF at Brainshare ...</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-19177055579631277622008-01-31T18:05:00.001+01:002009-03-27T14:58:35.097+01:00Open Source Meets Business - Day 2<div xmlns='http://www.w3.org/1999/xhtml'>(continued from <a href='http://kkaempf.blogspot.com/2008/01/open-source-meets-business-day1.html'>here</a>)
<h4>Workflow management with BPEL</h4>
<a href='http://en.wikipedia.org/wiki/BPEL'>BPEL</a>, the business process execution language, can be used as interface between management (defining/modeling process requirements) and IT (implementing services).
Its object-oriented approach makes it possible to divide & conquer large tasks into Business/Architecture/Processes. BPEL allows to apply a consistent and repeteable processes which can be measured/monitored.
The basic concept is SOA (service oriented architecture). Bpel adds a recursive aggregation model for web services and workflow mgmt. This all should allow for service orchestration and <i>programming in the large</i>.
BPEL is standardized by <a href='http://oasis-open.org'>OASIS</a> as <a href='http://oasis-open.org/committees/wsbpel'>WS-BPEL</a>). A graphical workflow designer and debugger is available through the <a href='http://www.eclipse.org/bpel'>Eclipse project</a>.
One can download an open source implementation of both the BPEL4WS 1.1 specification and the WSBPEL 2.0 standard at <a href='http://activebpel.org'>http://activebpel.org</a>
<h4>OPSI - open pc server integration</h4>
OPSI is an open source desktop management system available at <a href='http://opsi.org'>http://opsi.org</a>
While it is based on a Linux server its primary targets are Windows workstations. Written in Python, it provides inventory, deployment and patch & update management through a java UI.
The presenter gave a short demo and highlighted the nice interface for composing database queries. Windows admins wanting to deplay opsi shouldn't be afraid of the command line, though.
<h4>Complete scalability with integrated virtualization</h4>
The title gave the impression of getting some facts and the presenters title of 'Solution Architect' made me actually believe this. Boy was I wrong. I couldn't stand half an hour of marketing fluff and 'Redhat can do it all' without any proof. Had to leave early...
<h4>VirtualBox</h4>
This one was nice. <a href='http://www.virtualbox.org'>VirtualBox</a> is (yet another) open source virtualization solution. Unlike <a href='http://www.xensource.com'>Xen</a>, it provides full virtualization and is able to run unmodified guest even without hardware (Intel-VT, AMD-V) support. So it plays in the league of <a href='http://en.wikipedia.org/wiki/Microsoft_Virtual_PC'>VirtualPC</a>, <a href='http://www.vmware.com/'>VMware</a> or <a href='http://www.parallels.com/'>Parallels</a>.
VirtualBox runs on Windows, Linux, MacOS and Solaris and supports all major operating systems (Windos XP, Windows Vista, Linux, Solaris, OS/2). I downloaded a copy and installed it on my OpenSUSE 10.3 laptop during the presentation and was impressed with its nice and intuitive configuration and management interface, highly recommend.
VirtualBox is mostly used for windows virtualization and supports Microsofts RDP (remote desktop) protocol, implemented directly in the virtual graphics card. Then the VirtualBox server acts as terminal server, delivering graphical content to (a less powerful) PC. In this configuration, one can even use the USB ports of the dumb terminal, impressive.
Other features are snapshots of running clients and shared folders between clients.
<h4>Collaborative Software Development</h4>
This talk, given by a consultant from McKinsey & Company, tried to put a spotlight on the influence open source has on traditional economies.
It started to show how working in the open empowers individuals and communities through <i>distributed co-creation</i>, <i>pro-sumption</i>, <i>firm of one / firm of one billion</i>, <i>interactions and collaborations</i>
It very much changes how people work and focuses on knowledge workers (see also 'Software for knowledge workers' on day 3)
A couple of prominent <i>development in the open</i> projects were named<ul><li>Linux</li><li>Wikipedia</li><li>we>me textbook (collaborative creation of learning material, see <a href='http://www.businessweek.com/bschools/content/dec2006/bs20061211_681192.htm'>here</a> for a broader scope)</li><li><a href='http://oscarproject.org'>oscarproject</a> (open car engineering)</li><li>loncin motorcycles china (Using an open development and manufacturing process, they have huge cost savings)</li><li><a href='http://openprosthetics.org/'>prosthetics project</a> (prosthetics cad design)</li></ul>
This new development style has a huge economic influence on the gross national product of countries (up to 15% are expected in the future).
The presenter pointed out several times that working on open (source) projects is <b>substantially</b> different from traditional work. Only very few companies have realized this yet.
All industries will be affected. First those with much IT, like Banks, Insurances, etc. Next are (car) manufacturers or similar companies with a big portion of high technology in the value chain. The media (broadcast) industry was also named.
Big changes ahead.
<h4>What's next for Open Source</h4>
Given by Kim Polese, CEO of <a href='http://www.spikesource.com'>SpikeSource</a>, a company selling 'shrink-wrapped' open source solutions, this presentation had a similar topic like the previous one. Key messages were <i>open source is disruptive</i>, <i>dramatic market evolvement</i>, <i>huge effects on global economy</i>. She continued to talk about here company (yes, one can make money with open source) and the usual marketing fluff. Coming trends will be<ul><li>mass market devices (Google adroid)</li><li>proprietary and o/s convergence (Novells 'mixed source' strategy came into mind)</li><li>virtual appliances</li><li>online marketplaces (Amazon is Linux based)</li><li>consolidation plus proliferation</li></ul>
<h4>Open Source Barometer</h4>
<a href='http://www.alfresco.com'>Alfresco</a> does open source enterprise content management based on a good deal of market analysis.
The talk was a preview o the annual <a href='http://www.opensourcebarometer.org'>open source barometer</a> focussing on the european and german open source market.
Lots of graphs, trends and colorful view on the survey results. Looking at Alfresco deployments, there is Windows and Linux equality as an evaluation platform but Linux wins clearly when it comes to actual deployments. Looking more closely at Linux (for hosting Alfresco), SUSE Linux wins over RedHat by a factor of five. However, globally (looking at Linux in general) RedHat has four times more systems out there.
Overall, Linux raise is undamped but the Novell/Microsoft patent agreement resulted in a clear kink for SUSE.
<h4>Linux System Management at Rewe</h4>
Yeah, great title and bad content (pure RHN marketing blurb). Go <a href='http://www.redhat.com/software/rhn'>here</a> if you really want more.
<h4>Nagios at Bundesstelle für Informationstechnik</h4>
Driven by <a href='http://en.wikipedia.org/wiki/IT_Infrastructure_Library'>ITIL</a>, this german government agency needed
<ul><li>consistent monitoring, platform independent</li><li>fast deployment, extensibility</li><li>transparency</li><li>acceptance by people</li><li>Integration into HP Service Desk + HP Network Node Manager</li><li>Support for <a href='http://www.uc4.com'>UC4</a></li></ul>
Main reasons for Nagios were cost effectiveness (cost for one server: 1500EUR with a commercial suite, 25EUR with Nagios), api, extensibility, scalability, integration in existing environment and ongoing development.</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-13326974505853239462008-01-31T11:37:00.001+01:002008-01-31T11:39:20.447+01:00VMware releases Perl WS-Management library<div xmlns='http://www.w3.org/1999/xhtml'><a href='http://www.vmware.com'>VMware</a> <a href='http://sourceforge.net/mailarchive/message.php?msg_name=01893258C408F84894C5D6389A15A52DB95C7C%40PA-EXCH03.vmware.com'>just announced</a> the availability of a WS-Management (client side) library written in Perl
<cite>
"Starting with VMware's VIPerl Toolkit v1.5, an experimental version of Perl WS-Management library is included for infrastructure management with Web Services. The library currently supports 7 out of the 11 generic operations described in the WS-Management - CIM Binding.
The library is available for download at <a href='http://www.vmware.com/support/developer/viperltoolkit'>http://www.vmware.com/support/developer/viperltoolkit</a>"
</cite>
Nice !
Maybe this can act as a guideline for the <a href='http://www.openwsman.org/language-binding-improvements'>openwsman language bindings</a>. Lets see.</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-5996458767928934952008-01-30T17:29:00.001+01:002009-03-27T14:58:45.465+01:00Open Source Meets Business - Day1<div xmlns='http://www.w3.org/1999/xhtml'><a href='http://www.heise.de'>Heise Verlag </a> held its annual <a href='http://www.osmb.de'>Open Source meets Business</a> conference in Nuremberg last week.<br/><br/>
The conference was quite well attended, reportedly over 700 participants with approximately 699 from Germany, all in business suites ...
Redhat was present with a booth (showing olpc, http://laptop.org). Novell was nowhere to be seen - strange.<br/><br/>
Most presentations had about 80% marketing content, 10% about the business model and 10% actual information. Redhats virtualization talk was especially contentless, a marketing talk given by a 'solution architect'. I had to leave early.<br/><br/>
Presentations where limited to 30 minutes (incl. Q&A), with 6 to 7 tracks in parallel. I tried to choose the one with systems management or software architecture relevance.
<h3>Presentations - Day1</h3><h4>REST</h4><a href='http://www.b-simple.de'>Ralf Wirdemann</a> gave a good and easy to follow introduction to the <a href='http://en.wikipedia.org/wiki/Representational_State_Transfer'>REST architecture style</a>. Nothing new, but its good to see that such topics are presented to (reportedly) CIO level management.<br/> Too bad he had little 'real world' experience with either REST or Rails as his (non-)answers to questions showed.
<h4>SugarCRM: Is open source a viable business model ?</h4>Short answer: Yes. Look at recent acquisitions: RedHat/JBoss 420M, Citrix/XenSource 500M, Sun/mySQL 1B. Nothing about SugarSRM as a product, but about the development (open) and business model (service & support).
<h4>Network Monitoring with Nagios</h4>This was the first of four (!) talks about Nagios.<br/>
Monitoring is a hot topic for most IT admins. <small>The presenter spend most of the time fighting the incompatibilities of MacOS Powerpoint with Windows Power Point and OpenOffice (doesn't show speaker notes ;-))</small><br/>
Filtering out the company marketing blurb, one learned that Nagios allows for cross-platfrom device and service monitoring. It uses its own client agent (available for Linux, Unix and Windows) but can also process SNMP management information from network devices. The client agent has a pluggable API for gathering information and there is a <a href='http://nagiosplugins.org'>whole website</a> dedicated to plugins.<br/>
The Nagios server, running on Linux only, provides the management infrastructure including a sophisticated alarm and notification system.<br/>
Customers seem to be quite happy with Nagios and only miss a reporting function. But this is planned for the future.
<h4>WS-Management</h4>I presented my favorite topic, <a href='http://en.wikipedia.org/wiki/WS-Management'>Web Services for Management</a>. A remote management protocol providing true interoperable management capabilities between Linux and Windows.<br/>
Slides are <a href='http://www.suse.de/%7Ekkaempf/Presentations/OSMB2008/OSMB-WS-Management.pdf'>available in german</a> (I said it was a german conference, didn't I ?)</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-50562757448053754752007-12-19T15:22:00.001+01:002007-12-19T15:23:22.663+01:00MDC presentations available<div xmlns='http://www.w3.org/1999/xhtml'><a href='http://softwareblogs.intel.com/author/anas-nashif'>Anas</a> asked me to make my <a href='http://www.mandevcon.com'>Management Developers Conference</a> presentations available, so here they are.
<h4>Web Service Management On Rails</h4>In the first one, <a href='http://www.suse.de/%7Ekkaempf/Presentations/MDC2007/WS-ManagementOnRails.pdf'>WS-Management On Rails</a>, covers the beauty of accessing WS-Management and WS-CIM functionality through Ruby.
The code follows the <a href='http://www.dmtf.org/standards/stackmap'>DMTF Technologies Diagram</a> and consits of <ul><li><a href='https://build.opensuse.org/package/show?project=home:kwk:Management&package=rcim'>rcim</a> for the CIM Infrastructure layer</li>This implements the CIM metamodel of classes, properties and qualifiers.
<li><a href='https://build.opensuse.org/package/show?project=home:kwk:Management&package=mofgen'>mofgen</a> to generate WS-CIM bindings</li>Mofgen is an extension to the <a href='http://www.cimple.org'>Cimple</a> MOF parser. It generates <a href='http://www.openwsman.org'>Openwsman</a> client bindings for CIM classes from the class description contained within a <a href='http://www.wbemsolutions.com/tutorials/CIM/cim-mof.html'>MOF file</a>.
<li><a href='https://build.opensuse.org/package/show?project=home:kwk:Management&package=rwscim'>rwscim</a> for the CIM Schema class hierachy</li>This puts a wrapper around the bindings generated by mofgen, makes them available as a single Ruby module and ensures the correct class hierachy.
</ul>
And <a href='http://www.suse.de/%7Ekkaempf/git/ws-browser.git'>here</a> is a <a href='http://git.or.cz'>git</a> repository containing a <a href='http://www.rubyonrails.org'>Rails</a> application showing all this in action.
<h4>Web Service Management Application Enablement</h4><a href='http://www.suse.de/~kkaempf/Presentations/MDC2007/WS-ManagementApplicationEnablement.pdf'>Web Service Management Application Enablement</a> is about using WS-Management as a transport layer for remote application access.
Instead of implementing a separate daemon, protocol and data model, riding the WS-Management horse gives all of this almost for free. And its more secure.
The dynamic plugin model provided on the <a href='http://www.openwsman.org'>Openwsman</a> server side makes this particularly easy.
The presentation shows how to plan and implement such a plugin and gives two examples. <a href='https://build.opensuse.org/package/show?project=home:kwk:Management&package=openwsman-yast'>openwsman-yast</a> for a simple, RPC-type approach and <a href='https://build.opensuse.org/package/show?project=home:kwk:Management&package=openwsman-hal'>openwsman-hal</a> which follows the WS-Management resource model.</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-62597517545258984022007-12-18T11:51:00.001+01:002007-12-19T15:24:25.399+01:00Report from Management Developers Conference<div xmlns='http://www.w3.org/1999/xhtml'><h3>About Management Developers Conference</h3><br/><p><a href='http://www.mandevcon.com'>Management Developers Conference</a> (ManDevCon, MDC) is the annual conference of the <a href='http://www.dmtf.org'>Distributed Management Task Force</a> (DMTF).<br/>The DMTF is <quote>the leading industry organization for interoperable management standards and initiatives</quote>. Mostly known for their Common Information Model (<a href='http://www.dmtf.org/standards/cim'>CIM</a>) and the Web Services for Management (<a href='http://www.dmtf.org/standards/wbem/wsman'>WS-Management</a>) standards.<br/>The full conference schedule can be viewed <a href='http://www.mandevcon.com/schedule.html'>here</a>.</p><p><br/>I already had the opportunity to attend this conference last year. This year, I was accepted as a speaker with two presentations about WS-Management.</p><br/><h3>Conference overview</h3><br/><p>The conference has three blocks, one for learning ('university day'), one for demo and interop ('interop lab') and one for presentations.</p><p>It was interesting to see how the conference topics changed year over year. Last year, protocols and APIs were still under discussion. In 2006, the WS-Management and <a href='http://www.oasis-open.org/committees/wsdm/'>WSDM</a> (OASIS Web Services Distributed Management) protocols were still competing. This year, working implementations of various standards dominated.<br/>From a protocol perspective, WS-Management is the clear winner with virtually every systems vendor showing implementations. Microsofts adaption of WS-Management for all remote management on Windows (WS-Management comes build into Vista and is <a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=845289ca-16cc-4c73-8934-dd46b5ed1d33&DisplayLang=en'>available as an add-on</a> to Server 2003 and XP) was probably the driving force here. <a href='http://www.openwsman.org'>Openwsman</a>, an open source implementation of WS-Management provided by Intel, is also picked up by lots of embedded vendors.</p><p>The interop lab revolved around implementations for CDM, DASH and SMASH.</p><p><a href='http://www.dmtf.org/standards/mgmt/cdm'>CDM</a>, the Common Diagnostic Model, is a CIM extension for diagnostic instrumentation. Its primary use is for vendor-agnostic remote health evaluation for hardware. Hewlett-Packard uses this extensively for their systems and requires each of their component suppliers for test routines available through CDM.<br/><a href='http://www.dmtf.org/standards/mgmt/dash'>DASH</a> (Desktop and mobile Architecture for System Hardware) and <a href='http://www.dmtf.org/standards/mgmt/smash'>SMASH</a> (Systems Management Architecture for Server Hardware) target management and monitoring of hardware components based on the WS-Management protocol.</p><br/><h3>Attended presentations</h3><ul><br/><li>Opentestman</li><br/><a href='http://www.opentestman.org'>Opentestman</a> is validation test suite for ws-man, ws-cim and dash-1.0. Its a (wild) mixture of bash scripts and java based utility tools. Tests are described in xml-based 'profile definition documents' (PDD), making the tests data-driven. It currently covers all mandatory and recommended features of the WS-Management and WS-CIM standards. More than 160 test cases exist for all 14 DASH 1.0 profiles. [DASH 1.1 was released early December]<br/>[Hallway discussions showed, that the current implementation of Opentestman is in urgent need of refactorization. So don't look too close at the code or it might hurt your eyes.]<br/><br/><li>ITSM and CIM</li><br/><a href='http://en.wikipedia.org/wiki/IT_Service_Management'>ITSM</a>, Information Technology Service Management, can be described as managing the systems management. The presentation gave an overview on existing technologies and asked for participation to model this topic in CIM. Currently, several (policy/modeling) standards exist for this topic, e.g. <a href='http://en.wikipedia.org/wiki/Cobit'>Cobit</a> (Control Objectives for Information and Related Technology; mostly US, covering business and process mgmt), <a href='http://en.wikipedia.org/wiki/Information_Technology_Infrastructure_Library'>ITIL</a> (Information Technology Infrastructure Library; mostly Europe, covering service and process mgmt) and CIM (resource mgmt). IT process management has seen a big push recently. Lots of tools and companies appeared in the last couple of years offering services.<br/>With <a href='http://en.wikipedia.org/wiki/Service_Modeling_Language'>SML</a>, a service modeling language exists. Other areas like availability management, performance/capacity management or event/incident/problem management do not have any established standard.<br/><br/><li>Using the CIM Statistical Model to Monitor Datapresentation</li><br/>Brad Nicholes from Novell showed recent work to integrate existing open source solutions (using non-standard models and protocols) with CIM.<br/><a href='http://ganglia.sourceforge.net'>Ganglia</a>, a "scalable distributed monitoring system for high-performance computing systems such as clusters and Grids" uses <a href='http://oss.oetiker.ch/rrdtool'>rrdtool</a> (round robin database tool) to view stastistical data with different granularity.<br/>One feature of Ganglia is to provide trending information (as opposed to simple alerting) to support capacity planning.<br/>Ganglia consists of a statitics gathering agent (gmond) running on every client. These agents are grouped in clusters, sharing all information within the cluster to ensure failover capabilities. The statistics aggregation agents (gmetad) run on specific managment servers, reporting to an apache web frontend.<br/>Brad has defined a CIM model and implemented CIM providers to access the data. Its basically rrdtool access, thereby drastically reducing the amount of data transported over CIM.<br/><br/><li>CIM Policy Language</li><br/>This was a report from the DMTF policy working group defining <a href='http://www.dmtf.org/standards/published_documents/DSP0231.pdf'>CIM-SPL</a>.<br/>SPL, the simplified policy language, defines more than 100 operators to express relations (examples given: os 'runsOn' host, os 'hasA' firewall) and actions (Update of CIM properties, execution of CIM methods).<br/>There exists a cli tool and an <a href='http://www.eclipse.org'>Eclipse</a> plugin for developing and testing policies. The <a href='http://wiki.apache.org/incubator/ImperiusProposal'>Apache Imperius</a> project is about to release a sample implementation. Similar plans exist for the Pegasus CIMOM.<br/><br/><li>Nagios through CIM</li><br/>This was another example of bringing open source, but non-standard implementations and CIM together.<br/><a href='http://www.nagios.org'>Nagios</a> is a very popular monitoring and alerting framework. It comes with a rich set of data gathering plugins, available on <a href='http://nagiosexchange.org'>nagiosexchange.org</a>.<br/>Intel has developed an adapter layer to expose Nagios data through CIM. One can also mix a traditional CIM provider with a Nagios plugin, filling only particular properties from the plugin.<br/>The source code is not available publically (yet...).<br/><br/><li>Cimple and Brevity</li><br/><a href='http://www.cimple.org'>Cimple</a> and <a href='http://inovadevelopment.com/products.html#BrevityDexcription'>Brevity</a> are code generator tools making it easier to develop CIM providers and tools. Cimple is a CIM provider generator. It takes a CIM class description (MOF file) as input and generates stubs for a CMPI provider. This way, a developer does not have to fight with the provider API but can concentrate on the instrumentation part. [The amount of code generated is still huge. For SLE11, Python providers are the better choice for most cases.]<br/>Brevity tries to ease writing client tools. For people developing in C or C++, Brevity is worth a look.<br/>[For modern scripting languages, better bindings exist. E.g <a href='http://en.opensuse.org/PowerCIM'>powerCIM</a> for Python and <a href='https://build.opensuse.org/project/show?project=home:kwk:Management'>rwscim</a> for Ruby.]<br/><br/><li>Management Frameworks</li><br/>This talk was meant as a call for help to collaborate on a client framework standard. There are sufficient standards and implementations for getting instrumenting managed devices. But on the management application side, everyone reinvents the wheel.<br/>Mergers drive this on the side of traditional (closed source) vendors, else they end up with lots of different APIs.<br/>The proposed 'integrated framework and repository for end-to-end device view' consists of an 'agent tier' (instrumentation), a 'service tier' (see below) and an 'application tier' (API for management applications).<br/>Services can be divided into infrastructure (discovery, collectors (caching), notifications) and core services (data model, topology, policy, scheduling, security, framework service management, domain specific services).<br/>This is ongoing work sponsored by Sun Microsystems looking for further participation.<br/><br/><li>openwsman</li><br/><a href='http://www.openwsman.org'>Openwsman</a> is an open source implementation of the WS-Management and WS-CIM protocol standards. Its currently at version 1.5.1 with 1.6.0 scheduled for end of year and 2.0 end of march '08.<br/>It consists of a generic library, a client library and a server library and daemon. The daemon can be used in parallel to existing CIMOM implementations, translating between WS-CIM and CIM/XML. The mod_wsman plugin for Apache provides co-existance of WS-Management and the Apache web server through the same port.<br/>Main features for next years 2.0 release are<ul><li>full compliance to the specification (The current WS-Management specification is still not final)</li><br/><li>WS-Eventing (asynchronous indications, for alerting etc.)</li><br/><li>A binary interface to sfcb (to connect to cim providers without a cimom)</li><br/><li>better support for embedded devices</li><br/><li>Filtering (CQL, cimom query language; WQL, WS-Management query language, xpath, xml query language)</li><br/></ul><br/></ul><br/><br/></div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com1tag:blogger.com,1999:blog-29826356.post-84556075282773610632007-12-05T02:47:00.001+01:002007-12-19T15:24:52.086+01:00Mapping the IT Universe<div xmlns='http://www.w3.org/1999/xhtml'>The annual <a href='http://mandevcon.com'>Management Developers Conference</a> organized by the <a href='http://www.dmtf.org'>DMTF</a> started yesterday with the <a href='http://mandevcon.com/university.html'>University Day</a>.<br/><br/>DMTF (Distributed Management Task Force) is an <quote>industry organization leading the development, adoption and promotion of interoperable management standards and initiatives</quote>. Its mission is no less than <em>Mapping the IT Universe</em> by standardizing an object-oriented model (CIM) and related protocols (WBEM).<br/><br/>The conference was opened by a reception celebrating 15 years of DMTF and 10 years of CIM. <a href='http://www.podtech.net/home/4422/all-about-the-dmtf-with-winston-bumpus'>Winston Bumpus</a> gave a short overview on the history of the DMTF.<br/><br/><p style='margin: 0pt 0pt 0pt 20px;'>The DMTF was founded in 1992 as the Desktop Management Task Force, focussing on standards for managing desktop PCs. Two years later, the Desktop Management Interface (DMI) was published and quickly adopted. After releasing DMI 2.0 in August 1996, their mission was accomplished and the board considered closing the DMTF.<br/><br/>At that point, Patrick Thompson from Microsoft proposed to extend the management standardization beyond desktops and to cover the complete IT landscape. The original proposal already contained the key aspects and architectural components which are still valid today:</p><ul><li>HMMS (Hypermedia Management Schema) — CIM today</li><br/><li>HMOM (Hypermedia Object Manager) — CIMOM today</li><br/><li>HMMP (Hypermedia Management Protocol) — CIM/XML over HTTP today</li></ul><p style='margin: 0pt 0pt 0pt 20px;'>Initially a <em>gang of five</em>, namely BMC, Compaq, Intel, Microsoft and Sun accepted the proposal and continued funding the DMTF. In a tour de force with biweekly meetings over a period of 6 months the DMTF was able to present the Common Information Model 1.0 (CIM) in April 1997. It only covered the object-oriented modelling without any transportation protocol. This was added another year later (August 1998) with the Web Based Enterprise Management (WBEM) standard.<br/><br/>In 1999, the DMTF was renamed to Distributed Management Task Force, keeping the acronym (and all the advertising materials).<br/></p><br/>Today more than 200 companies with over 4000 participants contribute to the ongoing standardization efforts. In the 'Industry Showcase' and 'Interop Lab' rooms of the Conference, a wide variety of devices, tools and applications based on CIM are shown.<br/><br/>With the broad acception of <a href='http://www.dmtf.org/standards/wbem/wsman'>Web Services for Management</a> (WS-Management) true interoperable systems management now becomes a reality. Implementation range from <a href='http://softwarecommunity.intel.com/articles/eng/1032.htm'>baseboard management controllers</a> (see <a href='http://www.openamt.org'>here</a> for drivers) and <a href='http://www.avocent.com/web/en.nsf/Content/05152007'>embedded devices</a> to <a href='http://www.openwsman.org'>Open Source</a> stacks and <a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=845289ca-16cc-4c73-8934-dd46b5ed1d33&displaylang=en'>Microsoft Windows</a>.</div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-5745398917114576062007-12-03T07:39:00.001+01:002007-12-03T07:39:51.205+01:00Memories from the past<div xmlns='http://www.w3.org/1999/xhtml'>I am in the <a href='http://www.santaclaraca.gov'>heart of Silicon Valley</a> visiting the <a href='http://www.mandevcon.com'>Management Developers Conference</a> which starts on Monday. More on that in a later post.<br/><br/>The first day I visited the <a href='http://www.computerhistory.org'>Computer History Museum</a> (CHM) with its marvelous collection of historic computers and parts. The majority of which is stored in the archive, vacuumed and wrapped in plastics preserved for future generations. Only a small fraction of artifacts is on display, dubbed <a href='http://www.computerhistory.org/virtualvisiblestorage'>visible storage</a>.<br/><br/>Here one can see parts of the original <a href='http://www.computerhistory.org/virtualvisiblestorage/artifact_frame.php?tax_id=01.04.03.00'>ENIAC</a> computer, a real <a href='http://www.computerhistory.org/VisibleStorage/images/CHM0104_lg.jpg'>IBM System/360</a>, the <a href='http://www.computerhistory.org/VisibleStorage/images/IMG_2707_lg.jpg'>Apollo Guidance Computer</a> or a <a href='http://www.computerhistory.org/VisibleStorage/images/CHM0096_lg.jpg'>ZUSE Z23</a>. Too bad I didn't bring my camera.<br/><br/>Whats unique about this museum are the - excuse me - <em>human artifacts</em>. Those guys and gals still living in Silicon Valley who designed and hacked the early machines. I really enjoyed a guided tour given by Ray Peck which was sprinkled with background information and anecdotes. Just wonderful.<br/>Next was a live demonstration of the <a href='http://www.computerhistory.org/pdp-1'>PDP-1 restoration project</a>. One could see a 1961 computer up and running, demoed by <a href='http://www.computerhistory.org/pdp-1/index.php?f=theme&s=3&ss=10'>Peter Samson</a> and <a href='http://archive.computerhistory.org/resources/still-image/dec/pdp-1_online/dec.pdp-1.chm_pdp-1_restoration_lyle_bickley_and_bob_lash_comparing_paper_tapes.2004.102664944.lg.jpg'>Lyle Bickley</a>. They both hacked the PDP-1 during their student time at MIT. Peter is the original author of the PDP-1 <a href='http://www.computerhistory.org/pdp-1/index.php?f=theme&s=4&ss=5'>music program</a> and gave an <a href='http://archive.computerhistory.org/resources/moving-image/DEC/PDP-1_Online/dec.pdp-1.music_prs_3.102665180.mp3'>example</a> of his work. Hilarious !<br/><br/>On my way out, I picked up a free copy of <a href='http://www.computerhistory.org/core'>Core</a>, the museums biannual publication. The article about <a href='http://www.computerhistory.org/core/articles/rescued_treasures.html'>rescued treasures</a> was most interesting, showing how challenging preserving history can be.<br/><br/>To quote from the museums flyer: "<em>It's ironic that in an industry so concerned with memory, how quickly we forget.</em>"<br/><br/><p class='poweredbyperformancing'>Powered by <a href='http://scribefire.com/'>ScribeFire</a>.</p></div>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-30830314591973613542007-08-13T11:00:00.000+02:002007-08-13T11:29:05.314+02:00Look who's sponsoring RubyLast weekend saw the <a href="http://rubyhoedown.com">Ruby Hoedown</a> conference at RedHats Raleigh Headquarter, listing Microsoft as a sponsor. Interesting.<br/><br/>For those of you wondering <span style="font-style:italic;">Why Ruby ?</span>, look at the conference website.
<blockquote>The Ruby language is growing exponentially, partially because it offers more flexibility than other more common languages.</blockquote>
Now add Suns <a href="http://developers.slashdot.org/article.pl?sid=06/09/12/068253">support for Ruby</a> last year, the famous <a href="http://www.rubyonrails.org">Ruby on Rails</a> web development framework and <a href="http://antoniocangiano.com/2007/02/19/ruby-implementations-shootout-ruby-vs-yarv-vs-jruby-vs-gardens-point-ruby-net-vs-rubinius-vs-cardinal">broad platform support</a>, this language is still HOT.kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-50534717751041067242007-07-27T09:09:00.000+02:002007-07-27T10:15:47.647+02:00Metadata as a ServiceOpenSUSE <a href="https://bugzilla.novell.com/show_bug.cgi?id=276018">bug 276018</a> got me into thinking about software repositories and data transfer again.<br/>
<br/>
Problem statement<br/>
<br/>
Software distribution in the internet age goes away from large piles of disks, CDs or DVD and moves towards online distribution servers providing software from a package repository.
The next version of OpenSUSE, <a href="http://lists.opensuse.org/opensuse-announce/2007-05/msg00002.html">10.3</a>, will be distributed as a 1-CD installation with online access to more packages.<br/>
Accessing a specific package means the client needs to know whats available and if a package has dependencies to other packages. This information is kept in a table of contents of the repository, usually referred to as <em>metadata</em>.<br/>
First time access to a repository requires download of all metadata by the client. If the repository changes, i.e. packages get version upgrades, large portions of the metadata have to be downloaded again - <em>refreshed</em>.
<br/><br/>
The <a href="http://kkaempf.blogspot.com/2007/07/edos-project.html">EDOS project</a> proposes peer-to-peer networks for distributing repository data.<br/>
<br/>
But how much of this metadata is actually needed ? How much bandwidth is wasted by downloading metadata that gets outdated before first use ?<br/>
<br/>
And technology moves on. Network speeds raise, available bandwidth explodes, internet access is as common as TV and telephone in more and more households. Internet flatrates and <em>always on</em> will be as normal as electrical power coming from the wall socket in a couple of years.
At the same time CPUs get more powerful and memory prices are on a constant decrease.<br/>
<br/>
But the client systems can't keep up since customers don't buy a new computer every year. The improvements in computing power, memory, and bandwidth are mostly on the server side.<br/>
<br/>
And this brings me to <em>Metadata as a Service</em>.<br/>
<br/>
Instead of wasting bandwidth for downloading and client computing power for processing the metadata, the repository server can provide a WebService, handling most of the load. Clients only download what they actually need and cache as they feel appropriate.<br/>
<br/>
Client tools for software management are just frontends for the web service. Searching and browsing is handled on the server where load balancing and scaling are well understood and easily handled.<br/>
<br/>
This could even be driven further by doing all the repository management server-side. Clients always talk to the same server which knows the repositories the client wants to access and also tracks software installed on the client. Then upgrade requests can be handled purely by the server, making client profile uploads obsolete. Certainly the way to go for mobile and embedded devices.<br/>
Google might offer such a service - knowing all the software installed on a client is certainly valuable data for them.<br/>
<br/>
Just a thought ...kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com1tag:blogger.com,1999:blog-29826356.post-30758056522935672412007-07-18T17:10:00.000+02:002007-07-18T17:45:42.233+02:00Hackweek aftermathNovell <a href="http://lists.opensuse.org/opensuse-announce/2007-06/msg00009.html">Hackweek</a> left me with a last itch to scratch -- <a href="http://www.kdedevelopers.org/blog/54">Cornelius'</a> proposal of a <a href="http://idea.opensuse.org/content/ideas/ycp-to-ruby-translator">Ycp To Ruby</a> translator.<br/><br/>Earlier this year, I already added XML output to yast2-core which came in very handy for this project. Using the <a href="http://www.germane-software.com/software/rexml/doc/classes/REXML/StreamListener.html">REXML stream listener</a> to code the translator was the fun part of a couple of late night hacks.<br/><br/>The result is a complete syntax translator for all YaST client and module code. The generated Ruby code is nicely indented and passes the Ruby syntax checker.<br/><br/>Combined with <a href="http://duncan.mac-vicar.com/blog/archives/245">Duncans Ruby-YCP</a> bindings, translating ycp to Ruby should be quite useful as we try to provide support for more widespread scripting languages.<br/><br/>The translator is available at <a href="http://svn.opensuse.org/svn/yast/trunk/yxmlconv">svn.opensuse.org</a> and requires a recent version of yast2-core, which supports XML output and the <tt>'-x'</tt> parameter of <tt>ycpc</tt>.<br/>Then run<pre style="background-color:#b0c0a0; color:#F0F0F0; margin: 10px auto 10px; display: block; text-align: left;">
ycpc -c -x file.ycp -o file.xml
</pre>to convert YCP code to XML.
<br/>Now use the xml-ruby translator as<pre style="background-color:#b0c0a0; color:#F0F0F0; margin: 10px auto 10px; display: block; text-align: left;">
cd yxmlconv
ruby src/converter.rb file.xml > file.rb
</pre>
<br/>Translating e.g <tt>/usr/share/YaST2/modules/Arch.ycp</tt><pre style="background-color:#b0c0a0; color:#F0F0F0; margin: 10px auto 10px; display: block; text-align: left;">
{
module "Arch";
// local variables
string _architecture = nil;
string _board_compatible = nil;
string _checkgeneration = "";
boolean _has_pcmcia = nil;
boolean _is_laptop = nil;
boolean _is_uml = nil;
boolean _has_smp = nil;
// Xen domain (dom0 or domU)
boolean _is_xen = nil;
// Xen dom0
boolean _is_xen0 = nil;
/* ************************************************************ */
/* system architecture */
/**
* General architecture type
*/
global string architecture () {
if (_architecture == nil)
_architecture = (string)SCR::Read(.probe.architecture);
return _architecture;
}
...
</pre>
outputs the following Ruby code<pre style="background-color:#b0c0a0; color:#F0F0F0; margin: 10px auto 10px; display: block; text-align: left;">
module Arch
require 'ycp/SCR'
_architecture = nil
_board_compatible = nil
_checkgeneration = ""
_has_pcmcia = nil
_is_laptop = nil
_is_uml = nil
_has_smp = nil
_is_xen = nil
_is_xen0 = nil
def architecture( )
if ( _architecture == nil ) then
_architecture = Ycp::Builtin::Read( ".probe.architecture" )
end
return _architecture
end
...
</pre>
Preserving the comments from the ycp code would be nice -- for next Hackweek.
<br/>
Btw, it's fairly straightforward to change the translator to output e.g. Python or Java or C# or ...kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-15222757244703123832007-07-17T10:56:00.000+02:002007-07-17T11:56:56.159+02:00Smolt - Gathering hardware informationLWN pointed me to <a href="http://lwn.net/Articles/241875/">this mail</a> from Fedoraproject
inviting other distrubtion to participate in the <a href=" https://hosted.fedoraproject.org/projects/smolt">Smolt project</a>.
Smolt is used to gather hardware data from Linux systems and <a href=" http://smolt.fedoraproject.org">makes it available</a> for browsing.
<br/>
They currently have data from approx. 80000 systems, mostly x86, which hopefully will grow in the future.
The <a href="http://smolt.fedoraproject.org/devices">device</a> and <a href="http://smolt.fedoraproject.org/stats">system</a> statistics are quite interesting to browse. Besides hardware, smolt also tracks the system language, kernel version, swap size etc. It also tries to make an <em>educated guess</em> on desktop vs. server vs. laptop - typically a blurred area for Linux systems.
<br/><br/>
Once they offer an online API for direct access to the smolt server database, this really will be quite useful.kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-21299965410135351352007-07-16T15:15:00.000+02:002007-07-16T15:50:17.025+02:00EDOS Project<p>Michael Schröders <a href="http://idea.opensuse.org/content/ideas/fast-installation-tool">hackweek project</a> is based on using well-known mathematical models for describing and solving package dependencies: Satisfiability - <em>SAT</em><br/>
Apparently, some research on this topic was done before. The oldest mentioning of SAT for packaging dependencies I found is a paper from <a href="http://people.debian.org/%7Edburrows/model.pdf">Daniel Burrows</a> dating ca. mid-2005. Daniel is the author of the <a href="http://people.debian.org/%7Edburrows/aptitude.html">aptitude</a> package manager and certainly knows the topic of <em>dependency hell</em> inside out.</p>
<p>However, the most interesting link Google revealed, was the one to the <a href="http://www.edos-project.org/">EDOS project</a>.
<br/>
EDOS is short for <em><b>E</b>nvironment for the development and <b>D</b>istribution of <b>O</b>pen <b>S</b>ource software</em> and is funded by the European Commission <a href="http://www.pro-linux.de/cgi-bin/NB2/nb2.cgi?show.7651.7010..">with 2.2 million euros</a>.
The project aims to <em>study and solve problems associated with the production, management and distribution of open source software packages.</em>
<br/>
Its four main topics of research are:</p><ul><li><a href="http://www.edos-project.org/xwiki/bin/view/Main/Wp2">Dependencies</a>
With a formal approach to management of software dependencies, it should be possible to manage the complexity of large free and open source package-based software distributions.
The project already produced a couple of publications and tools, but I couldn't find links to source code yet.</li>
<li><a href="http://www.edos-project.org/xwiki/bin/view/Main/Wp4">Downloading</a>
The problem of huge and frequently changing software repositories might be solvable with
P2P distribution of code and binaries.</li>
<li><a href="http://www.edos-project.org/xwiki/bin/view/Main/Wp3">Quality assurance</a>
All software projects face the dilemma between <em>release often - release early</em> and system quality. One can either<ul><li>reduce system quality</li><li>or reduce the number of packages</li> <li>or accept long delays before final release of high quality system</li></ul>EDOS wants to develop a testing framework and quality assurance portal to make distribution quality better and measurable.</li>
<li><a href="http://www.edos-project.org/xwiki/bin/view/Main/Wp5">Metrics and Evaluation</a>
The decision between old, less features, more stable vs. new, more features, more bugs should be better reasoned by defining parameters to characterize distributions, distribution edition and distribution customization.</li></ul><p></p>
Interesting stuff for a lot of distributions out there ...kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-68227202874236015932007-07-02T18:41:00.000+02:002007-07-05T12:20:56.394+02:00openwsman-yast now returns proper datatypesAfter five days of hacking last week, a final itch was left which needed scratching. The YaST openwsman plugin only passed strings back and forth, losing all the type information present in the YCP result value.
So I added some code to convert basic YCP types to XML (in the plugin) and from XML to Ruby (on the client side).
<a href="http://www.openwsman.org/browser/rwsman/trunk/tests/yast_types.rb">Now</a> the result of a web service call to YaST can be processed directly in Ruby.
Here's a code example showing the contents of <tt>/proc/modules</tt> on a remote machine.
<pre>
require 'rwsman'
require 'yast'
client = WsMan::Client.new( 'http', 'client.internet.org', 8889, '/wsman', 'user', 'password')
options = WsMan::ClientOption.new
schema = YaST::SCHEMA
uri = schema + "/YCP"
options.property_add( "ycp", "{ return SCR::Read( .proc.modules ); }" )
result = client.invoke( uri, "eval", options )
modhash = YaST.decode_result( result ) # hash of { modulename => { size=>1234, used=>3 } }
</pre>
Supported are void, bool, integer, float, string, symbol, path, term, list, and map -- should be sufficient for most of YaST. The <tt>YaST</tt> class is <a href="http://www.openwsman.org/browser/rwsman/trunk/tests/_yast.rb">here</a>.
You need at least version 1.1.0 of openwsman and openwsman-yast, both available on the <a href="http://software.opensuse.org/download/home:/kwk">openSUSE build service</a>.
And, btw, source code for openwsman-yast is now hosted on <a href="http://svn.opensuse.org/svn/yast/trunk/openwsman-yast">svn.opensuse.org</a>kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com0tag:blogger.com,1999:blog-29826356.post-74172690522824812182007-06-28T16:47:00.000+02:002007-06-28T17:20:11.842+02:00Remote management with RailsThe Rails demo for remote systems management with WS-Man is available at the <a href="http://www.openwsman.org">openwsman</a> web site.<br/>
Just follow the <a href="http://www.openwsman.org/wiki/RailsApp">install and configure instructions</a>. In short you need
<ul>
<li>openwsman<br/>An open source implementation of the ws-management standard.</li>
<li>rwsman<br/>Ruby bindings for openwsman client operations.</li>
<li>Ruby On Rails<br/>Web development that doesn't hurt</li>
<li>Railsapp<br/>Rails demo application for rwsman</li>
</ul>
Once everything is properly installed, start the Rails web server with <tt>ruby script/server</tt>.
Now point your browser to <a href="http://localhost:3000">http://localhost:3000</a> and you'll see the startup
page. Click on the text, then click on <em>Discover</em> and the
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc4BT8OKWYL67GhGwylQXrMsKqRcJzuOtcSEq_Lm2NpnmQ1_CDXU0yfy3zoowoJ6Gi6XRZLcIVZHJqgE9HhBtL21NEYb6iy6rgWxP-eeaPeei7Y85Pio6x1OXiIjs2kVHsSfM0/s1600-h/rwsman-discovered.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc4BT8OKWYL67GhGwylQXrMsKqRcJzuOtcSEq_Lm2NpnmQ1_CDXU0yfy3zoowoJ6Gi6XRZLcIVZHJqgE9HhBtL21NEYb6iy6rgWxP-eeaPeei7Y85Pio6x1OXiIjs2kVHsSfM0/s320/rwsman-discovered.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5081132063476591090" />Discovery page</a>
will appear.
<p/>
Look closely at the <tt>Actions</tt> line for each host and you'll notice the <tt>YaST</tt> action for the openSUSE client. This client has my <a href="http://idea.opensuse.org/content/ideas/yast-as-a-webservice">openwsman-yast plugin</a> installed.
<br/>
The demo application allows to start and stop the desktop (the <tt>xdm</tt> service to be precise) and to switch the desktop environment between KDE and GNOME.
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdu6tUs7S5wYR9LSClWCPer6hmgwFGNcilZCeEfVSu86CN6NL43GZtl9CTvt-IgDyAV9lxkdbdTFn0j65cyGzItUh9Na-DXM4dsfdTgf0yVHNYSjni-EGtwZ_eMxsX0RJqeqNp/s1600-h/rwsman_yast_operations.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdu6tUs7S5wYR9LSClWCPer6hmgwFGNcilZCeEfVSu86CN6NL43GZtl9CTvt-IgDyAV9lxkdbdTFn0j65cyGzItUh9Na-DXM4dsfdTgf0yVHNYSjni-EGtwZ_eMxsX0RJqeqNp/s320/rwsman_yast_operations.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5081133287542270466" />YaST operations</a>
<p/>
Doc has videotaped a demo, you can find it in the <a href="http://idea.opensuse.org">idea.opensuse.org</a> blog.kkaempfhttp://www.blogger.com/profile/06067650410497386404noreply@blogger.com2