typemismatch

just a projection of my own imagination

  • You are here: 
  • Home

Deployment to Windows Azure

Posted on June 4th, 2009

Here goes my first real deployment. The first thing you’ll notice is that you no longer need an application id. It looks like that was there for live authentication and so it has been decoupled for those not needing it by default.

To deploy you just upload the application package and service configuration file. By the way, just right click your worker role project and pick Publish to generate your files. Once uploaded, you get this cool staging/production screen.

image

Once uploaded you can change the configuration xml via the browser which is great! I’m about the hit run and see what happens …

Staging worked perfectly. I can’t find a way to view logs so I’m going to promote it to production next. As a test the service emails me the logs, so I can see it all working.

The promotion seemed to work however I did get a system error from the website. I will say this – the site needs some work, it is pretty slow and bulky. Come on MS make it fly! :)

Tags:
Filed under Software | No Comments »

Using Windows Azure with Amazon Simple DB

Posted on June 4th, 2009

I have a great real world example of something that needs to be run in the cloud. Currently I have 2 types of applications running. One type is a sentinel and the other is a listener. There are many of these running today across three data centers. I want to know when one of these services has stopped functioning correctly.

My test is going to be to build a worker role that can run in Azure, connect to Amazon’s Simple DB service and look for status information sent from these other services. This will show connectivity between two different cloud technologies and allow me to test the availability and notification services of Azure. For example, is this new worker goes offline – how do I get notified?

I’ll be using my SDB .NET Provider which I haven’t yet released to the public. It allows me to hide the implementation of the Simple DB code so I can switch it out as required. It includes all Amazon libraries as well as SQS and a .NET Membership provider.

Here is the initial code block.

image

We’ll write an object to Amazon and then see if we can fetch it. This is making use of Amazon’s web services. I specifically didn’t put any exception handling around this start method because I want to see what the Azure system does when something goes wrong. The provider was configured using an app.config file.

When I tried to run – problem:

System.Security.SecurityException Message=Request for ConfigurationPermission failed while attempting to access configuration section at …. – lucky for me controlling the section permissions can be done in the config file. I set my section to requirePermission=false.

I don’t seem to be able to use a config file to setup the provider so I’m going to cheat for now and setup a stand alone instance without any config files and we’ll see how that does :) I did notice I’m probably supposed to put all the required config xml in the service configuration file so I’ll do that next time.

Here is a screenshot of the output, works like a charm. A test object was written and retrieved from Amazon Simple DB.

image

A couple notes. If you rename your worker role don’t forget to update your service definition file and configuration file. There does appear to be a problem with the developer fabric. I write information event entries to the log and they were not showing up but I knew the role was running. After restarting the fabric the messages started to appear again so I’ll see if I can report that as an issue. As an FYI I used a System Timer object to trigger my code, works great too.

In my next post, I’ll try deploy this to the real cloud :)

Tags: ,
Filed under Software | No Comments »

My TDD Analogy

Posted on June 3rd, 2009

In my post about Test Driven Design I expressed concerns around building your entire architecture to just support testing. My thoughts were definately tough to put into words, maybe I should have used more pictures :)

I do finally feel I have a decent analogy to the problem I’m concerned with. Building your application to be perfectly testable would be like building a car to always pass a crash test and to say – “let’s build a car that could never ever hurt someone”. Great, so it has no wheels or even an engine but dammit, it performs great in crash tests, it passes every test!

Applications have to work, testing like vehicle safety does unfortunately come second to functionality. Should you test? of course – but it is a balancing act so don’t get sucked into all the hype.

Also, in the words of Jeff Atwood, don’t just listen to me or don’t listen to me at all. I am no expert so do your homework :)

Tags:
Filed under Software | No Comments »

Windows 7 RC on Apple Mac Hardware

Posted on June 2nd, 2009

I still love all my MAC hardware but when doing a lot of heavy .NET development on my mac book pro I wish I didn’t always have to virtualize the environment.

Firstly, running Windows 7 RC in Vmware’s Fusion is great. It is fast, stable and generally a total turn around from Vista. I do however want the maximum out of my hardware so decided to try Windows without the virtual machine.

To do this I went away from the suggested Bootcamp installation since I had a bunch of spare, high speed SATA drives I threw on of those in and was off. The boot sequence on these machines is great, I just selected the Win 7 installer DVD and installed to the empty drive.

Once up and running I had to get some new drivers from Apple and install the Windows version of Bootcamp which helps with drivers, mouse support etc. Once I had all the drivers installed and rebooted I ran the test to figure out my machine’s rating. It scored a fantastic 5.7!! and before I had a 1.0 under fusion.

I still think Apple has the best hardware money can buy and would definately recommened buying their hardware and once Windows 7 is released, installing and using that. It is so fast, stable and great looking that it will blow you away.

Tags: ,
Filed under Electronics | No Comments »

First Azure Worker Role

Posted on June 1st, 2009

Here are some of my findings around Microsoft’s upcoming Azure platform. I initially thought Amazon had it in the bag with EC2 but to be honest, I’m tired of running my own servers. Google’s app hosting is ok, if you like Java or Python technologies – which I do but I thought I’d try the full Visual Studio approach :)

I’m using Visual Studio 2010 Beta 1. First gotcha, I wanted to run my work role and was told I had to be running VS as administrator … boo really? Wasn’t that a freaking Vista problem. This is Windows 7 RC1 people!

image

If you’re not running SQL Express you’ll need to reconfigure the local data storage services, which have those lovely hidden options buried in a .config file. Thanks to the link for the location. (Changing Development Storage)

Get it right and you’ll get this nice little local storage window the first time you run something:

image

When your role gets running, you can load up the fabric UI to actually get control of your own Azure cloud. All this without having to actually deploy to the cloud yet. Pretty neat. Remember that a role is basically like a console application in the cloud. Here is my little default application running, the output is just like a console window:

image 

So what comes next? I’m going to try embed my Amazon Simple DB provider and S3 library into a real role and throw in some workflow for fun. Might as well push it right :) I’ll also be fetching some data from AQS. (Amazon Queue Service). I’ve read a fair bit about thread issues or at least limits on how many instances of a role can run.

Right now I believe you’re limited to 1 instance of a role which kinda sucks. You can have threads which is fine but still puts severe caps on application scale capacity.

Tags:
Filed under .NET, Software | 2 Comments »

A warning about test driven development

Posted on June 1st, 2009

Oh wow did someone really say something bad about TDD … I mean what could be bad about this latest fad ;-)

So testing your code is of course a good thing. Anything these days to help us write better code is a good thing but definitely in moderation. I’d say with all the work going into TDD and I’ll later explain my thoughts on DDD, people are once again on the search for the holy grail of software engineering. It doesn’t exist, get over it – software engineers are artisans by definition and that is because our skill is extremely creative and you can’t wrap it up in a process to make it perfect.

What bothers me with TDD is the amount of effort being placed on “passing the test”. It is one thing to make your code easier to test but a totally different thing to engineer your entire application, just so it can be tested. Is your client paying you $$ per hour to have something that can be tested or something that works?

What about dependency injection. A hot subject for allowing the injection of mock objects or testable objects into code. My question is, if you inject a mock object into a test – is the test really real? Now inversion of control has its place, like most patterns, but I warn you against thinking you’ll now have perfect code if every class is instantiated through an IoC container.

So when it comes to application architecture I urge you to use some common sense. Pick patterns that solve problems you really have. A lot of code can be tested just fine without DI. A facade is often simpler for centralized code. Here are the general rules I would suggest to keep you on track:

  1. Build an application that meets the requirements first!
  2. Make sure it performs and scales well.
  3. Make it easier to test! but not a requirement if it means major architectural changes.
  4. If you can’t automate your test, like many user interfaces – use a person, they’re called QAEs!

You don’t have to like it but too many developers forget what the point of the code is to start with. Not to pass tests but to do something cool :)

Tags:
Filed under Software | 1 Comment »

Visual Studio 2010 Beta 1

Posted on May 25th, 2009

Yeah I guess the title sums this up. Reminds me of how ridiculous it was when VS 2008 was launched and wouldn’t run on Vista …

I tried to get this up on Windows 7 RC1 and it installed fine but when it loads the screen doesn’t paint correctly. After a few clicks I just get the frame of the IDE and nothing else … freaking joy.

I _might_ be related to running in a virtual machine but either way it should work otherwise I’ll be stuck with VS 2008 for quite some time.

edit: I knew this would come back to bite me, no point hiding it. The readme has the solution about vmware 3d acceleration issues. Turn it off and you’re good – not a great solution but still a solution. I’m not sure who is to blame for the issue.

Tags:
Filed under Software | No Comments »

Netflix coming to Media Center

Posted on May 20th, 2009

Well here you go, right from the horses mouth.

Netflix for media center

I mean it has only been 2 years since the unsupported version of this plugin was released so right in line for MS to finally connect the damn dots.

Hopefully this version is more stable than vmcNetFlix which was ok but never really stable and I suspect they were stealing login information but anyway … that aside nice to have this now since with multiple xbox extenders I refuse to have more than one gold account I can now stream netflix movies all over the place :)

Tags:
Filed under General | No Comments »

IPhone applications and objective-c

Posted on May 19th, 2009

So I wanted to post a little about the things I’ve found now working with Cocoa and the application I chose to target first was an iPhone application. I haven’t really had much time to dig into a native mac application yet.

Firstly lets talk a little about XCode. This great IDE comes free when you own a mac – pretty cool. Unlike Visual Studio which must be purchased if you want anything besides the free version. XCode is a great IDE, it is fast and simple enough to use. Apple has included everything you need including performance and memory profiling tools.

The extensions to support iPhone development are totally seamless so that was a nice find. Once I started getting into objective-c I thought my eyes were going to bleed :) Really, it is too old. The future is with managed languages and the thought of any form of memory management is pretty lame but right now, I have no choice. If you want an iPhone application you’re going to be using obj-c.

The language did have a couple positive points, at least what I’ve discovered so far. The way it passes around messages is a cool idea. Parameters are named when passing values to a method. (msg) – this makes for more coding but it makes it a hell of a lot easier to read the code later.

I did like Apple’s take on controller and view separation. Even using a separate tool for the interface design is a great way to keep the UI developer out the controller code. Up until Microsoft released the new ASP.NET MVC framework all views and code behind files were tied together. Unfortunately for traditional ASP.NET and WinForm development this is still true.

So right now I’m impressed and enjoying the development process. I think Microsoft could learn a few things from Apple however …. I do feel strongly that Apple need to connect the dots and that their code needs to move to a managed environment. They could adopt Ruby more rather than just supplying the API bridge.

Tags: , ,
Filed under Software | No Comments »

Keep your GMail page closed!

Posted on May 19th, 2009

Just a little something here that I’ve noticed especially on my macbookpro which I routinely overload. I used to always have a browser window open with my gmail in it. Turns out GMail puts a lot of load on the browser process, way too much to just have it open all the time. I’ve noticed this in FireFox 3 on the mac for the most part.

Since I’ve had plenty of issues with FF on the mac it may just be that. Safari 4 beta seems much better but still, it generates too much load. I can imagine it is busy checking for mail and other things but it is not really an acceptable back ground process.

Of course on my workstation who cares … 8 cores can deal with it :)

Tags: ,
Filed under General | No Comments »