SITREP – Stoking Iron Foundry, Thor Hammering & Joining… ?

What have I been up to? Here’s a quick recap. You may want to get involved with some of these projects!

Iron Foundry & Tier 3 Web Fabric

Iron FoundryBack when I left the kick ass team at Russell Investments in Seattle I stepped directly to bat as team lead at Tier 3. My job, get a PaaS built on Cloud Foundry and extending that with Iron Foundry. It was an ambitious effort that would provide the most extensive framework and language support available from any PaaS Provider on the market.

Well, we did it, thanks to the capabilities of Cloud Foundry Community, the great minds of Jared Wray @jaredwray, Luke Bakken, Eric Lee @saintgimp, Cale Hoopes & the rest of the Tier 3 Team! I was able to add this to my list of successes. We had some bumps, some collisions, a brick wall or two and other scheduling problems – ya know, the standard things that happen on a project. But in spite of it all, we got the Web Fabric released – and it continues to be the only PaaS available with such a wide framework and language support. It ranges from Ruby on Rails, Erlang, Node.js & Java to .NET! If you’d like to check out the open source PaaS of Cloud Foundry & Iron Foundry both projects are always looking for participation & contributions!

Thor Brings the Hamma!

After the release of the Tier 3 Web Fabric I started the search for a wicked smart and capable OS-X / Cocoa Coder – it seems their availability is pretty limited these days! Well I finally lucked out and found Benjamin van der Veen (@bvanderveen, thanks for the intro Selena @selenamarie!) to help me get started on the Thor Projects. There’s the Cocoa Thor Project & the Windows 7 WPF Metro based Thor .NET Project that we’re wrapping up with v1 releases coming really soon. To check out more on these projects that I’ve lead & coded on check out the code bases & information, all linked on ironfoundry.org. The projects are open source, so feel free to jump in and help out or fork & submit pull requests. The team will be happy to review & discuss ASAP.

While we’re wrapping these projects up right now, I’ll actually be continuing on and supporting the projects: Thor & Thor .NET. I will continue to be involved, as I was saying, in a number of ways in the PaaS space. So don’t think I’m disappearing form that realm!

Basho Sings my Song

I’ve been keeping track of Basho for a while now. Riak caught my interest many months ago as a really well built, well thought out & advanced distributed database. As you might guess, being into the whole “cloud computing” industry, I’m just ever so slightly interested in distributed systems. The other thing that I’m a huge fan of, which Basho does, is heavily support and involve itself in the open source software community and movement. The icing on the cake, was their diverse use of systems and language use around Erlang. All things that are massive wins.

Bailey's Taproom
Bailey’s Taproom

Well during a random conversation with Eric @coderoshi at Bailey’s Tap Room & then attending the RICON 2012 Conference (article here and pictures) I spoke to some of the team and found out they were looking for some particular skill sets. Well it just happened that I was keenly interested in meeting those skill set requirements! So December 1st I’ll be joining the Basho team full time as developer advocate, evangelist, messenger or such for the northwest working with a few people you may know such as Mark Phillips @pharkmillups, Andy Gross @argv0 (thanks for the intro James @wattersjames), Eric Redmond @coderoshi, Shanley Kane @shanley, Casey Rosenthal @caseyrosenthal and many others. Simply, I’m freaking stoked.

How This Helps You Help Me Help You

Alright, so it’s great but how can I help you in your day to day? What data do you work with? Do you work with a data scientist? Are you a data scientist? Do you work with huge sets of data, many objects, large objects? I want to know about your data usage and data problems, because there’s a good chance we’ll have more than few things to discuss. Here’s some ways I can help you, help me, help you. Ping me if you’re interested in…

  • talking about your data usage at the monthly Riak user group.
  • coding, pairing & otherwise learning Erlang and the monthly Erlang group.
  • interested in coding, deploying and inventing new paradigms and patterns of data storage.
  • interested in pairing up to learn how to deploy, migrate, upgrade or otherwise use NoSQL solutions – namely Riak.
  • interested in Ruby on Rails, Node.js, Map Reduce, .NET, Java, PHP and how these things can and do work against data in everything from relational databases to the new echelon of NoSQL databases.

I hope to hear from you soon and see you at an upcoming user group, cheers!

Thor Project Opens Up, Building the Cloud Foundry Ecosystem with the Community

The Iron Foundry Team are big advocates of open source software. We write code across all sorts of languages, just like many of the development shops out there do. Sometimes we’re heavy on the .NET, other times we’re all up in some Java, Ruby on Rails, spooling up a Node.js Application or something else. So keeping with our love of open source and our polyglot nature we’ve created the Thor Project with three distinct apps.

Before jumping into the applications though, a little context for what and where Thor is in the grand scheme of things. We need to roll back to the Cloud Foundry Project to get into that. The Cloud Foundry Project is an open source project built around software for PaaS (Platform as a Service) which can be used to build your own PaaS internally or externally, in a cloud provider or directly on hardware. It’s your choice how, when and where you want to use it. For more context on PaaS check out my previous entry “The Confusions of IaaS, PaaS and SaaS“.

Thor Project

Cocoa for OS-X

Thor Odinson
Thor Odinson, God of Thunder

You know who Thor is right? He’s this mythic Norse God, also known as the God of Thunder. Since we’re all about bringing the hamma we welcomed Thor into our team’s stable of applications. So starting immediately we’ve released Thor into the realms for contributions and fighting the good open source software battle! If you’d like to join the effort, check out the github project and feel free to join us!

Technically, what is the Thor Application? This is a Cocoa Application built for OS-X that is used for managing, deploying and publishing applications to Cloud Foundry enabled and or Iron Foundry extended PaaS Environments.

.NET for Windows 7

The .NET Metro version of the Thor Application is also released via github with a provided installer. We’ve almost taken the same path, except of course for the very different UX and UI queues with Windows 7 and the Metro UX design guidelines.

WinRT for Windows 8

I wasn’t really sure what to call this version. Is it Metro or WinRT or Windows 8 or something else? Anyway, there is a project, it is albeit empty at this point, but it is the project where the Windows 8 version of Thor will go! For now get the Windows 7 version and install it on Windows 8, it won’t have touch interface support and things, but should work just like a regular application on Windows 8.

The Code

To get started with these, generally you’d just clone the repo and do a build, then get started checking out the code. There is one catch, for the OS-X version you’ll want to pull down the sub-modules with the following command.

[sourcecode language=”bash”]
git clone git@github.com:YourForkHere/Thor.git
git submodule update –init –recursive
[/sourcecode]

Once you do that in XCode just make sure to then select the right project as the starting build project.

…then when the application is launched…

Thor Running in OS-X
Thor Running in OS-X

I’ll have more in the coming days and weeks about Thor & Iron Foundry. For now, check out the blog entry on the Iron Foundry Blog and subscribe there for more information.

Ways to Interact Asynchronously with C#

NOTE: All of this code is available at my Github Project “Remembering” (https://github.com/Adron/Remembering). Feel free to fork it, share it, or send me corrections or pull requests.

While working on the Thor Project there have been numerous situations where I need to fire off an asynchronous callback in C# while maintaining good responsiveness in the actual user interface. Benjamin (@bvanderveen) has been using Reactive Extensions with subscriptions to do this in the Objective-C code for the Cocoa based OS-X Thor user interface. See my previous blog entry for an example of what he’s doing.

For a good example of asynchronous calls against Cloud Foundry I setup the following project using the Iron Foundry Project VCAP Client Library. The first thing I setup was a static class with a few constants to use across the examples for the URI, username and password for the Cloud Foundry Account.

[sourcecode language=”csharp”]
public static class YourSecrets
{
public const string Username = "youremail@someplace.com";
public const string Password = "AnAwesom3HardPassw0rd!";
public const string Uri = "http://api.yourpaas.com";
}
[/sourcecode]

Next step was to setup the delegate and method I’d use for calling out to the Cloud Foundry environment and retrieving data in parallel to my active console or user interface. That code snippet looked like this. I also added a private variable _finished for use in tracking when the request was completed in the begin and end invoke example below.

[sourcecode language=”csharp”]
private bool _finished;

IEnumerable TheMethodToConnectThatWillTakeLongTime(string uri)
{
var client = new VcapClient(uri);
client.Login(TheSecretBits.YourSecrets.Username, TheSecretBits.YourSecrets.Password);

_finished = false;

return client.GetApplications();
}

delegate IEnumerable MethodDelegate(string uri);
[/sourcecode]

Once I had that setup I was ready to create my baseline method that would make a synchronous call. A synchronous call is one that makes the call as if it just called the method directly. There’s no real reason to create one like I’ve done here, but I was just using it to provide a basic example of calling the delegate.

[sourcecode language=”csharp”]
public void SynchronousCall()
{
var starting = DateTime.Now.ToLongTimeString();

var delegateMethod = new MethodDelegate(TheMethodToConnectThatWillTakeLongTime);
var returnedBits = delegateMethod(TheSecretBits.YourSecrets.Uri);

var ending = DateTime.Now.ToLongTimeString();

Console.WriteLine(string.Format("The delegate call returned \n\n{0}\n\nstarting at {1} and

ending at {2} which takes a while of waiting.",
returnedBits, starting, ending));

_finished = false;
}
[/sourcecode]

That gets us a baseline. If you run a synchronous call against anything with a console application or a windows app, WPF or whatever it will lock up the calling thread while it is waiting for a response. In any type of user interface that is unacceptable. One of the best options is to fire of an asynchronous callback. The way I did this, which is an ideal way to make calls with the Iron Foundry Client Library against a Cloud Foundry Environment, is shown below.

This is my asynchronous call.

[sourcecode language=”csharp”]
public void DemoCall()
{
Console.WriteLine("Callback:");
var delegateMethod = new MethodDelegate(TheMethodToConnectThatWillTakeLongTime);

var callbackDelegate = new AsyncCallback(MyAsyncCallback);

Console.WriteLine(" starting…{0}", DateTime.Now.ToLongTimeString());
delegateMethod.BeginInvoke(TheSecretBits.YourSecrets.Uri, callbackDelegate, delegateMethod);
Console.WriteLine(" ending…{0}", DateTime.Now.ToLongTimeString());
}
[/sourcecode]

Now the simple callback.

[sourcecode language=”csharp”]
public void MyAsyncCallback(IAsyncResult ar)
{
Console.WriteLine("Things happening, async state calling.");

var delegateMethod = (MethodDelegate)ar.AsyncState;

Console.WriteLine(" called…{0}", DateTime.Now.ToLongTimeString());

var returnedBits = delegateMethod.EndInvoke(ar);

Console.WriteLine(" end invoked…{0}", DateTime.Now.ToLongTimeString());

foreach (Application application in returnedBits)
{
Console.WriteLine("Application {0} is in {1} state…",
application.Name, application.State);
Console.WriteLine(" with {0} running instances, {1} memory per instance, {2} disk allocated…",
application.RunningInstances, application.Resources.Memory, application.Resources.Disk);
Console.Write(" hosted at ");
foreach (var uri in application.Uris)
{
Console.Write(uri + " ");
}
Console.WriteLine(".");
}
}
[/sourcecode]

That’ll get the call running on a parallel thread and when it is wrapped up it returns the data.

The User Interface Interaction Issue

This is all fine and dandy for the command console. But if you want to give control back to the UI thread in a UI application and make sure that the background thread can actually update a control when fired off, do the same thing as I’ve discussed here except set the control up to invoke the dispatcher, so that the “threads don’t cross” when trying to return information to a control that needs updated. In order to do this take the control that needs updated and set the Dispatcher Invoke method as shown below.

[sourcecode language=”csharp”]
private void Write(string updateText)
{
UpdatingTextBlock.Dispatcher.Invoke(
System.Windows.Threading.DispatcherPriority.Normal,
new Action(delegate
{
UpdatingTextBlock.Text += updateText;
}
));
}
[/sourcecode]

For more on the Iron Foundry Project and the library I’ve used here, check out the Iron Foundry Blog & Site. For more information on Thor and to follow or get involved check out the Thor Project Site (Hosted with Cloud Foundry at Tier 3!).

All of this code is available in my Github Project “Remembering” (https://github.com/Adron/Remembering). Feel free to fork it, share it, or send me corrections or pull requests.

Thor – Cool Objective-C Bits, Libraries and Code Snippets [[TheSeries alloc] init];

Benjamin Van Der Veen (@bvanderveen) has been working with me to build out the Thor Application  based on Nathan Young’s (@nathanyoung) awesome designs. We’ll be releasing open source real soon. I wanted to cover some of the cool libraries, specific code snippets and such. These are a few of the things that have come in very useful as the coding deluge began.

Reactive Cocoa (AKA Reactive Extensions)

When you need to compose and transform sequences of values (kind of like Reactive Extensions for .NET) this is your library when working in Objective-C land. Reactive Cocoa or “RAC” for short can observe on key values to provide a key value for compliant properties. RAC helps to keep mutability under wraps (which is really really needed in Objective-C), pulls together behaviors and relationships between properties, and helps tremendously with asynchronous actions. The last bit we have a good amount of occurring with Thor since it talks to the Cloud Foundry web service API end points.

An example I snagged from the github site is below. It watches for changes on the username property.

[sourcecode language=”objc”]
[RACAbleSelf(self.username) subscribeNext:^(NSString *newName) {
NSLog(@"%@", newName);
}];
[/sourcecode]

Which serves, as pointed out in the README.md (be sure to read it if you’re going to use the library), as a wrapper around KVO. It goes on to show further sequences on complex actions.

[sourcecode language=”objc”]
[[[[RACAbleSelf(self.username)
distinctUntilChanged]
take:3]
where:^(NSString *newUsername) {
return [newUsername isEqualToString:@"joshaber"];
}]
subscribeNext:^(id _) {
NSLog(@"Hi me!");
}];
[/sourcecode]

For some that write C# all the time this might seem like a “meh” moment. But considering the work that would be needed in Objective-C usually this could take significantly more lines of code, such as setting an observer, using a property or something to watch the value, monitor the non-distinct changes, and then bounce the value of the property for every non-distinct value. Yeah, and it still isn’t done. But anyway, that’s just the icing, the cake is delicious. If you’re in Objective-C land much, it is worth checking out.

Check it out on Github.

Thor Brings the Hamma! Cloud Foundry OS-X, Windows 7 and Windows 8 Interfaces FTW!

One of the things that I do in my work is lead the efforts around creating and leading open source projects. As regular readers may know, I’m big into open source efforts, especially around PaaS. My preferred PaaS offering these days for internal, external and public cloud PaaS is Cloud Foundry (with Iron Foundry for all of my .NET needs). Today the we made the projects official and I’m charging forward with a a great team of people. You’ll be able to use these new user interfaces for Cloud Foundry against Tier 3 Web Fabrics, CloudFoundry.com, Stackato, AppFog and any other company that uses Cloud Foundry at the core and exposes the web service APIs for use!

Thor & Thor.NET

In a couple weeks we’ll be making the github repositories completely public, open sourcing the code & products entirely and looking forward to working with the community to make these tools as awesome as we can. For now, if you’d like to jump into the repositories and see where we are and what we’re up to as we step toward opening them completely, sign up via “early access“. We’ll get you setup on the repo so you can fork, pull and add you’re own signature bits.

Why did we name the project Thor? Well, we’ve been spearheading the Iron Foundry Community efforts for .NET support on Cloud Foundry so we figured we needed someone to bring the hamma to the battle, nobody better than Thor for that!

I’ll have a regular write up of snippets, code and other things I’m working on here so subscribe and give me a follow on Twitter (@adron) and App.net (@adron). Also, for official open source releases of the project check out the Iron Foundry Organization site that has the Iron Foundry downloads, source, Thor and the official Iron Foundry Blog.