RSS

Category Archives: rackspace

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

 

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

 

Swift Only with OpenStack DevStack on the Rackspace Cloud

devstackSwift is not installed by default when using OpenStack DevStack. Sometimes you want to install Swift only for some testing without all of the other services getting in the way. Here’s how to setup Swift (and Keystone for authentication) with DevStack on the Rackspace Cloud.

Instructions

  1. If you don’t have one already, Sign Up for an open cloud account
  2. Go to the Cloud Control Panel
  3. Click Create Server
    1. Name: devstack-swift
    2. Image: Ubuntu 12.04 LTS
    3. Size: 4GB RAM (you could probably get away with 2 GB)
  4. Click Create Server and note the password and IPv4 address (when it appears)
  5. When your server is Active, switch to a Terminal and run the following commands to create the stack user.
    1. ssh root@<IPv4 Address>
    2. adduser --gecos "" stack
    3. adduser stack sudo
    4. grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers || echo "#includedir /etc/sudoers.d" >> /etc/sudoers
    5. ( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/50_stack_sh )
    6. exit
  6. I create the stack user like this because I’ve found that there are permission issues with screen if you create a “dummy” stack user and just switch to the stack user from the root user.
  7. Now login as the stack user and setup Swift:
    1. ssh stack@<IPv4 Address>
    2. sudo apt-get -y update
    3. sudo apt-get -y install git
    4. git clone https://github.com/openstack-dev/devstack.git
    5. cd devstack
    6. vim localrc # copy in the contents of this one
    7. ./stack.sh
    8. screen -r stack
  8. When running stack.sh you might see an error message that reads “ERROR: at least one rpc backend must be enabled”. Don’t worry about it, Swift/Keystone doesn’t need an rpc (AMQP) backend. You can also ignore any ImportErrors.
  9. When DevStack is done you can point your OpenStack clients and jclouds dev env all at <IPv4 Address>
  10. When you’re done with your development/testing you can delete the server to save money and just start fresh next time

Coda

Just a quick post to get Swift only up and running quickly!

 
2 Comments

Posted by on February 18, 2013 in devstack, openstack, rackspace

 

jclouds, Netflix, and appsworld in San Francisco

I’m going to be in San Francisco the first week of February and it’s going to be a packed week talking about and hacking on open source software. In addition to spending some time at the Rackspace San Francisco office, I’ll be doing a mix of hosting/attending meetups and presenting at the appsworld conference in SF.

jclouds

jcloudsThe Rackspace Java SDK is powered by the open source project jclouds. I’ve been working with the jclouds community since day one of my start at Rackspace but I have yet to meet many of the core developers face to face. The majority of the community is based in San Francisco so I decided to take the opportunity to initiate a couple of meetups. We’ll be hosting two separate meetups at the Rackspace office that week. Here are the details.

jclouds meetup
Date: Feb. 4th
Time: 7:00 pm
Location: 620 Folsom Street #100, SF
Audience: Developers who use jclouds to build solutions

jclouds-dev meetup
Date: Feb. 5th
Time: 7:00 pm
Location: 620 Folsom Street #100, SF
Audience: Developers who develop jclouds itself

NetflixOSS

NetflixNetflix has done an amazing job open sourcing many of their components. They’re a group of top notch engineers working to make resilient applications on the cloud. To herald their commitment to open source they’re hosting the first NetflixOSS Open House on Feb 6th. I’m glad the timing worked out for me to be able to attend this (once I find my way out to Los Gatos). It promises to be a fun and interesting evening, right up until they unleash their simian army on us.

appsworld

appsworldappsworld is a conference relatively new to North America and is focused on mobile apps. The whole conference is geared towards developers and includes four free to attend developer workshop tracks and a free exhibition with over 150 exhibitors. Rackspace is going to have an important presence there and will be hosting a series of workshops.

I’ll be presenting the Rackspace SDKs on Friday morning in the Developer Zone. Here are the details.

A Cloud Platform for Apps: The Rackspace SDKs
Date: Feb. 8th
Time: 9:40 am
Location: Moscone Center West, SF
Agenda:

  1. Introduction to the Rackspace Developer Relations Group
  2. Introduction to the SDKs
  3. Benefits of using the SDKs
  4. Interoperability with OpenStack
  5. Overview of the SDKs
  6. Demo of the Rackspace SDK for Java

Coda

It’s going to be a busy week but I’m looking forward to it. It’s a great chance to connect with some developers and hopefully get some feedback on how Rackspace is serving the developer community. If you’re in or around San Francisco for appsworld or any other reason, please check us out and let us know!

 
Leave a comment

Posted by on January 14, 2013 in jclouds, rackspace

 

What is a Developer Advocate?

I wrote a bit about “What is a Developer Advocate?” back in October in the article Introducing the Rackspace Developer Relations Group and open cloud SDKs. Not a whole lot of time has passed since then but my thinking on it has evolved and I missed a number of things in that first pass. I’d like to take another crack at it and I still get asked this question often enough that it’s always fresh in my mind.

Definition

A developer advocate is someone who’s primary responsibility is to make it easy for developers to use a platform. In my case, I’m trying to make it easy for developers to use OpenStack and the Rackspace Open Cloud. I view the role as having a foundation of three pillars: development, advocacy, and community.

Development

gitI’m a software developer. I know when a platform isn’t as easy to use as it could be and how to improve it. You need to know the craft and have the respect of your peers. Without that the rest is moot. This is especially true in the meritocracy of open source. I think that’s why you don’t hear much demand for “technology evangelists” anymore. If you can’t speak to developers because you aren’t one of us, your arguments will fall on deaf ears. Naturally this involves all of the usual development activities like architecture, design, implementation, testing, and debugging. The product of this includes tools that make it easier to use your platform like SDKs, examples code, command line interfaces, and IDE plugins.

I contribute to open source. In an increasingly web service API driven world, the tools built on those APIs are often open source. I think it’s a natural fit. The tools are geared towards dev and ops and we need them to be open source so we can figure out just what the heck they’re doing when things go sideways. Working with open source communities and commercial organizations can be a bit tricky. Personally I’m walking the line between jclouds, OpenStack, and Rackspace. Hopefully, most of the time your goals will align but sometimes it’s just a matter of balancing the priorities between the differing concerns. Always remember to stay humble, helpful, and honest. The product of this includes helping other developers contribute, code reviews, having an opinion on community matters, and helping out in ways beyond your immediate concerns.

I’m a technical writer. I also stress documentation as a key developer advocate activity. Documentation is often done by developers but it’s particularly important to this role. When trying out your platform for the first time, the first place most developers are going to start is the docs. If you’re trying to make your platform easy to use then those “Getting Started” style docs had better be clear and concise. This will be one of the first experiences a developer has with your platform and you want them get on board smoothly. The product of this includes getting started guides, reference documentation, and detailed API docs.

Advocacy

micI represent third-party software developers. We’re out there trying to build the platforms and tools that people love to use, make developers productive, and make it worthwhile for them to invest time in learning our platform. When building this stuff, sometimes it’s easy to lose sight of the forest for the trees. Which is to say, we can lose sight of the very developers we’re building this platform for, if we get too focused on the details of the technologies. We need to keep the needs of the third-party developers foremost in our minds at all times to prevent that.

I represent my company, Rackspace, and its core values. Public speaking is definitely a requirement for the role. You need to be able to comfortably get up in front of an audience and let them know why your platform and its ecosystem are the best place to invest their time and effort. Focus on the benefits to them. My preference is to give workshops where you can get developers writing some code, doing something useful with the platform, and really demonstrating its ability. This goes back to the developer half of developer advocate. The product of this includes presentations, workshops, and demos.

I help lead technological change. It’s rare that a platform exists in isolation. Typically there are competing platforms all vying for market dominance. You’ll need to come up with strategy and tactics to encourage the adoption of your platform. To find out how well that adoption is going you’ll need metrics. This is a much broader issue for your organization so you’ll want to focus on the metrics important to your group, namely the adoption of the tools you’ve developed and what affects that.  I’ve really only just started working as a developer advocate so I haven’t done much strategizing yet. I suspect it goes pretty deep and if you follow it all the way down, you’ll probably wind up in a different role within your organization. The product of this includes plans, metrics, and reading, lots of reading to keep up with the developments in your platform space.

Community

Barreleye: Weird Fish With Transparent HeadI engage with the development community. Beyond the conferences you need to find other ways to reach out to developers. I think blogging and trying to write well is core to this. A lot has been written (one of my favourites) about the importance of writing for developers so I won’t rehash it. Then of course there are updates to GitHub, Twitter, LinkedIn, Google+, DZone, or whatever social media/code outlet might be relevant to your platform. However you choose to broadcast information, it needs to have a mechanism for feedback. We are beholden to developers and need to be able to get feedback from them. The product of this includes blog posts, comments, tweets, and other social media updates.

I help developers. As you’re making your platform easy to use there are going to be some rough spots. There are going to be occasions when you don’t get it right the first time. One of the first indications of problematic areas will be developers asking for help about some aspect of your platform. You need to be subscribed to the right issue trackers, forums, and Q&A sites like StackOverflow to catch these questions. You don’t necessarily need to answer the question right away. Give the community a chance to help itself. But be aware of the questions and examine each one to see if it points to an underlying or obscured issue. The Developer Support Handbook is a good book on the topic. The product of this includes answers and some deep thought about what the questions mean.

I keep developers up-to-date with what’s going on with our platform. I consider this to be important enough to warrant its own point, separate from engagement and help. It’s critical that you be able to keep developers current with respect to changes to your platform. I wrote about this in Keep Up-To-Date With Changes To The Rackspace APIs so I won’t go over it again here. The product of this includes API updates via RSS/Atom, email, Twitter, or what have you.

I host/sponsor/attend community events like meetups, user groups, and hackathons. Delivering presentations at conferences is great but I find conferences can sometimes get impersonal. Smaller groups are much more intimate and you can deliver highly relevant information tailored to that group. It’s more of a grassroots approach and has a significantly different feel than conferences so I include it here under Community. Even so, the product of this is similar and includes presentations, workshops, and demos.

I try to be as transparent as possible in all of the work that I do. All of this community activity translates into transparency. From the stream of GitHub activity to blog poststweets and events, it should be abundantly clear what I’m up to. Personally I find it more interesting to work out in the open like this rather than behind closed doors. If developers can see exactly what you’re doing to improve your platform for them, they can trust you because there’s simply nothing hidden.

All of these activities help build a community around your platform. This is crucial as a community can make or break your platform. Having a thriving community can also make it easier to use as there will be far more help to go around than you or your team could possibly provide. This will help you scale as your community achieves self-sufficiency.

What a Developer Advocate is Not

Because the role touches on so many aspects, it’s easy to get diverted from the primary responsibility so it’s worthwhile to mention what a developer advocate is not. A developer advocate is not training, marketing, sales, or support. We work closely with the development community so other groups will naturally come to us for help and advice. Go ahead and help and advise them but just don’t go too far off course. You can’t let that distract you from making your platform easy to use for developers.

Coda

The Developer Advocate and the Developer Relations Group sits at that pivotal point between developers and the platform. As anyone who has developed software or done design for any length of time can tell you, it’s difficult to make something easy to use. It’s also something that’s absolutely necessary. Making your platform easy to use is the most important thing you can do to drive developer adoption.

This is my take on what it means to be a developer advocate. It’s been bouncing around in my head for the past few months and it’s good to get it out. Writing it all out like this makes me fully realize just how challenging and expansive the role can be. However, it’s not like you’re doing this stuff all at once (although occasionally you are). With the help of a great team and the support of management, it’s definitely doable.

If you’re a developer advocate, I’d love to hear what you think! Did I miss the mark on anything or miss something completely? How would you break the definition down?

If you’re a developer, what do you expect from your developer advocates?

 
Leave a comment

Posted by on December 28, 2012 in jclouds, rackspace, sdk

 

Keep Up-To-Date With Changes To The Rackspace APIs

RSSOne of the trickiest parts of developing on top of an external service exposed via an HTTP API, like the Rackspace Open Cloud API, is keeping up to up-to-date with changes to the API. Since it’s delivered as a web service it can change without you necessarily being aware of it. If a new feature is released, how would you know? If a change to an existing service is made and you could benefit from it by making an update to your code, how would you discover that?

How To Subscribe To The Changes

Any way you keep up-to-date with an API needs to be automatic. It’s just not realistic to expect people to “check back often” in order to find out when something has changed.

My personal preference for such subscriptions is via RSS/Atom feeds. To subscribe to this kind of syndication you’ll need a feed reader. My feed reader of choice is Google Reader. There are many clients on many devices out there for it and the web app is pretty solid too.

Sometimes I feel like I’m the only person still subscribing to feeds. Seems like most people get their info from Twitter, Facebook, Google+, or whatever. For stuff I really want to know about I much prefer the direct subscription model of RSS/Atom to the endless torrent of Tweets and Updates, there’s just a higher signal to noise ratio. But I digress.

The Feeds

Here are the links to the feeds for each Rackspace Open Cloud API as culled from the API docs.

If you’ve signed up for a feed reader like Google Reader, when you click on a Feed link you should get a page asking you to subscribe with the reader of your choice. What this looks like will vary depending on what web browser and feed reader you’re using.

Now you’ll be up-to-date on each and every new change to the APIs as they’re released!

The SDKs

That’s great for the APIs but what about the Rackspace Open Cloud SDKs? I hear you ask. Well you can find the release notes for the SDKs as follows.

Release notes are all well and good but where are the feeds? I hear you demand. Well the feeds aren’t there quite yet. More below.

Coda

As you can see we’ve got release notes and feeds for most stuff but not everything. That’s not good enough. We need to have a consistent experience delivering updates on all of the APIs and SDKs you care about. There should also be additional subscription options so people can consume the updates however they want.

One of my goals for 2013 is to deliver this experience. To get you the updates you want, when you want them, and how you want them.

 
Leave a comment

Posted by on December 21, 2012 in rackspace

 

jclouds 1.5.3 Released With OpenStack Cinder and Rackspace Cloud Block Storage Support

jclouds 1.5.3 was officially released over the weekend. Another solid release from the jclouds community. Among a number of new features was the support I added for OpenStack Cinder and Rackspace Cloud Block Storage.

OpenStack Cinder

Cinder BlockCinder is the OpenStack block storage service. On physical machines, examples of block storage devices are hard drives and USB sticks. Cinder allows you to create persistent virtual block storage devices as volumes that can be attached to servers and mounted with filesystems. This means you can store any data on the volumes and that data will persist even if your server is terminated.

From an OpenStack API perspective there’s some historical context that will help you understand Cinder. Cinder was born out of the need to create an independent block storage service. However, originally, there was a block storage service in OpenStack called nova-volume that had its own API but was officially part of the Nova API. A new service for Cinder in OpenStack Folsom means a new Cinder API but this API was an exact copy of the nova-volume API in OpenStack Essex. This was done very deliberately to maintain backwards compatibility and ease the transition from nova-volume to Cinder. Both APIs now exist in Folsom but the Cinder API is the path forward where all new efforts will be focused.

Rackspace Cloud Block Storage

Cloud Block StorageCloud Block Storage (CBS) is Rackspace’s deployment of Cinder. This means it’s the Rackspace service that allows you to create volumes via the Cloud Control Panel, the CBS (Cinder) API, or jclouds! You can create standard volumes that work well for your everyday file system needs, and SSD volumes that deliver even higher performance for databases and other I/O-intensive applications. It also allows you to easily create a snapshot of your existing volumes that effectively act as a point-in-time backup.

To get started with jclouds and Cloud Block Storage check out the Getting Started: The Rackspace open cloud documentation, specifically the Working with Cloud Block Storage section. There are plenty of examples in the cloudblockstorage package of the Rackspace examples on how to use this essential new service. For instance, the CreateVolumeAndAttach.java is an end to end example of creating a volume, attaching it to a server, putting a filesystem on it, and mounting it for use to store persistent data.

Coda

Block storage is one of the fundamental building blocks (no pun intended) of computing. This has been an often requested feature for Rackspace and it’s great to help other developers use it by providing support for Cloud Block Storage and Cinder in jclouds. I encourage you to upgrade to jclouds 1.5.3 and checkout these new features.

 
Leave a comment

Posted by on November 20, 2012 in openstack, rackspace

 
 
Follow

Get every new post delivered to your Inbox.