»
S
I
D
E
B
A
R
«
The November version of the Windows Azure SDK and Tools
Nov 15th, 2009 by evereq

Download them here.

New in the November 2009 SDK (quote from Microsoft Windows Azure team newsletter):

  • Windows Azure Service Runtime managed library: The latest version of the Service Hosting Runtime API includes support for enhanced communication between roles and for runtime notification of service configuration changes. Direct communication between role instances enables new application development scenarios, including applications that distribute state across role instances. Service configuration changes include an increase or decrease in the number of request role instances and changes to the values of configuration settings.
  • Windows Azure Diagnostics managed library: The new Diagnostics API enables logging using standard .NET APIs. The Diagnostics API provides built-in support for collecting standard logs and diagnostic information, including the Windows Azure logs, IIS 7.0 logs, Failed Request logs, crash dumps, Windows Event logs, performance counters, and custom logs.
  • Certificate Management: Enhanced support for SSL certificates in Windows Azure and in the Windows Azure SDK enables the secure automated deployment of certificates to services hosted on Windows Azure.
  • Variable-size Virtual Machines : Developers may now specify the size of the virtual machine to which they wish to deploy a role instance, based on the role’s resource requirements. The size of the VM determines the number of CPU cores, the memory capacity, and the local file system size allocated to a running instance.
  • External endpoints for worker roles. A worker role may now define any number of external endpoints for HTTP, HTTPS, and TCP, and specify the desired port number for any external endpoint.
  • Persistent local resource storage: Developers can now choose to persist data written to a local storage resource at runtime when the role is recycled.
  • Windows Azure Storage Client managed library: The Storage Client library provides a .NET API for accessing the Windows Azure storage services.
  • Improved Development Storage: Development storage provides a high-fidelity simulation of the Windows Azure storage services in the cloud. Tables can now be created dynamically in the development storage Table service and are no longer required to be generated in advance.
  • Updated samples: The samples included with the Windows Azure SDK have been updated to demonstrate new features. The samples now include both C# and Visual Basic versions.

As we can see – a lot of improvements and new features introduced in this release. I will made review of them right after will have time to check (hopefully today later)! In any case, glad that MS improve Azure SDK so quickly!

Update: after installation and first review, I found following:

  • It seems like Microsoft finally have “official” Client library for Azure Storage. The name is same like from samples before, i.e. “StorageClient”, but now it is in “Microsoft.WindowsAzure.StorageClient” namespace, not like “Microsoft.Samples.ServiceHosting.StorageClient” that was before! It is also VERY extended and improved, so if you going to use Azure Storage, for sure you need to use this library (and I am also going to use it in my EvejobAzNET project) – it give you access to Blob Service, Queue Service and Table Service! Sure like before, it is possible to use simple .NET Client Library for ADO.NET Data Services (and new library use it inside anyway, just check that it reference System.Data.Services.Client library inside)… But with official Azure Storage Client library a lot of tasks become much more simple! You can found this library (*.dll) in “c:\Program Files\Windows Azure SDK\v1.0\ref\” folder, together with other useful binaries!
  • It is possible now to use another “official” library to get programmatic access to most of functionality available before only from Azure Developer Portal (and actually I don’t know why, but for some reasons Portal works and looks not best way! You can google, A LOT of people complain about issues with this!).
  • A new Library for Logging and Diagnostic functionality was added to SDK (Microsoft.WindowsAzure.Diagnostics namespace) - feel free to review samples in SDK (zip archives available in root folder of SDK installation, i.e. in C:\Program Files\Windows Azure SDK\v1.0 by default – samples-cs.zip for C# version and samples-vb.zip for VB version)
  • A lot of other improvements / features was added that relate mostly to development / production environment (Visual Studio Azure support, new release of Development Fabric etc) – they not change significantly your code / application design, instead of features described above that I highly recommend to review in case if you develop for Azure!
Amazon AWS Big News for developers
Nov 13th, 2009 by evereq

Because I build Evejob multi-platform project with support of Cloud deployment scenarios (currently for Google App Engine and Microsoft Azure) and I am sure that best Web software must be ready to be deployed in Cloud(s), it was very interesting to read latest announcement from Amazon: “… AWS Software Development Kit (SDK) for .NET Now Available… “.

Sure it’s just a beginning for Amazon in development of real .NET SDK, but even with this version we can quickly build .NET applications that tap into AWS Cloud.   Yes,  even before developers have good libraries to build such applications, but now looks like we have first “standard” API from Amazon and this fact is very important!

For example, for Ruby there is no such official SDK (or Ruby gem), and developers can choice from few available gems (right_aws, amazon-ec2 or AWS:S3 to name just few).  The same situation for Java - available a lot of “community” libraries, but no official SDK… (ok, ok, for Java we have at least official AWS Toolkit for Eclipse, but Toolkit it is not SDK!!!).

But why it is important to have official “language specific” SDK?

Well, first of all, now because Amazon have few BIG rivals, like Google App Engine (and we know that Google DO have official SDKs, more so, for both Python and Java!) and Microsoft Azure (sure Microsoft always have SDKs – it a BIG plus for Microsoft!).

Also it is important for developers, so they know that if they take some library and put this library as “base” for communications with a Cloud, they will not need to dial with changes in API in case of library author decide to drop development! It is important to have SDK that will be up to date with company services (Amazon in our case), just because we developers want to be SAFE! Sure it is good if there are a lot of open source libraries that EXTEND SDK some way, but it’s just “add-ons” and can’t replace real official SDK!

So it is really BIG day for Amazon and .NET developers – first official “language specific” SDK, and for .NET!!! What will be answer from Microsoft Azure that is still in “Beta”? ;-)

Note: in this post I mean “language specific” SDK, not just common SDK that list API for Web Services  with samples how to use them for example, etc… Because most of they time developers dial with some specific language, it is important for services like AWS to provide language specific SDKs so developers can really quickly and “safely” create applications using such “language specific” SDKs! Hope you understand what I mean ;-)

Evejob Development Environment Installation Part #5: Ruby, JRuby and Rails + AppEngine Installation
Oct 28th, 2009 by evereq

Ruby installation

Let’s start from Ruby installation. We can download Windows One-Click Installer from http://rubyforge.org/frs/?group_id=167, for example ruby186-27_rc2.exe

During installation, make sure that you select at least “Enable RubyGems” option:

RubyInstallation

You can leave default installation folder (C:\Ruby).

Ones you finish installation, you can run both “ruby” and “gem”  from withing your command line.

So it’s time to install Rails, just type in command prompt:

gem install rails

and wait few minutes to finish installation.

JRuby installation

Download installation package from http://jruby.org/download. We will need binary Windows version, for example JRuby 1.4.0RC1 Binary .zip. Extract folder content to C:\JRuby folder and add path to the JRuby to your PATH variable:

JRubyPath

Let’s test installation:

JRubyTestInstallation

Now both Ruby and JRuby installed.

The problems starts when we will try to simultaneously use them (side by side)… First of all, make sure that you delete RUBYOPT environment variable (because it seems like JRuby gems did not work correctly if this variable setup). Now you can invoke each “gem” using following commands:

For Ruby:   ruby -S gem

For JRuby:  jruby -S gem

For example this is what I get on my machine:

GemSideBySide

Note: it is actually not a big problem that I had 2 different versions of Gem on my machine – both versions (1.3.1 and 1.3.5 works well for me… update of gem 1.3.1 fails for some reasons on my machine, so I decide to leave this for now…)

One small thing to do: it is possible that you have old version 1.3.1 of RubyGems like me (in the moment when I write this, latest version is 1.3.5 like was installed for JRuby). If we leave it, we can face some problems in future with IDEA etc, so let’s just update it:

UpdateRubyGems

Also, let’s install jruby-openssl (IDEA generate Error if this gem not installed):

OpenSSLforJRuby

Rails Installation

Next step is installation of Rails – just type following commands (it is better to just install Rails twice than to share same installation for both Ruby and JRuby):

ruby -S gem install rails
jruby -S gem install rails

EvejobRoR and EvejobRoRG Project

We going to create 2 separate projects now:

EvejobRoR – will use Rails build in ActiveRecord + MySQL database

EvejobRoRG – will use App Engine hosting, datastore and Google Accounts for user authentication APIs

Let’s start from more simple EvejobRoR:

cd c:\evejob
rails EvejobRoR -d mysql

Now let’s open this “template” project in IDEA:

File -> New Project -> Create project from scratch:

CreateRubyProjectInIDEA

Change here “Project files location” to the “C:\evejob\EvejobRoR”, select “Ruby Module” and press next (see screenshot above)

Now you need to specify the Ruby SDK (current version of IDEA can’t detect SDK locations from environment variables). Press “Configure…” button and press “+” button in “Configure JDK” window:

AddRubySDK

Select “Ruby SDK” in popup and than select Ruby interpreter path:

SetRubyPath

I Hope you will get something like this:

RubySDKAddedToIDEA

If so, just press “OK” and continue IDEA project creation Wizard:

ContinueRubyProjectCreationWizardInIDEA

Select “Ruby on Rails” on next screen and press “More…”  for Rails Facet configuration:

SelectRubyOnRailsTechnology

RailsFacetSettings

Make sure that you select “Use existing Rails application” and “Preconfigure for selected database” to “mysql” like (see picture above)

Now fill free to finish project creation Wizard. Done! We get EvejobRoR project loaded into IDEA.

Same steps we need to made for EvejobRoRG project, with small difference that this time we need to add JRuby SDK, instead of Ruby SDK like before and that we don’t want to support mysql as we are going to use Google App Engine API instead.

So, first type:

cd c:\evejob
rails EvejobRoRG

Then same like before, create new project in IDEA, put here “C:\evejob\EvejobRoRG” path and in “Specify the Ruby SDK” press “Configure…” and add JRuby SDK:

JRubySDKInIDEA

After made same steps like was done for EvejobRoR project, just make sure that you unselect “Preconfigure for selected database” check box in Rails Facet Settings dialog and process steps like before to finish Wizard.

Hopefully you get EvejobRoRG project opened in IDEA!

Prepare JRuby / Rails for Google App Engine

Google App Engine runs Java applications, so we need to make sure that we can assemble our JRails applications into a Java Web Archive (.war). To do such tasks easy, let’s first install “warbler” gem:

jruby -S gem install warbler

Now it is time to check that you add Java JDK path to windows PATH environment variable (because “warbler” gem use JDK):

JDKPathToPATHVariable

Next step, to run following commands from application root folder (c:\evejob\EvejobRoRG):

jruby -S warble pluginize
jruby -S warble config

(make sure you type “warble”, not “warbler” that is just Gem name)

Now you can just check that “Warbler” works:

jruby -S warble

As result you must see EvejobRoRG.war file generated in application root folder (c:\evejob\EvejobRoRG)

We can’t use this .war file directly for Google App Engine for few reasons, but at least we see that we can get some .war file :)

I specially not use all appengine-jruby project gems for few reasons:

  • google-appengine gem install own “tuned” version of JRuby that we want to avoid for reasons, for example for quick updates as we don’t want to depend on this special version of JRuby etc (means that project must be installed using Ruby, not JRuby! And only after installation it download and install customized, ‘frozen’ version of JRuby)
  • google-appengine helps to run JRuby on Google App Engine, but not to run Rails on Google App Engine ! :) All problems related to Rails on App Engine are still exists (read more at http://code.google.com/p/appengine-jruby/wiki/RunningRails)

But what I do use is one of the gems from appengine-ruby project – “appengine-apis”, so let’s install it:

jruby -S gem install appengine-apis

Read this for now to get more information about Rails and Google App Engine specific things:

http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/

http://www.railshacks.com/2009/4/25/run-your-ruby-on-rails-app-on-google-app-engine

We will get back to this later…

Evejob Development Environment Installation Part #1: Python, Django + AppEngine Installation
Oct 21st, 2009 by evereq

OK, let’s start installation of the development environment from Python + Django.

Here is step by step instructions:

1) Go to http://www.python.org/download/. Download 64 bit Python (if you use Windows 7 64 bit like me or other 64 bit OS) version 2.6.x (do not install version 3.x as Django not yet available for this Python version) – usually file have name like “python-2.6.x.amd64.msi”.
I recommend to change setup path to C:/Python, instead of C:/Python26

Python Download

2) Go to Control Panel\System and Security\System in Explorer. Than press “Advanced System Settings”. In System Properties window go to “Advanced” tab and press “Environment Variables” button. Here you need to add path to python in “System Variables”. Just found here “Path” and append “C:\Python”.

Add Path to Python

Note: I show here and will show in future ways how to finish tasks using windows GUI (if available), instead of command prompt commands (for example instead of usage of PATH command). Sure thing most of operations now can be done using command prompt, especially after introduction of PowerShell by Microsoft (it is build in to Windows 7 / Windows 2008 R2)

3) Go to command prompt (cmd.exe) and check that you can run actually Python by typing “python”.

Python

4) To grab latest source code from SVN repositories (for Django and other soft), let’s install now Subversion Client from http://www.collab.net/downloads/subversion/. I suggest to have this client even in case if you going to use TortoiseSVN. Why? Reason very simple – ones you study how to use it, you will know how to work with SVN in ANY OS, not only in Windows! It is exactly example, when better to use command prompt commands, instead of GUI like I recommend above – in such cases you will be familiar with command that runs on all kinds of operation systems!

CollabNet Subversion Command-Line Client vx.x.x (for Windows)

You can download installation after simple registration. Ones you install SVN client, go to command prompt and try to enter “svn” command. Hopefully you will get something like this:

SVN

4) I will use so called “development version” of Django. To install it you need to execute following command:

svn co http://code.djangoproject.com/svn/django/trunk/ C:\django-trunk

This will download latest source code for Django and save it in C:\django-trunk folder. Now it is time to setup PYTHONPATH variable (same way like in topic 2, but this time you need to create new variable, not just edit existed one!)

PythonPath

And before you leave Environment Variables, let’s add to the PATH variable location of Django bin folder (C:\django-trunk\django\bin):

DjangoAdminPath

Now it is time to check this setting:

TestDjangoAdminPy

Great Django installed!

One more simple step in installation of gettext-utils that used in Django translation system: go to the http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ and download latest  gettext-runtime-X.zip and gettext-tools-X.zip files. Extract content from bin folders of archives to c:\gettext-utils folder and add this path to PATH variable, same way like add before another locations (see details in topics above):

gettext

5) Now it is time to overview folders structure for project:

- C:\Evejob will be home directory for all source code for Evejob project

- C:\Evejob\EvejobDJ will be home directory for Django version of Evejob

- C:\Evejob\EvejobDJG will be home directory for Django + Google AppEngine version of Evejob.

Now, let’s run in command prompt following commands:

CreateEvejobDJProject

Let’s check that at least Django build-in web server works fine:

DjangoWebServerWorks

Please note: Django version can be different on your machine!

Open in browser http://127.0.0.1:8000 and make sure you see something like this:

FirstDjangoInBrowser

The same way, let’s create EvejobDJG Project that will be tuned up to work with Google AppEngine (all command like before, just EvejobDJG used instead of EvejobDJ):

CreateEvejobDJGProject

6) Django and AppEngine integration

Ok, now let’s install Google AppEngine SDK for Python available at http://code.google.com/intl/en/appengine/downloads.html#Google_App_Engine_SDK_for_Python

I assume that SDK will be installed in following folder: C:\Google\google_appengine\

Also we will need to install the Python for Windows extensions to enable automatic detection of the SDK. Be careful and download 64 bit version, for example pywin32-214.win-amd64-py2.6.exe if you use Windows 64 bit like me. Installation will automatically found your Python language, so if you download correct version of pywin, you will not get any problems during installation at all.

7) Today available few helpers (projects) that can help us create Django application that will be hosted on Google App Engine.

More specifically exists two: Google App Engine Helper for Django (http://code.google.com/p/google-app-engine-django) and App-Engine-Patch (http://code.google.com/p/app-engine-patch)

Each library have own features, but main difference that with App-Engine-Patch you have to use Google’s Model class, while with Google App Engine Helper you can use BaseModel class that appears the same as the standard Django Model class…

Here are some interesting articles related to Django and AppEngine combination:

http://code.google.com/appengine/articles/django.html

http://code.google.com/appengine/articles/appengine_helper_for_django.html

http://www.42topics.com/dumps/appengine/doc.html

http://www.42topics.com/dumps/django/docs.html

http://thomas.broxrost.com/2008/04/08/django-on-google-app-engine/

I will come back to this libraries later, ones finish with more simple EvejobDJ standard Django Model…

Evejob Development Environment Installation Part #6: .NET, C#, ASP.NET MVC and Azure Installation
Oct 21st, 2009 by evereq

.NET development Environment Installation

  • Download and install Microsoft SQL Server 2008 (any edition will fit, including Free Express)
  • Download and install Microsoft Visual Studio 2008 Standard, Professional or Team Edition (feel free to read about installation order in here)
  • Download and install service packs for SQL Server and for Visual Studio 2008 (at least SP1 required)
  • Download and install ASP.NET MVC 1.0
  • Download and install latest Azure SDK (make sure that Enable IIS7 with ASP.NET and WCF HTTP Activation – read more on here)

Creating EvejobNET Solution

Open Visual Studio, select “File / New Project” and fill form with following details (make sure you select ASP.NET MVC Web Application template):

EvejobNETSolutionCreate

Press “OK” and on next window “Create Unit Test Project”, select “Yes” and press OK:

SelectVisualStudioUnitTests

You will get solution loaded into Visual Studio with 2 projects: ASP.NET MVC Application (EvejobNET) and Unit Tests project (EvejobNET.Tests):

EvejobNETSolution

You can now try to run it, just press “Start Debuging” Button and make sure that you agree with action to “Modify the Web.config file to Enable Debugging”. Your default browser will open test site, hosted by development server (build in into Visual Studio).

Creating EvejobAzNET Azure Solution

Go to “File / New Project”, select “Cloud Service” template in New Project Window and fill project name and path like on following screenshot:

EvejobAzNetSolutionCreate

After you press “OK” you will need to select Roles to be added to solution. At the time I write this, there was no ASP.NET MVC role available, so let’s just temporary add ASP.NET Web Role (keep default name for now):

AddWebRole

After you press OK, solution will be opened with WebRole1 Project. Now it is time to remove “WebRole1″ temp project from solution (don’t forget to delete unused folder, with content, WebRole1 in C:\evejob\EvejobAzNET).

Next step is to add new ASP.NET MVC project: like was done above for EvejobNET project – just simply right click in solution explorer on “Solution ‘EvejobAzNET’” and select “Add New Project”, than select ASP.NET MVC Web Application Template and give this template name “EvejobAzNETMvcWebRole” to keep Azure standard naming convention.

One more step to finish – you need to associate role, so in solution explorer right click on “No project associated (WebRole1)” and select same like on screenshot:

AssociateProject

In opened window for association, make sure that you select “EvejobAzNETMvcWebRole” project:

AssociateWithRole

Your solution will looks like this now:

AzNetSolution

Now it’s time to test it – just press “Start Debugging”  in Visual Studio. Probably you will get following question (if everything going well):

DevelopmentStorageNeeds

Sure thing, correct answer “Yes” :) Ones it finished you will get another window that show “Development Storage Initialization” – just press “OK” button here and continue with execution.

You can get following popup also:

MicrosoftCloudToolsUpdates

I hope you answer yes, as probably you want to be sure that you use latest Tools available for Azure :)

Finally, your default browser probably opens with http://127.0.0.1:81/ Url and you will see “My MVC Application” :)

If so, that we just prepare everything to start EvejobAzNET development :)

Ah, one small note – you can check status in “Development Fabric” and in “Development Storage” – small icons are added to Windows taskbar – right click on each and select “Show …”:

DevelopmentFabric

DevelopmentStorage

Thats it!

»  Substance: WordPress   »  Style: Ahren Ahimsa
© Copyright 2008–2009 EvereQ.com All rights reserved.