Ceilometer API, Net::OpenStack::Ceilometer

A couple of weeks ago, I agreed to give a talk at Infrastructure.Next about the Ceilometer component of OpenStack. Immediately afterwards, I regretted this, simply because I'm not exactly an expert on Ceilometer. But I've often said that the best way to learn something is to teach it, and what better way to learn about Ceilometer than prepare a presentation about it.

I also find that the folks with the in-depth technical knowledge of a subject might not be the right ones to give intro talks, because they tend to get into the weeds before their audience can get a big picture.

And so I started on a quest to understand Ceilometer, get some basic reporting working, and put together a howto style presentation on reporting with Ceilometer.

It turns out that several things worked very strongly in my favor:

* Ceilometer is installed and enabled by default when you install RDO. So there was no difficulty in getting it installed and configured.

* The documentation has lots of examples in it, and the API works exactly as documented.

* My presentation is only a half hour, rather than the hour that I initially thought it was, so I ended up having to trim the content, rather than come up with additional examples.

Along the way, I got tired of trying to issue HTTP API requests from the command line, and parse the response. Being a Perl guy, I started to write some perl code around this, and before I knew it, I had a full module to do all of the stuff that I wanted for my presentation.

It's up on Github at https://github.com/rbowen/NetOpenStackCeilometer and I expect I'll put it on CPAN eventually, once it stabilizes a little. In particular, the statistics() method lacks a lot of the capabilities of Ceilometer's statistics functionality, and does only what I needed for my talk. Also the interface is kind of icky.

I should note that there are some other OpenStack modules already on CPAN, and this one takes a very different approach. This is the main reason I haven't put this on CPAN yet. The other modules, by Naveed Massjouni, use Moose, and I have not yet used Moose for anything. I'm reluctant to put my stuff on CPAN while it uses such a different approach.

Patches welcome. I'd love to hear if you find this at all useful.

Come see me at Infrastructure.Next.

Copyright statements in source files

Earlier today I was looking at a source file for the Ceilometer docs and noticed that there's a copyright statement at the top.

Now, in no way do I want to pick on Nicholas. There are hundreds of such copyright statements in the OpenStack docs and code, and this is just the example I happened to be looking at.

(Note that my employer has its share of copyright statements in the OpenStack code. Pretty much every company participating in OpenStack does this. I think we need to stop.)

I sent a note to the OpenStack-docs list, and it has generated a thread of remarks.

As I understand it, people are encouraged to put copyright statements in contributed source code and documentation, and add copyright lines to files that they modify.

I believe this to be a very bad thing to do, for the following reasons:

* If I edit a file and it says at the top that the file is copyright BigCo, I am discouraged from editing that file, because of the implication that I'm treading on someone else's toes. Files should not have any indication that they are "owned" by any one person or company. (See this by Karl Fogel for more on "owning" code.) This actively discourages people jumping in and fixing stuff.

* If N people contribute to a file, are we supposed to have N copyright statements in the file? This doesn't scale over time. Imagine what these files will look like 10 years from now, and fix the problem now.

* Having author names in a file encourages people to contribute for the wrong reasons.

* Git keeps track of who contributed what changes. It's not necessary to have explicit copyright statements.

The first of those reasons is, to me, the most compelling. Anything that discourages contribution, particularly from beginners, should be eschewed as much as possible.

I have had people ask me, when encountering a copyright statement in source code, whether they have to ask that person's permission before submitting a patch. If we can avoid even one person asking this question, we've done a service to the project.

I also worry that companies that insist on copyright statements in their contributions understand neither copyright law nor Open Source. On the one hand, the audit trail in Git protects your record of contribution, and thus your copyright. On the other hand, if your copyright is that important to you, perhaps you shouldn't be contributing it to an Open Source project. It's anti-community to say to a project that they can have your contribution, but only as long as you get to assert that it's your personal property. Open Source is about community and collaboration. If the building is owned by the community, what do you gain by insisting that a particular brick is yours?

At the Apache Software Foundation, we had this debate a decade ago, and decided that author tags in source code were anti-community, and thus discouraged. To quote from the thread of comments at the time, and, in particular, to quote Sander Striker:

At the Apache Software foundation we discourage the use of author tags in source code. There are various reasons for this, apart from the legal ramifications. Collaborative development is about working on projects as a group and caring for the project as a group. Giving credit is good, and should be done, but in a way that does not allow for false attribution, even by implication. There is no clear line for when to add or remove an author tag. Do you add your name when you change a comment? When you put in a one-line fix? Do you remove other author tags when you refactor the code and it looks 95% different? What do you do about people who go about touching every file, changing just enough to make the virtual author tag quota, so that their name will be everywhere?

There are better ways to give credit, and our preference is to use those. From a technical standpoint author tags are unnecessary; if you wish to find out who wrote a particular piece of code, the version control system can be consulted to figure that out. Author tags also tend to get out of date. Do you really wish to be contacted in private about a piece of code you wrote five years ago and were glad to have forgotten?

This is a slightly different issue (author tags rather than copyright statements) but makes exactly the same point. Do I add a copyright statement when I correct grammar or spelling in a doc? How about when I add a paragraph or reorder sentences for greater clarity? At what point do I remove your copyright statement because I've changed so much of that file?

And then of course, you should consider the bigger question - why do you care? What are you trying to protect against? If you're trying to protect against your contribution being taken by the community and used for other purposes, perhaps contributing to an Apache-licensed code base isn't the smartest thing to do.

Red Hat stands behind the code

Cool OpenStack video with footage of Red Hat engineers at the OpenStack summit in Hong Kong last month.

OpenStack Meetup, Cincinnati

Last night I attended the OpenStack meetup in Cincinnati. It was a lot longer drive than I anticipated, as it was on the north side of Cincy. But it was worth the drive. There were only five people there including myself, and although there was nothing formal planned in terms of a presentation, we had a great conversation around what we do in our various jobs with OpenStack, and I think we all learned something new about the OpenStack world in the process.

If you're in the Cincy/Louisville/Lexington area, and you're interested in future meetups, please let me know (rbowen at red hat dot com), so that we can get you included in those announcements. I'd really like to do something in Lexington, so that I don't have to drive so far. ;-) So if you're in Lexington and are interested in, or are using, OpenStack, please ping me and we'll set something up.

Dan Radez on OpenStack

I spoke with several Red Hat engineers at the OpenStack Summit last week in Hong Kong, about what they work on with the OpenStack project. Here's Dan Radez, talking about what he does.

See also TryStack.org

You can listen to this conversation HERE, or subscribe to my podcasts to listen to it in your favorite podcast app.




About

Some people are heroes. And some people jot down notes. Sometimes, they're the same person. (The Truth. Terry Pratchett)