Skip to content

Commit

Permalink
Split the cloud service into two services, backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Oct 15, 2013
1 parent 70d59b3 commit 029dff3
Show file tree
Hide file tree
Showing 10 changed files with 270 additions and 212 deletions.
9 changes: 8 additions & 1 deletion NuGetGallery.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.20919.2
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{96E4AFF8-D3A1-4102-ADCF-05F186F916A9}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -36,6 +36,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetGallery.FunctionalTest
EndProject
Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "NuGetGallery.Cloud", "src\NuGetGallery.Cloud\NuGetGallery.Cloud.ccproj", "{0041ACA0-30EC-4554-8C7C-0AF810F3086F}"
EndProject
Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "NuGetGallery.Backend.Cloud", "src\NuGetGallery.Backend.Cloud\NuGetGallery.Backend.Cloud.ccproj", "{1D0164B6-92D4-455A-AC68-C30B61733748}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -86,6 +88,10 @@ Global
{0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0041ACA0-30EC-4554-8C7C-0AF810F3086F}.Release|Any CPU.Build.0 = Release|Any CPU
{1D0164B6-92D4-455A-AC68-C30B61733748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D0164B6-92D4-455A-AC68-C30B61733748}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D0164B6-92D4-455A-AC68-C30B61733748}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D0164B6-92D4-455A-AC68-C30B61733748}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -96,6 +102,7 @@ Global
{0041ACA0-30EC-4554-8C7C-0AF810F3086F} = {05998089-58F5-4A84-8C11-C5C6244A6F89}
{7F92C174-5310-4090-A6A3-3CC7C67C19D6} = {B9B19787-DCC0-489E-9173-36A32C6B6848}
{4405C24C-7F57-4826-831F-D5D7E139F02E} = {B9B19787-DCC0-489E-9173-36A32C6B6848}
{1D0164B6-92D4-455A-AC68-C30B61733748} = {B9B19787-DCC0-489E-9173-36A32C6B6848}
{DBECF66B-8F2F-4B32-9143-E243BAFF12DF} = {2ECA1159-9B9D-4D65-95AF-F14337FD3DA6}
{F240D1BC-BBFB-4F22-9DF8-3FDE36BFD665} = {2ECA1159-9B9D-4D65-95AF-F14337FD3DA6}
EndGlobalSection
Expand Down
8 changes: 4 additions & 4 deletions build/NuGetGallery.Cloud.targets
@@ -1,11 +1,11 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)\NuGetGallery.tasks.targets" />
<Target Name="SetVMSize" BeforeTargets="PrepareForCsPack" DependsOnTargets="FindServiceDefinition" Condition="'$(WebRole_VMSize)' != ''">
<Message Text="Patching @(TargetServiceDefinition) to set VMSize to $(WebRole_VMSize)" />
<Target Name="SetVMSize" BeforeTargets="PrepareForCsPack" DependsOnTargets="FindServiceDefinition" Condition="'$(VMSize)' != ''">
<Message Text="Patching @(TargetServiceDefinition) to set VMSize to $(VMSize)" />
<XPathSetAttribute
XmlFiles="@(TargetServiceDefinition)"
XPath="/csdef:ServiceDefinition/csdef:WebRole/@vmsize"
XPath="/csdef:ServiceDefinition/csdef:WebRole/@vmsize | /csdef:ServiceDefinition/csdef:WorkerRole/@vmsize"
Namespaces="csdef=http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"
Value="$(WebRole_VMSize)" />
Value="$(VMSize)" />
</Target>
</Project>
63 changes: 63 additions & 0 deletions src/NuGetGallery.Backend.Cloud/NuGetGallery.Backend.Cloud.ccproj
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>2.1</ProductVersion>
<ProjectGuid>1d0164b6-92d4-455a-ac68-c30b61733748</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NuGetGallery.Backend.Cloud</RootNamespace>
<AssemblyName>NuGetGallery.Backend.Cloud</AssemblyName>
<StartDevelopmentStorage>True</StartDevelopmentStorage>
<Name>NuGetGallery.Backend.Cloud</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NuGetGallery.Backend\NuGetGallery.Backend.csproj">
<Name>NuGetGallery.Backend</Name>
<Project>{7F92C174-5310-4090-A6A3-3CC7C67C19D6}</Project>
<Private>True</Private>
<RoleType>Worker</RoleType>
<RoleName>NuGetGallery.Backend</RoleName>
<UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
</ProjectReference>
</ItemGroup>
<!-- Items for the project -->
<ItemGroup>
<ServiceDefinition Include="ServiceDefinition.csdef" />
<ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" />
</ItemGroup>
<ItemGroup>
<Folder Include="NuGetGallery.BackendContent\" />
</ItemGroup>
<ItemGroup>
<Content Include="NuGetGallery.BackendContent\diagnostics.wadcfg">
<SubType>Content</SubType>
</Content>
</ItemGroup>
<!-- Import the target files for this project template -->
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.1\</CloudExtensionsDir>
</PropertyGroup>
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
<Import Project="$(MSBuildProjectDirectory)\..\..\build\NuGetGallery.Cloud.targets" />
</Project>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs bufferQuotaInMB="128" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<Directories bufferQuotaInMB="512" scheduledTransferPeriod="PT1M">
<CrashDumps container="wad-crash-dumps" directoryQuotaInMB="256" />
<DataSources>
<DirectoryConfiguration container="wad-joblogs" directoryQuotaInMB="256">
<Absolute path="[Logs]\Jobs" expandEnvironment="false" />
</DirectoryConfiguration>
<DirectoryConfiguration container="wad-hostlogs" directoryQuotaInMB="256">
<Absolute path="[Logs]\Host" expandEnvironment="false" />
</DirectoryConfiguration>
</DataSources>
</Directories>
<Logs bufferQuotaInMB="512" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error" />
<PerformanceCounters bufferQuotaInMB="512">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\.NET CLR Jit(_Global_)\% Time in Jit" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\.NET CLR Loading(_Global_)\% Time Loading" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\.NET CLR LocksAndThreads(_Global_)\Contention Rate / sec" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\.NET CLR Memory(_Global_)\# Bytes in all Heaps" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\.NET CLR Networking(_Global_)\Connections Established" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\Memory\Committed Bytes" sampleRate="PT1S" />
<PerformanceCounterConfiguration counterSpecifier="\Memory\Private Bytes" sampleRate="PT1S" />
</PerformanceCounters>
<WindowsEventLog bufferQuotaInMB="512" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Error">
<DataSource name="System!*" />
</WindowsEventLog>
</DiagnosticMonitorConfiguration>
38 changes: 38 additions & 0 deletions src/NuGetGallery.Backend.Cloud/ServiceConfiguration.Local.cscfg
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="NuGetGallery.Backend.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="NuGetGallery.Backend">
<Instances count="1" />
<ConfigurationSettings>
<!-- ******************* -->
<!-- DEPLOYMENT SPECIFIC -->
<!-- ******************* -->
<!-- These should change on every deployment (to rotate credentials, etc.) -->
<Setting name="Operations.Sql.Primary" value="Data Source=(LocalDB)\v11.0;Initial Catalog=NuGetGallery;Integrated Security=SSPI" />
<Setting name="Operations.Sql.Warehouse" value="" />
<Setting name="Operations.Storage.Primary" value="UseDevelopmentStorage=true" />
<Setting name="Operations.Storage.Backup" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="MIIBnQYJKoZIhvcNAQcDoIIBjjCCAYoCAQAxggFOMIIBSgIBADAyMB4xHDAaBgNVBAMME1dpbmRvd3MgQXp1cmUgVG9vbHMCEG870pHsz0GPRZ18ZHEVMyMwDQYJKoZIhvcNAQEBBQAEggEABCvdlx/fjNaMh+I4tdArjlmC/KhsVISFYKP+Tppd4LJM4J67FUcgSnnZLp/fII7gvd0X7XHRjV9a9gTj15b3lexRXp36oDLiRpw9Ld0EbxNMB1CBPNDqYRlV8iZBLeER3KOq7b+6iUywx1TWRf3UtaIZYI1BU6XJXWlKKartrKFl7g1MV6T506xN5a2m+r9Wi9dTApOYx3mBl1ZICDPTQX5dMWP6aRslapdOcyp+cMAgNjdE0TW0jw5eVEY0m3PqxuSSI99xtXLcVYrz6H7K3C8lNoxR9BlL89XOBh2VGsrsNeDF80cwuZkLYkqL3koehilh6b+iIC74yjcNboPRajAzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECCGRjuJpsHCYgBDKJqr9G6xa5kT1yQHFHx5Y" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2014-10-12T23:59:59.0000000-07:00" />
<!-- ******************** -->
<!-- ENVIRONMENT SPECIFIC -->
<!-- ******************** -->
<!-- These only need to change when defining a new environment -->
<Setting name="Operations.EnvironmentName" value="" />
<Setting name="Operations.SqlDac" value="" />
<!-- *************** -->
<!-- STABLE SETTINGS -->
<!-- *************** -->
<!-- Depending on your policy, these likely do not need to vary -->
<Setting name="Operations.LicenseReport.Service" value="" />
<Setting name="Operations.LicenseReport.User" value="" />
<Setting name="Operations.LicenseReport.Password" value="" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="nuget" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
<Certificates>
<!-- Totally bogus set of Hex digits that get replaced by the actual thumbprints when generating a CSCFG -->
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="D2CA3A778E08936DD4C61E2734158B0044831010" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
</ServiceConfiguration>
23 changes: 23 additions & 0 deletions src/NuGetGallery.Backend.Cloud/ServiceDefinition.csdef
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="NuGetGallery.Backend.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WorkerRole name="NuGetGallery.Backend" vmsize="Medium">
<ConfigurationSettings>
<Setting name="Operations.EnvironmentName" />
<Setting name="Operations.Sql.Primary" />
<Setting name="Operations.Sql.Warehouse" />
<Setting name="Operations.Storage.Primary" />
<Setting name="Operations.Storage.Backup" />
<Setting name="Operations.SqlDac" />
<Setting name="Operations.LicenseReport.Service" />
<Setting name="Operations.LicenseReport.User" />
<Setting name="Operations.LicenseReport.Password" />
</ConfigurationSettings>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="Logs" cleanOnRoleRecycle="false" sizeInMB="2048" />
</LocalResources>
</WorkerRole>
</ServiceDefinition>

This file was deleted.

12 changes: 0 additions & 12 deletions src/NuGetGallery.Cloud/NuGetGallery.Cloud.ccproj
Expand Up @@ -36,14 +36,6 @@
<ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NuGetGallery.Backend\NuGetGallery.Backend.csproj">
<Name>NuGetGallery.Backend</Name>
<Project>{7f92c174-5310-4090-a6a3-3cc7c67c19d6}</Project>
<Private>True</Private>
<RoleType>Worker</RoleType>
<RoleName>NuGetGallery.Backend</RoleName>
<UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
</ProjectReference>
<ProjectReference Include="..\NuGetGallery\NuGetGallery.csproj">
<Name>NuGetGallery</Name>
<Project>{1dacf781-5cd0-4123-8bac-cd385d864be5}</Project>
Expand All @@ -54,14 +46,10 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="NuGetGallery.BackendContent\" />
<Folder Include="NuGetGalleryContent\" />
<Folder Include="NuGetGalleryContent\bin" />
</ItemGroup>
<ItemGroup>
<Content Include="NuGetGallery.BackendContent\diagnostics.wadcfg">
<SubType>Content</SubType>
</Content>
<Content Include="NuGetGalleryContent\bin\Startup.cmd">
<SubType>Content</SubType>
</Content>
Expand Down

0 comments on commit 029dff3

Please sign in to comment.