Tuesday, 19 October 2010

Announcing OpenSpaceBeers, the open-space for all developers, whatever the platform

We’ve been running open-spaces for a while. It’s now time to build something new, and something that will hopefully benefit all communities.

OpenSpaceBeers are open-space monthly events, where the beer flows, the ideas fuse and the right questions get asked to all developers interested in contributing. It doesn’t matter if you’re .net, java, python, php, coldfusion, ruby, scala or basic. We all face the same issues, and there’s a lot of sharing to do.

A developer is a developer, whatever platform they’re on.

First OpenSpaceBeers is next Tuesday, 26th of October. Tickets are going to be released as follow. They will all be open at random times during the day.

  • Round 1: Today, 19th of October, 1PM
  • Round 2: 21st of October, 3PM
  • Round 3: 23rd of October, 6PM
  • Last chance: 25th of October, 9M.

Come and enjoy the best regular developer-focused event, in a relaxed pub environment.

Register on EventBrite now.

Thursday, 9 September 2010

Seb does Australia

I've been wanting to do it for a long while, and now seems like the right time to be planning. If you are in Australia, New Zealand, Tokyo, Singapore and can host me for an evening or a couple of days of training on ReST, nhibernate, distributed architectures, package management, software practices or just want me to hang around, please send me an email at seb@serialseb.com The more of you show an interest, the longer I'll stay. Let me know.

Tuesday, 17 August 2010

OpenWrap late changes and release date

I’ve delayed slightly the tutorial on Part 2, as ready or not, I’m pushing binaries and the server online on the 26th of August. Call it a first preview. Delays are due to my really wanting some features that I didn’t think we would have for a first release, but I think it’s worth it, and is due to my frustration in having to deal with all the mechanics of building OpenWrap and it’s server itself.

Expect the second part of the guide sometime this week.

Monday, 2 August 2010

OpenWrap’s view on versioning

There has been a bunch of questions regarding the differences between CoApp and OpenWrap when it comes to versioning. If you follow the blogs and that project, you know that they are planning to install everything in the GAC whenever packages are installed, and require everything to be Authenticode signed.

OpenWrap takes the opposite view, and discourages strong-naming your assemblies. The reason is very simple: in .net, whenever you update an assembly to a newer version, as long as the assembly is not strong-named, the assembly version is blissfully ignored, which lets people swap the dll around as and when needed, when there’s a fix / update available.

The only way to not break project references when packages are updated would be to never update the AssemblyVersion in an assembly, rendering the versioning scheme useless.

The alternative is to create policy redirections as part of the deployment to the GAC of a strong-named assembly, or for the consumer to add those redirections manually in each of their projects. Either way, it’s either a huge burden on publishers (and people don’t bother), or on the consumers (and people get angry). Either way, we’re still in unhappy land.

All this versioning is not needed, for the simple reason that OpenWrap has its own versioning scheme, per package, providing you with many more features than the 1-1 coupling provided by strong-named assemblies.

And finally, last but not least… If like me you believe very strongly in xcopy-friendly development and deployment, the GAC breaks all this: you now require the assemblies to be GAC’d on your build server and locally before you can use them, as otherwise any odd version already installed on the system would take over. And there lays the major pain point, the GAC takes over from your local references and there is *nothing* you can do about it.

As the goal of OpenWrap is to enable rapid development and update of packages, strong-naming assemblies and GAC’ing them is diametrically opposite to the vision of the tool, and as such will be discouraged. I’ll even put a big fat red warning if you take a dependency on a package that has assemblies already in the GAC, offering you in one swoop the option of removing them interactively. I may even provide the option to automatically strip out strong-naming from assemblies you try to package.

Help yourself and help versioning, say no to the GAC. If you do have scenarios where you believe strong-naming is the right solution, please leave a comment and we can discuss it.

[Note: Strong-naming has nothing to do with signing. Signing assembly code with a certificate is not useful to reduce malware (I don’t see how it would), and it pauses the risk of the certificate revocation being checked before being ran. But it has nothing to do with the key signing used in strong-naming, it’s a different process.]

Adding OpenWrap to an existing project (Part 1)

I’m continuing writing up teaser posts on how to use OpenWrap. Building a new office has taken away my Sunday, so the server is still not up, and the code unfinished. A few more days and we’ll be there.

In the meantime, assuming you have OpenWrap installed, here’s how to convert an existing asp.net site (here an OpenRasta site running on top of asp.net) to OpenWrap.

From a default project…

Here’s the layout of my project.

PS C:\src\caff\git\openwrap-server> tree
Folder PATH listing for volume BOOTCAMP
Volume serial number is 60DA-D801
C:.
└───src
    └───OpenWrap.Server
        ├───App_Data
        ├───Handlers
        ├───Properties
        ├───Resources
        └───Views

First step is to add a wrap descriptor file and a version file that will be used to build the package.

PS C:\src\caff\git\openwrap-server> "Description: an openwrap server implementation based on OpenRasta." | ac openwrap-server.wrapdesc
PS C:\src\caff\git\openwrap-server> "1.0.0" | ac version

And finally, we want to create a project repository in which openwrap packages will be stored so OpenWrap can know where to put those. We can do this by creating a wraps folder.

PS C:\src\caff\git\openwrap-server> md wraps | out-null; tree
Folder PATH listing for volume BOOTCAMP
Volume serial number is 60DA-D801
C:.
├───src
│   └───OpenWrap.Server
│       ├───App_Data
│       ├───Handlers
│       ├───Properties
│       ├───Resources
│       └───Views
└───wraps

Adding OpenWrap to the project

Time to add OpenWrap to our project, which will add the necessary instruction to our wrap descriptor and all needed files.

PS C:\src\caff\git\openwrap-server> o add-wrap openwrap
# OpenWrap v1.0.0.0 ['C:\Users\sebastien.lambla\AppData\Local\OpenWrap\wraps\_cache\openwrap-1.0.0.13979169']
No wrap descriptor found, installing locally.
Project repository found.
Dependency added to descriptor.
Copying 'openwrap-1.0.0.13979169' to 'Project repository'
Expanding packages to cache...
PS C:\src\caff\git\openwrap-server> tree
Folder PATH listing for volume BOOTCAMP
Volume serial number is 60DA-D801
C:.
├───src
│   └───OpenWrap.Server
│       ├───App_Data
│       ├───Handlers
│       ├───Properties
│       ├───Resources
│       └───Views
└───wraps
    ├───openwrap
    │   ├───bin-net35
    │   ├───build
    │   └───commands
    └───_cache
        └───openwrap-1.0.0.13979169
            ├───bin-net35
            ├───build
            └───commands

Couple of interesting notes. First, you can see that the o.exe tool redirects all calls to the last version of the OpenWrap pacakge on the system.

Secondly, the wrap decriptor now contains the line depends: openwrap.

A folder structure…

Let’s examine what files are actually in this wraps folder that now exists:

 

└───wraps
    │   openwrap-1.0.0.13979169.wrap
    │
    ├───openwrap
    │   │   openwrap-1.0.0.13979169.wrapdesc
    │   │   version
    │   │
    │   ├───bin-net35
    │   │       ICSharpCode.SharpZipLib.dll
    │   │       OpenFileSystem.dll
    │   │       OpenRasta.Client.dll
    │   │       OpenWrap.dll
    │   │
    │   ├───build
    │   │       OpenWrap.Build.Tasks.dll
    │   │       OpenWrap.CSharp.targets
    │   │       OpenWrap.Resharper.dll
    │   │       OpenWrap.tasks
    │   │
    │   └───commands
    │           OpenWrap.Commands.dll
    │
    └───_cache
        └───openwrap-1.0.0.13979169
            │   openwrap-1.0.0.13979169.wrapdesc
            │   version
            │
            ├───bin-net35
            │       ICSharpCode.SharpZipLib.dll
            │       OpenFileSystem.dll
            │       OpenRasta.Client.dll
            │       OpenWrap.dll
            │
            ├───build
            │       OpenWrap.Build.Tasks.dll
            │       OpenWrap.CSharp.targets
            │       OpenWrap.Resharper.dll
            │       OpenWrap.tasks
            │
            └───commands
                    OpenWrap.Commands.dll

There are a couple of interesting things happening. First, the wrap package itself got copied over in the wraps folder. The goal here is for you to always commit those dependencies as part of your project in source-control. Second, you’ll notice that the content of this file is uncompressed in the _cache folder. This one should always be part of your ignores, as you really don’t want to be committing the zip file *and* the content.

Finally,you’ll notice there’s also an openwrap folder that has the same content as the _cache/openwrap-1.0.0.13979169 folder. Lets look more closely.

PS C:\src\caff\git\openwrap-server> ls wraps

Mode           LastWriteTime       Length Name
----           -------------       ------ ----
d----    02/08/2010    01:23   <JUNCTION> openwrap [C:\src\caff\git\openwrap-server\wraps\_cache\openwrap-1.0.0.13979169]

Indeed, this folder is not a real folder but a junction to the latest version. This linking is only done for pacakges that are anchored. So why do we have this?

In an ideal world, everything would use OpenWrap for finding stuff, and the latest version for a project would always be selected. But we live in a world full of dragons and daemons that require a bit more of a stable path. As OpenWrap hooks in MSBuild (we’ll see how in the next post), it’s important that the msbuild files are in a reasonably stable location. It’s also important that OpenWrap is available the first time you checkout your files, so a build can happen instantly.

Folder structure

You may notice that packages contain multiple folders (which are called an export in OpenWrap). The bin-Xxx are the ones in which assemblies needed for referencing in a project are contained. Each .net framework profile has its own identifiers, and the resolution algorithm uses those identifiers to decide what assembly to load. If you’re on .net 3.5, the probing will go bin-net35, bin-net30, and bin-net20, and will fail when it cannot resolve assemblies.

There are a couple more exports in the package: commands contain all the commands you can execute from the command-line (or from any host that can execute those commands, currently only the command line), and build contains all msbuild-related extensibility points (which I really hope to manage to import automatically further down the road).

Conclusion

So, there you have it, in a few seconds we installed OpenWrap in the solution. Next up, we’ll hook-up our project by changing a line in an MSBuild file.

The initial OpenWrap installation

Going down OpenWrap’s rabbit hole, the first thing you do is retrieve a fresh copy of o.exe, the Command shell. At a whopping 32k (for the debug build), you could get the initial file in 234 text messages. Lets open the file straight from the web site, and we’re greeted by installation options.

The OpenWrap shell is not installed on this machine. Do you want to:
(i) install the shell and make it available on the path?
(c) use the current executable location and make it available on the path?
(n) do nothing?

I think the options are quite self-explanatory, but let’s recap:

  • (i) will copy o.exe to ~/AppData/Local/OpenWrap/ and add this path to your PATH environment variable for the current user
  • (c) will simply add an o.exe.link file in ~/AppData/Local/OpenWrap/ and add this path to your PATH
  • (n) will do nothing this time around and run o.exe as normal.

Let’s choose the first option

OpenWrap packages not found. Attempting download.
Downloading http://wraps.openwrap.org/bootstrap [....................]
Downloading http://wraps.openwrap.org/wraps/openwrap-1.0.0.13979169.wrap [.............]
Expanding pacakge...
# OpenWrap v1.0.0.0 ['C:\Users\sebastien.lambla\AppData\Local\OpenWrap\wraps\_cache\openwrap-1.0.0.13979169']
Command was not understood. Type 'help' to get a list of supported commands.

I do hope that this is also quite self-explanatory, but just in case… When the shell tries to execute the first time, it will not find the OpenWrap packages anywhere. At that stage, it will go to the openwrap web-site and download the bootstrap packages to the correct location, which is just a list of URIs to download in a text file.

Once all this is done (and notice the wonderful typo in the output, you can check on github that this is all live code), the shell can now delegate to the openwrap code itself to parse the command. And as there was no command (remember, we started the application from a web browser), the system tells us that the command was not understood.

I tried to make it more complicated but I just didn’t have the time.

Saturday, 31 July 2010

The future of OpenRasta

You may have noticed that development on OpenRasta has slowed down quite a bit recently. It’s a double-edge sword: the codebase is stable enough for most people, which has helped adoption of the 2.0 branch quite a bit, but at the same time there are new features that I want to see implemented.

As you probably know, I’m putting most of my energy on OpenWrap until we have a fully functioning first beta release, because I want the next version of OpenRasta to be completely built on top of it. So what is the future of OpenRasta?

OpenRasta 2.0 RTM coming to a shop near you soon

The current branch on github is going to be enhanced slightly by the addition of a few fixes / features that will close the loop for a 2.0 release:

  • Http header processing will special-case our friend Set-Cookie, which will solve a bunch of issues people have been reported when trying to use those evil babies.
  • The diagnostics output is going to be made a bit nicer by actually showing the log on the web page itself rather than the dreaded “There was an error in a contributor”.
  • I’ll pull in the fixes requested by those that want to use the binder to do constructor value injection.
  • We’ll put the nice logo we’ve had and not used for so long.

That’s it. This should happen in the next week or so.

OpenRasta 3.0

I’ve decided to rename 2.1 in 3.0, for the simple reason that I’m going to move stuff around quite a bit, all driven by my need for better componentisation of the codebase, most of it driven by OpenWrap. I’m not ready to discuss the feature-set yet, but August will be the big development push on the first iteration. Expect a lot of splitting of code, of re-evaluation of some features that are not as much in use as I’d like, and hopefully a lot of bug fixes in the process.

In the meantime…

In the meantime, you may as well get yourself acquainted with OpenWrap, because it will be mandatory for OpenRasta 3.0.

I’d also like to thank Hadi and the codebetter guys, as our bug tracking has now moved to youtrack on codebetter.com, at http://youtrack.codebetter.com/issues/OR. Let me know what you think of the new system.

Thursday, 29 July 2010

ReSharper 5 incompatible with OpenRasta...

Let's do a social engineering experiment. You see, ReSharper has been ignoring pageParserFilter code in asp.net (the thing asp.net MVC and OpenRasta use to enable you to use the C# syntax in your Inherits attribute in asp.net pages) for what feels like forever.

Before the 5.x release, it was still working fine (call it a feature by accident), recognizing the type and enabling full intellisense. Behavior has changed, first by marking everything as an error (in 5.0), and now by compeltley ignoring the base type (5.1). The only reason MVC works is because they special-cased that codebasae, but not OpenRasta's one.

Let's all help JetBrains do the right thing and ask them to re-enable OpenRasta support through a hotfix of their current versions, by voting on this issue: http://youtrack.jetbrains.net/issue/RSRP-92986

In the meantime, you should be able to get by by specifying the old ResourceView`1 syntax in your Inherit clause, or just do like me and don't switch to version 5 just yet.

Saturday, 24 July 2010

An intro to what OpenWrap is

I vowed not to come out too early with loud propaganda on what OpenWrap is, but many have told me that they want to see it happen now rather than together with a beta, and I’ve been coding away for long enough that the code may be of interest to some. So, without further do, I announce my latest venture in world OSS domination called OpenWrap.

What’s OpenWrap

OpenWrap is currently classified as a package management system. In reality, it’s an export management system. The reason for OpenWrap existing is to deliver stuff to whatever environment is needing it, be it at development time within Visual Studio, at deployment time when pushing an OpenRasta or MVC web-site, or at run-time for a rich client.

What’s Stuff?

An application is usually made of a bunch of stuff. Some are components, some are static files, some are executable tools, and some may be an energy pattern that needs to go from point A to point B.

OpenWrap is a simple packaging format that deals with separating those stuff things into exports. An export is whatever you want, and only the consumer of an export need to know and understand a certain kind of export.

An example of exports: assembly references and build files

One of the many exports that everyone is focusing on at the moment is binary assembly distribution. You want to easily add a component built by someone else, without the hassle of having to download binaries and all their dependency hell yourself. I hear you! While projects like horn have attempted to take away some of the pain by automating cross-trunk version building, the lack of binary distribution and versioning has made using the tool a hit-or-miss, because of the nature of how open-source software is built more than because of what horn is.

So, in OpenWrap, you can use the OpenWrap shell, called o.exe, to issue a bunch of commands. So if you want a reference to nhibernate, you’d do

o add-wrap nhibernate

OpenWrap will try and find the package called nhiberante, and all the packages it depends on, and install them in your system repository. At build time, each package you depend on will automatically get its references added to your project. There’s even a ReSharper plug-in to make it real-time.

In your package, which happens to be a simple zip file, each dll present in the /bin-netXXX folder will be automatically resolved. Why the XXX? Because in OpenWrap, the binary exports are dependent on the version of .net you’re running under. That means that if you run under .net 2.0, you’ll get all the DLLs present in /bin-net20, but if you’re under .net 3.5, you’ll get the ones in /bin-net35.

Want to provide architecture-dependent code? Just put the same dll and the same API in both /bin-x86-net20 and /bin-x64-net20, and OpenWrap will figure out which of the versions to use.

Another example of exports: commands

In OpenWrap, commands are also a type of export, that live in /commands. Want to provide command-line commands to execute as part of your project? As long as your package is present in a solution, all of the commands you create will be available from the command-line. XCopy command-line extensibility is the feature used by openwrap itself to execute its own commands, so you have the guarantee that only the version of OpenWrap (and other packages) you have in your project repository will be the ones executed when you are running the shell.

The sky is the limit

Of course, package exports are extensible, so if you want for your project a custom export, or if you feel (like me) that web applications should share a same export for things like jQuery, then you can integrate yourself with that and make it your own.

Repositories

There’s a few repositories in OpenWrap. The System repository is the one living in your /Users/UserName/AppData/Local/OpenWrap/wraps folder. Anytime you execute an OpenWrap command anywhere that’s not an OpenWrap folder, it will come from your system repository.

As you may have guessed by now, each of your projects will also have its own repository. You can consider that an equivalent to your vendors folder in Rails. In each of your projects, all exports (commands, assemblies etc) come from your project repository first.

And of course, multiple repositories can exist. The repository at http://wraps.openwrap.org is maintained by myself, and you should be able to upload your own packages there very soon. If you want to add your own repository, the openwrap-server will provide you with a full-fledged repository you can install locally. You then only need to issue a o add-remote myRepository http://myRepository.com command to add your own.

Versioning

Whenever you execute the o add-wrap xxx command in a project, a line will be added to your descriptor file. This file is the description of what your application does, what other packages it depends on and what versions it needs to execute. The end-result in your file would add a line. Here’s a typical package descriptor, to give you a sense of what things look like. (note the syntax is slightly different than what is on the wiki, those changes are coming up on github in the next few days as we ramp up for release).

openbong.wrapdesc

Depends: nhibernate >= 2.0.0 and < 3.0 Depends: openfilesystem = 1.0.0 Description: A wiki system based on the textile language and using GIT as a repository.

Versions are very simple, you decide what your package is compatible for. When it comes to dependencies, only [Major[.Minor[.Build]]] are taken into account. If you add the fourth number, the revision, openwrap will always update the package to the latest revision.

Of course, you can update all packages in one go automatically by doing o update-wrap. This will update the project repository to the latest compatible version of packages, as described in your wrap descriptor file.

Building

One of the things I don’t want to address just yet is building packages. There’s an MSBuild task that makes building the zip files easier, but I don’t want to go down the route Horn got and turn a dependency manager into dependency hell. So for now, people are expected to build their own zip files. It’s only temporary however, as I do expect in the next few versions for OpenWrap to not be built from a build script anymore, which may end up being the default convention. Who knows? For now, OpenWrap integrates itself in your existing projects by replacing the target import by openwrap’s one.

Installing…

I’ve not put up binary releases just yet, but when they are made available (or if you build it yourself), the shell is able to automatically install itself and retrieve the latest version of packages that it needs to run. That means that the installer is 35kb. You shouldn’t have much difficulty downloading o.exe and running with it very quickly.

Going forward

There’s a lot more to OpenWrap so far, from anchoring to the build system, but this is enough of an intro to give you a taste of what I’ve been up to for a few months.

Bar one piece of functionality on the client, which I’m in the middle of changing around (anchoring, a blog post at some point will explain what that is), we’re nearly ready for a first beta release.

Want to contribute? The site is at http://github.com/openrasta/openwrap. While it’s under the OpenRasta brand, the project is stand-alone, and I will be managing OpenWrap as an independent tool. I will however base any further OpenRasta developments on it.

I know there has been recently a lot of noise from many parties in the package management space. The only thing I can tell you is that I’m fully committed to bringing OpenWrap in the hands of developers as quickly as possible. It’s a different approach to a complicated problem, and I think it’s hitting a damn nice spot even if I may say so myself. I’ll post in a few days the first binaries (when the server is up) so you can start playing with it, open accounts and start publishing your own wraps. After that, there’s a lot of work to do to enable testing, documentation and many other scenarios.

One last word

If I was to request one last thing from you, reader, it would be the following. Package management is going to be the next Vietnam war on .net, and many people will come up with different solutions. It’s all for the best, and most projects, as they have done many times before, will die off on their own. This is to be expected. As such, I implore the .net world to let enough time for each of those projects to compete purely on the quality and functionality they provide, and let the best one eliminate naturally the other ones. Don’t succumb to the belief that standardizing early will help, or that popularity would be a distinctive factor. If we fuck-up the package management story on .net, we may never recover, so give it a bit of time and be circumspect in your analysis.

And don’t forget, my project got a cooler name anyway.

:)

Wednesday, 19 May 2010

Why I haven’t blogged about OpenWrap yet.

Because it’s not ready and I haven’t announced it yet.

I showed the state of the code-base at the progressive.net workshop, to gather feedback from smart people. There was good feedback, and the latest architectural change happened the night before, so I’m still coding.

I’m doing it in the open, you can have a look at the code but I won’t link to it.

But please, please, to some of you, get off my back! If you think your package manager is better, good, I’m glad you found a tool you like.  If you think the project is a bad idea because yours is better, please commit some code and show us the money.

Until I’ve officially announced the project, I’d be quite happy not dealing with all the negativity that has come my way since Rob’s post.

Kthxbye.

Tuesday, 18 May 2010

Chuck Norris doesn’t follow people, he is the follow process

image

Saturday, 3 April 2010

OpenRasta needs an msdn license

I don’t usually use this blog for requesting help, but I’m afraid on this one I have to.

I don’t have access to an MSDN license anymore, as the cost is too high, I’m not an MVP and the ActionPack works for my professional needs. Except it doesn’t work so well with OpenRasta.

With the upcoming Visual Studio release, and the new OSs out there, I’m out of licenses to continue testing OpenRasta on all those platforms.

So, my friends, the communnity, I’m turning to you. Do you have a spare MSDN license somewhere? Do you know someone at a vendor happy to provide such a license? Maybe even Microsoft? Now is the time to help OpenRasta!

Email openrasta-inneed@serialseb.com with your suggestions! Thanks!

Tuesday, 30 March 2010

OpenSource on .net at Microsoft TechDays

Register now at http://techdays-oss.eventbrite.com/

The .net ecosystem is rich in open-source solutions that many have already adopted as part of their business-sensitive toolkit. Come and listen about open-source web frameworks, object-relational mapping tools and other must-have frameworks the .net community has produced over the years, by the most prominent figures of the UK developer community.

Come and enjoy free food and drinks and listen to experts present you the best of breed of open-source software for Microsoft platforms.

Current program:

  • OpenRasta - A web application framework for .net

  • An introduction to IoC with Castle Windsor

  • FluentValidation, doing your validation in code

  • CouchDB, NoSQL: designing document databases

  • Testing your asp.net applications with IronRuby

  • Building a data-driven app in 15 minutes with FluentNHibernate

Thursday, 4 February 2010

Announcing the “20 days to OpenRasta” project

As some of you already know, I’m very excited that OpenRasta is being presented at Mix10 in Vegas by none other than the talented Kyle Baley. As I’ve not realised the 2.0 RTM bits yet, I thought it’d be great if we could release a fresh 2.0 RTM build for the occasion.

This is a call to action to the users, adorers and believers: OpenRasta needs you!

In the next 20 days, starting from this Friday, let’s try and all commit some of our time to OpenRasta in one way or another. There’s a lot to be done and focused on, from the new web site, to updates to the code base, to enhancing the documentation.

To participate, just join the mailing list, find something interesting you’d like to be doing, and commit to work on it on a certain day.

On top of that, from this weekend, I’ll be organizing a code-a-thon on either day, with anyone that cares to join me for a day of pure pair programming coding on some of the OpenRasta code-base. Want to see extensible authentication done? Donate your day, we’ll have coffee and lunch and lots of code! Not in London? We’ll use Skype. No excuse!

As for me, I hereby promise to start posting a videocast a day for 20 days. Provided we have somewhere to host the videos and someone can help out with the encoding!

I’ll update this post with all the commitments that were made to help get a new release out of the door in time for Mix.