I’ve been affiliated in some way with Iron Foundry since 2011. Back then, I wrote up an InfoQ.com article about this quirky open source project that added .NET support to the nascent Cloud Foundry PaaS movement. Since then, I was hired by Tier 3 (now CenturyLink Cloud), Cloud Foundry has exploded in popularity and influence, and now Iron Foundry is once again making a splash.
Last summer, Cloud Foundry – the open source platform as a service – did some major architectural changes in their “v2” release. Iron Foundry followed closely with a v2 update, but we didn’t update the free, public sandbox to run the new version. Yesterday, the Iron Foundry team took the wraps off an environment running the latest, optimized open source bits. Anyone can sign up for a free IronFoundry.me account and deploy 10 apps or 2 GB of RAM in this development-only sandbox. Deploy Java, Node.js, Ruby and .NET applications to a single Cloud Foundry fabric. Pretty cool way to mess around with the cloud and the leading OSS PaaS.
In this blog post, I’ll show you how quick and easy it is to get an application deployed to this PaaS environment.
Step 1: Get an IronFoundry.me Account
This one’s easy. Go to the signup page, fill in two data fields, and wait a brief period for your invitation to arrive via email.
Step 2: Build an ASP.NET App
You can run .NET 4.5 apps in IronFoundry.me, and add in both SQL Server and MongoDB services. For this example, I’m keeping this super simple. I have an ASP.NET Webforms project that included the Bootstrap NugGet package for some lightning-fast formatting.
I published this application to the file system in order to get the deploy-ready bits.
Step 3: Log into Iron Foundry Account
To access the environment (and deploy/manage apps), you need the command line interface (CLI) tool for Cloud Foundry. The CLI is written in Go, and you can pull down a Windows installer that sets up everything you need. There’s a nice doc on the Iron Foundry site that explains some CLI basics.
To log into my IronFoundry.me environment, I fired up a command prompt and entered the following command:
cf api api.beta.ironfoundry.me
This tells the CLI where it’s connecting to. At any point, I can issue a cf api command to see which environment I’m targeting.
Next, I needed to log in. The cf login command results in a request for my credentials, and which “space” to work in. “Organizations” and “spaces” are ways to segment applications and users. The Iron Foundry team wrote a fantastic doc that explains how organizations/spaces work. By default, the IronFoundry.me site has three spaces: development, qa, production.
At this point, I’m ready to deploy my application.
Step 4: Push the App
After setting the command line session to the folder with my published ASP.NET app, I was ready to go. Deploying to Cloud Foundry (and IronFoundry.me, but extension) is simple.
The command is simply cf push but with a caveat. Cloud Foundry by default runs on Ubuntu. The .NET framework doesn’t (ignoring Mono, in this context). So, part of what Iron Foundry does is add Windows environments to the Cloud Foundry cluster. Fortunately the Cloud Foundry architecture is quite extensible, so the Iron Foundry team just had to define a new “stack” for Windows.
When pushing apps to IronFoundry.me, I just have to explicitly tell the CLI to target the Windows stack.
cf push helloworld –s windows2012
After about 7 seconds of messages, I was done.
When I visited helloworld.beta.ironfoundry.me, I saw my site.
That, was easy.
Step 5: Mess Around With App
What are some things to try out?
If you run cf marketplace, you can see that Iron Foundry supports MongoDB and SQL Server.
The cf buildpacks command reveals which platforms are supported. This JUST returns the ones included in the base Cloud Foundry, not the .NET extension.
Check out the supported stacks by running cf stacks. Notice the fancy Windows addition.
I can see all my deployed applications by issuing a cf apps command.
Is it time to scale the application? I added a new instance to scale the application out.
The CLI supports tons of other operations including application update/stop/start/rename/delete, event viewer, log viewer, create/delete/bind/unbind app services, and all sorts of domain/user/account administration stuff.
Summary
You can use IronFoundry.me as a Node/Ruby/Java hosting environment and never touch Windows stuff, or, use it as a place to try out .NET code in a public open-source PaaS before standing up your own environment. Take it for a spin, read the help docs, issue pull requests for any open source improvements, and get on board with a cool platform.