Sharing Malevich installation

Malevich builds after 4/27/2009 support hosting multiple source code projects on the same installation.

Say, you have already deployed Malevich for your team. You used it, you liked it, and now you want to spread goodness to more teams within your organization. Malevich is light, and typical hardware can handle many users. Take my server for example. It is a stock Dell Optiplex box that sells for less than $1000. It hosts Malevich deployment that is used daily by 50 people, and the effect of having Malevich on it is not noticeable at all (I also use this box for great many other things).

So what if one would like to share his of her Malevich installation with other teams? Before now, one could do it as long as source control namespaces did not intersect. Malevich server does not really connect to source control - the files and the differences are always uploaded to its database by review client (review.exe). Potentially two teams could use the same database as long as change list numbers (or TFS shelf set names) were different: while Malevich does not rely on uniqueness of the change lists per se, querying for a specific change list using http://server/Malevich?cl=number query would fail if there are two change lists with the same number. Another disadvantage was that the aggregate views (All Reviews) would show all code reviews for both teams - something that could be inconvenient if the teams did not share anything in common other than the code review system.

This is why starting today Malevich supports better partitioning mechanism that allows multiple teams transparently share the same code review system without stepping on each other's toes.

How to host multiple teams on one Malevich box

Partitioning Malevich server is based on associating different application roots to different source control ids.

Every change list in Malevich has an index into SourceControl table. Normally, this table contains only one record which is created during the installation. Other than the id, the fields of this record are unused, but now another significant field was added: WebsiteName contains the web root of Malevich front-end.

If the SourceControl table contains only one record, and the WebsiteName is either null or '/Malevich', the system operates as it always did.

To add another team to existing server, create another record in the SourceControl table, and set its WebsiteName to an application path (in the database record it must start with '/': '/Malevich') which would expose front end for the team.

Then in IIS manager add another application with the same web root, pointing to the same directory where Malevich web site lives.

Finally, the environment on the client (where review.exe is run) should have REVIEW_INSTANCE variable set to the Id of the corresponding record in SourceControl table.

Example

For example, suppose you start with an existing, single-team installation of Malevich. This is how to convert the database to support two teams. Let's say that the original team ('Windows') would continue using http://server/Malevich for accessing code reviews, and the second team ('Office') would use http://server/CodeReview.
  1. Connect to the instance of SQL server hosting Malevich database using SQL Server Management Studio.
  2. Open new query window.
    1. use CodeReivew
    2. update SourceControl set WebsiteName = '/Malevich', Description = 'Source Control Server for Windows' where Id = 1
    3. insert into SourceControl (Type, Description, WebsiteName) values(1, 'Source Control Server for Office', '/CodeReivew')
  3. In Adminitrative Tools on the server open IIS Manager
  4. Navigate to the default web site, right click, Add Application
    1. In Alias, add CodeReview.
    2. In Physical Path, put the path to the already existing Malevich web site directory. Yes, two different apps can share the same directory for their code.
    3. Click OK.
    4. Click on the newly created application, and then double-click on Authentication.
    5. Ensure that Anonymous Impersonation is disabled, ASP.NET Authentication is enabled, and Windows Authentication is enabled.

The server is now set up, and the only thing left is for developers on the second team it add the environment variable REVIEW_INSTANCE=2 to their environment. Then the reviews they submit would be visible on http://server/CodeReview and the reviews that the developers on the original team submit would still go to http://server/Malevich.

How to upgrade

If you are starting with an existing installation the following systems need to be upgraded to deploy this functionality. The installer program should handle this for you if you are using an MSI built after 4/27/2009.
  1. Database
  2. Web site
  3. Notifier program (no reconfiguration, just copy the data. However, if you did customize the templates, replace Malevich in the website URL with {WebRoot}).

Last edited Apr 28, 2009 at 3:42 AM by SergeySolyanik, version 7

Comments

No comments yet.