RSS

jclouds Manual Authentication with OpenStack

LockI got a comment on my jclouds and OpenStack post about how to get the Tenant ID via jclouds. The first solution that popped to my mind was to get the Tenant ID out of the access data structure that gets returned upon authentication. This turned out to be a bit trickier than expected as jclouds automatically authenticates on your first actual interaction with a cloud (i.e. the very first time you call a method that needs to talk to the cloud). To get the access data structure I needed to manually authenticate. Here’s how to do it.

Get jclouds

First off, get the jclouds JAR files.

  1. Ensure you are using the Java Development Kit (JDK) version 6 or later.
    • javac -version
  2. Ensure you are using Maven version 3 or later.
    • mvn -version
  3. Create a directory to try out jclouds.
    • mkdir jclouds
    • cd jclouds
  4. Make a local copy of this pom.xml file in the jclouds directory.
    • mvn dependency:copy-dependencies "-DoutputDirectory=./lib"
  5. You should now have a directory with the following structure:
    • jclouds/
      • pom.xml
      • lib/
        • *.jar

Manual Authentication

Put this code in your jclouds directory to do manual authentication. An explanation follows.

  1. Compile.
    1. javac -cp ".:lib/*" JCloudsManualAuthentication.java
  2. Run on OpenStack.
    1. java -cp ".:lib/*" JCloudsManualAuthentication openstack-nova demo:demo devstack http://123.123.123.123:5000/v2.0/
  3. Run on Rackspace as this code works equally well with any OpenStack powered provider.
    1. java -cp ".:lib/*" JCloudsManualAuthentication rackspace-cloudservers-us myRackspaceUsername myRackspaceAPIKey

The key to the example is lines 93 & 94. Because jclouds normally handles the authentication manually we have to use a bit of Guice-fu on line 93 to get a hold of the Function that can manually authenticate by taking our Credentials and returning the Access data structure. On line 94 we execute that Function and the authentication happens. After that we can run through the Access object and get the information we need.

Coda

It’s rare that you would need to authenticate manually in jclouds. Most of the time letting jclouds automatically handle the auth for you suffices. However, if you do need to authenticate manually, this method will give you a lot of information about your OpenStack environment.

 
Leave a comment

Posted by on June 17, 2013 in jclouds, openstack, rackspace

 

The OpenStack Community Welcomes Developers in All Programming Languages

The OpenStack community has been and needs to continue to be a welcoming community for developers in all programming languages. Naturally I’m referring to developers who are building systems on top of OpenStack and not the developers of OpenStack itself.

OpenStack Nation

This post is prompted by a minor incident in the #openstack IRC channel. I’m not looking to single people out so I’ll use a pretty generic description so it can’t so easily be found in the IRC logs.

A developer came to #openstack to ask a question about a software development kit (SDK) in another programming language. Within 1 minute he got a reply that can only be described as snarky. Undeterred, he went ahead and asked his questions. 20 minutes later a couple of more snarky responses were added to it. No real help at all. It’s not the lack of help that’s at issue though. It’s the unwelcoming attitude.

I have not seen that developer in the channel since then.

Like I said, a minor incident. I don’t want to blow this out of proportion but it does need to be addressed. It’s one of those cases where you see the cracks start to appear, it’s best to fix them right away before they become real problems.

I’m sure we’ve all been part of such chats about languages. When you’re face-to-face or online but know the people personally, it usually goes without saying that it’s good natured. However, when you’re new to a community, it’s not so clear. Of course the OpenStack community is Python-centric but the OpenStack API is not. We need developers from all of the other languages building on top of OpenStack in whatever language they need to work with. Remember, it might not even be their choice!

Coda

Let’s continue to be good stewards of the OpenStack API and encourage it’s use by all programming languages by being an inclusive and welcoming community.

If you ever encounter someone looking for help with another language, you can always point them to the SDKs wiki page. They should be able to find their way from there.

 
3 Comments

Posted by on June 12, 2013 in openstack

 

Docker on the Rackspace Cloud

I was at Gluecon 2013 a few weeks ago and caught a great session from Jeff Lindsay & Solomon Hykes about Docker. Docker is an open-source engine which automates the deployment of applications as highly portable, self-sufficient containers which are independent of hardware, language, framework, packaging system and hosting provider.

The coolest part of the talk was when Jeff gave a demo of a mini-Platform as a Service he created the previous night dubbed Dokku that was built on Docker and running on the Rackspace Cloud. Check it out in the video below. The demo starts at 21:00.

 
Leave a comment

Posted by on June 10, 2013 in rackspace

 

Swift/Cloud Files Cross Origin Resource Sharing Container with jclouds

Cross-origin resource sharing (CORS) is a mechanism that allows Javascript on a web page to make XMLHttpRequests to another domain, not the domain the Javascript originated from. Such “cross-domain” requests would otherwise be forbidden by web browsers, per the same origin security policy. CORS defines a way in which the browser and the server can interact to determine whether or not to allow the cross-origin request. It is more powerful than only allowing same-origin requests, but it is more secure than simply allowing all such cross-origin requests. [1]

In the context of OpenStack Swift and Rackspace Cloud Files a CORS enabled container allow users to upload files from one website–or origin–to your Swift/Cloud Files container. When you set the CORS headers on your container, you tell it which sites may post to your account, how often your container checks its allowed sites list, and whether or not metadata headers can be passed with the objects.

You can find example code to enable and configure CORS at CrossOriginResourceSharingContainer.java. To allow users temporary access to a such a container you would use example code like GenerateTempURL.java.

[1] http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

 
Leave a comment

Posted by on June 4, 2013 in jclouds, openstack, rackspace

 

jclouds at Gluecon 2013

It’s time to hit the road, get some hands on keyboards, and really teach developers how to use jclouds. I’ll be giving a workshop titled “Solve the Cross-Cloud Conundrum with jclouds” at Gluecon this year. The session is on May 22 from 10:30 to 11:30 am in Breakout 2.

Gluecon

GlueconWhat is Gluecon? In their own words, “Cloud, Mobile, APIs, Big Data — all of the converging, important trends in technology today share one thing in common: developers. Developers are the vanguard. Developers are building in the cloud, building mobile applications, utilizing and building APIs, and working with big data. At the end of the day, developers are the core.”

I firmly believe that to be true. Developers are the new kingmakers because software is eating the world.

My preference for these kinds of sessions is to get developers doing what they do best. The workshop includes an overview of jclouds, its terminology, and its community then it quickly gets down to development. First, we’ll install jclouds for use on the command line during the workshop. Then we’ll work through an example of using jclouds to start virtual machines in multiple clouds.

Rackspace will be offering free cloud trial accounts to the attendees of this session. It’s our way of helping you get started in the cloud and say thanks for coming out.

Coda

The reason to use jclouds is to control your cloud infrastructure with Java. In this workshop I’ll be showing you exactly how to do that.

 

jclouds 1.6.0 and the move to the ASF

apachejclouds 1.6.0 has been released! Since 1.5.0 I’m both proud and (antonymically) humbled to have become a committer. We’ve done a lot of work since then, including adding new features and an extensive refactoring aimed at simplifying the code base and removing cruft. I’m pleased to announce that full support for Rackspace Cloud Load Balancers and Cloud DNS has been added. That brings the list of supported APIs to:

  • Cloud Servers
  • Cloud Files
  • Cloud Block Storage
  • Cloud Load Balancers
  • Cloud DNS

Here’s how to get started with Rackspace and jclouds 1.6.0. To get familiar with the new APIs check out the examples for Cloud Load Balancers and Cloud DNS.

Rackspace has literally doubled-down on jclouds by adding another contributor, Zack Shoylev, to the open source project. Zack is currently arm pits deep in adding support for Cloud Databases.

Denominate

With the addition of Cloud DNS to jclouds 1.6.0, it’s now possible for a Netflix OSS project known as Denominator to use Rackspace’s DNS service. Denominator is a portable Java library for manipulating DNS clouds. Denominator has pluggable back-ends, initially including AWS Route53, Neustar Ultra, DynECT, Rackspace Cloud DNS, and a mock for testing. Demoninator is led by Adrian Cole, the founder jclouds.

I confess I was pretty excited to get my first pull request accepted and become a contributor to Netflix OSS. It gave me the chance to learn how to use MockWebServer for unit testing and dip my toe into Gradle too. Right now it’s support for read-only so there’s still a lot TODO but one day (maybe) my code will be used when you go to watch something on Netflix.

The Apache Software Foundation

jclouds 1.6.0 marks the last release of “jclouds”. The next release will be as Apache jclouds!

With a huge thanks to Becca Wood, jclouds entered the Apache incubator with an impressive 15 binding votes and 9 non-binding votes. The fledgling incubator page can be found here. As you can see, there is a lot of work to do and such things take time. The first release of Apache jclouds won’t happen until we’ve left the incubator and become a top-level project. We expect the process to take 2-4 months but are cautiously optimistic we’ll be on the lower end of that range.

Coda

It’s going to be an interesting ride having front row seats to a project entering the ASF. There’s excitement and some trepidation as we learn how to work best within Apache and their processes. At the end of it, I think this will be a huge step forward for the jclouds community.

 
Leave a comment

Posted by on May 2, 2013 in jclouds, rackspace

 

Presentation Patterns

Presentation Patterns is a book that takes the concept of software design patterns (and anti-patterns) and applies it to presentations and public speaking. This book is a must read for Developer Advocates and Software Developers who need to deliver a presentation to any size group of people. I would also recommend it to anyone in a technical position or even those in other roles as it’s filled with practical advice and actionable steps accessible by anyone. After reading the book through once and giving a presentation based on a handful of the patterns therein, I’m convinced this book can help improve or kick start your presentation skills.

The Book

Presentation PatternsThe book is broken down into 8 chapters: Prelude, Creativity, Slide Construction, Temporal, Demos vs Presentations, Stage Prep, Performance Anti-Patterns, and Performance Patterns, The patterns in the book more or less follow the standard Design Patterns (GoF) format. Each pattern is comprised of the sections: Pattern Name, Also Known As, Definition, Motivation, Applicability/Consequences, Mechanics, and Related Patterns. In all the book is 304 pages and I found it to be digestible in 4-5 days. The authors are well known on the technical talk circuit and have thousands of hours of presentation time between them. The patterns are often separated by amusing anecdotes that demonstrate the successful application of a pattern or the sometimes disastrous consequences of falling prey to an anti-pattern.

The Read

I read the book with a particular presentation in mind so I at least had some idea about what I wanted to say. This definitely helped motivate my reading and, since I also knew what I didn’t want to say, I could just skim over some of the patterns.

I quite liked reading the book this way. I could read the Name and Definition of a pattern and pretty quickly figure out if it was suitable for my upcoming presentation. If not, I would skim it or disregard it completely. I could see reading this book before authoring any presentation just to get ideas and be reminded of the variety of patterns. Then I’ll be able to pick and choose which patterns might be appropriate for the content and the audience, and how to combine them. I can see how each time I read the book it will take less and less time until I’ve eventually internalized the concepts.

The Presentation

The presentation I was preparing for was due in a week but in truth I had been thinking about it for several weeks before I had even picked up Presentation Patterns. I would occasionally jot notes down as ideas came to me, following the Fourthought pattern without realizing there was already a pattern name for it. What I’ll describe now is the process I went to through to author the presentation. I’ll be using the shorthand of identifying everything by pattern name to give you an idea of how you can quickly and concisely communicate the way you’ve created a presentation. You can find the presentation at A Cloud Platform for Apps: The Rackspace SDKs so you can compare the presentation against the description.

Looking back on it, what I had in mind originally was an Infodeck, which is really no good for a public presentation. It would have would up looking like a Bullet-Riddled Corpse. My next bad idea was series of essentially random pictures to communicate one thought per slide but I then realized I had almost fell prey to the Photomaniac anti-pattern. After getting all of my bad ideas out of the way, I settled on Takahashi but I had trouble finding my Unifying Visual Theme. Eventually I wound up combining my Unifying Visual Theme with Entertainment, Intermezzi, and Brain Breaks. I made sure I also used Bookends to make the beginning and end distinctive. I went out on a limb and did a simple Live Demo and used Traveling Highlights to discuss the code afterwards. I used Carnegie Hall extensively by practicing at home, at a user group meetup, in front of colleagues, and in front of a limited audience before finally taking the stage in front of my real audience.

Overall the presentation was well received at appsworld. For my next presentation, the biggest thing I’d like to improve on is a Narrative Arc and utilize some of the Temporal patterns more.

In the spirit of the book I’d like to present my own pattern!

Pattern: Smile Dammit

Also Known As

Have Some Fun, Enjoy Yourself

Definition

When you start your presentation the first thing you should do is smile dammit! Whether or not you’re actually feeling it at the moment, have some fun up there and try to enjoy yourself.

Motivation

I’ve attended too many presentations from dour faced presenters. Maybe they’re comfortable with public speaking but they sure don’t look like it. They appear to be miserable and that affects my perception of them and their topic.

Applicability/Consequences

Unless you’re giving a presentation on an extremely serious subject, there’s no reason not to smile. Failure to do so will leave a bad impression with your audience. If you’re feeling a bit nervous, it might even help quell some of those butterflies.

Mechanics

Just smile once in a while dammit.

Coda

One thing that really struck me was an estimate of the amount of time it takes to prepare a really good presentation. The authors figured that there was about an hour of work total for every single minute of presentation time. To deliver a top notch presentation that sounds about right to me.

Presentation Patterns was great read and definitely worthwhile. I’ll be reading it again too. It’s rare I find a book useful enough that I feel compelled to do a book review style post but this was definitely the case here.

Whether you’re new to public speaking and presentations or have a fair number of hours on stage already, you’ll find many useful patterns in this book. Some you will already know and some you will already be doing but giving identifying them and giving them a name is powerful. Now you can use those names as a shorthand when thinking about how to combine patterns into recipes to deliver interesting and entertaining presentations.

However, it will definitely resonate most with developers since the information is delivered in the well known pattern format.

 
Leave a comment

Posted by on April 3, 2013 in developer advocacy

 
 
Follow

Get every new post delivered to your Inbox.