Beispiel #1
0
        public async Task TestThatDiffentAppsCanUpdateIndependently()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession("app1"));
            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("clusterId1", "instanceId2", "2");

            Assert.True(await otherUpdateSessionManager.TryStartUpdateSession("app2"));
        }
 public UpdateSessionManagerRetryDecorator(IUpdateSessionManager updateSessionManager,
                                           RetryStrategy retryStrategy,
                                           ITransientErrorDetectionStrategy errorDetectionStrategy)
 {
     _updateSessionManager = updateSessionManager;
     _retryPolicy          = new RetryPolicy(errorDetectionStrategy, retryStrategy);
 }
Beispiel #3
0
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository,
                     IDeploymentStatusWriter deploymentStatusWriter,
                     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, deploymentStatusWriter,
                                updateSessionManager).Build();
 }
        public async Task TestThatOnlyOneUpdateDomainCanUpdateAtATime()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession());
            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("superClusterId", "instanceId2", "2");

            Assert.False(await otherUpdateSessionManager.TryStartUpdateSession());
        }
Beispiel #5
0
 public StartUpdateSessionRetryDecorator(IUpdateSessionManager updateSessionManager, int retryCount,
                                         TimeSpan retryInterval)
 {
     _updateSessionManager = updateSessionManager;
     _retryCount           = retryCount;
     _retryInterval        = retryInterval;
 }
 public UpdateSessionManagerRetryDecorator(IUpdateSessionManager updateSessionManager,
     RetryStrategy retryStrategy,
     ITransientErrorDetectionStrategy errorDetectionStrategy)
 {
     _updateSessionManager = updateSessionManager;
     _retryPolicy = new RetryPolicy(errorDetectionStrategy, retryStrategy);
 }
Beispiel #7
0
 public ApplicationInstaller(string applicationsRootPath, IUpdateSessionManager updateSessionManager, IApplicationFactory applicationFactory,
                             IApplicationPool applicationPool)
 {
     _applicationsRootPath = applicationsRootPath;
     _updateSessionManager = updateSessionManager;
     _applicationFactory   = applicationFactory;
     _applicationPool      = applicationPool;
 }
Beispiel #8
0
 public ApplicationInstaller(string applicationsRootPath, IUpdateSessionManager updateSessionManager, IApplicationFactory applicationFactory,
     IApplicationPool applicationPool)
 {
     _applicationsRootPath = applicationsRootPath;
     _updateSessionManager = updateSessionManager;
     _applicationFactory = applicationFactory;
     _applicationPool = applicationPool;
 }
        public async Task TestThatMultipleInstancesInTheSameUpdateDomainCanUpdateSimultaneously()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession());

            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("superClusterId", "instanceId2", "1");

            Assert.True(await otherUpdateSessionManager.TryStartUpdateSession());
        }
        public async Task TestThatDifferentDeploymentsCanUpdateIndependently()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession());

            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("superClusterId2", "instanceId2", "2");

            Assert.True(await otherUpdateSessionManager.TryStartUpdateSession());
        }
Beispiel #11
0
        public EndToEndTest(AzureStorageEmulatorTestFixture fixture)
        {
            fixture.ClearBlobStorage();

            var module = new AzureBlobStorageUpdateSessionDiModule("deploymentId", "instanceId", "1",
                                                                   EmulatorConnectionString);

            _updateSessionManager = module.UpdateSessionManager;
        }
        public async Task TestThatEndUpdateSessionWorks()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession());

            await _updateSessionManager.EndUpdateSession();

            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("superClusterId", "instanceId2", "2");

            Assert.True(await otherUpdateSessionManager.TryStartUpdateSession());
        }
Beispiel #13
0
        public async Task TestThatEndUpdateSessionWorks()
        {
            Assert.True(await _updateSessionManager.TryStartUpdateSession("app1"));

            await _updateSessionManager.EndUpdateSession("app1");

            IUpdateSessionManager otherUpdateSessionManager = CreateUpdateSessionManager("deploymentId", "instanceId2", "2");

            Assert.True(await otherUpdateSessionManager.TryStartUpdateSession("app1"));
        }
        public AzureTableUpdateSessionManagerTests(AzureStorageEmulatorTestFixture fixture)
        {
            fixture.ClearBlobStorage();

            CloudTableClient client = CloudStorageAccount.Parse(EmulatorConnectionString).CreateCloudTableClient();
            var table = client.GetTableReference(AzureTableUpdateSessionManager.UpdateSessionTableName);

            table.DeleteIfExists();

            _updateSessionManager = CreateUpdateSessionManager("superClusterId", "instanceId1", "1");
        }
Beispiel #15
0
        public static ContainerBuilder RegisterTypes(YamsConfig config,
                                                     IDeploymentRepository deploymentRepository, IDeploymentStatusWriter deploymentStatusWriter,
                                                     IUpdateSessionManager updateSessionManager)
        {
            var builder = new ContainerBuilder();

            RegisterConfig(builder, config);

            RegisterProcessFactory(builder);

            RegisterProcessStopper(builder);

            RegisterApplicationConfigSymbolResolver(builder);

            RegisterApplicationConfigParser(builder);

            RegisterConfigurableApplicationFactory(builder);

            RegisterApplicationDeploymentDirectory(builder);

            RegisterApplicationPool(builder);

            RegisterApplicationInstaller(builder);

            RegisterApplicationDownloader(builder);

            RegisterApplicationUpdateManager(builder);

            RegisterDeploymentWatcher(builder);

            builder.RegisterInstance(updateSessionManager);

            builder.RegisterInstance(deploymentRepository);
            builder.RegisterInstance(deploymentStatusWriter);

            builder.RegisterType <YamsService>().As <IYamsService>().SingleInstance();

            RegisterAppDeploymentMatcher(builder);

            builder.RegisterType <DiagnosticsTraceWriter>().As <ITraceWriter>().SingleInstance();
            builder.RegisterType <JsonSerializer>().As <IJsonSerializer>().SingleInstance();

            builder.RegisterType <Os.System>().As <ISystem>().SingleInstance();

            return(builder);
        }
Beispiel #16
0
 public ApplicationUpdateManager(
     string clusterId,
     string instanceId,
     IApplicationDeploymentDirectory applicationDeploymentDirectory,
     IApplicationPool applicationPool,
     IApplicationDownloader applicationDownloader,
     IApplicationInstaller applicationInstaller,
     IDeploymentStatusWriter deploymentStatusWriter,
     IUpdateSessionManager updateSessionManager)
 {
     _clusterId       = clusterId;
     this._instanceId = instanceId;
     _applicationDeploymentDirectory = applicationDeploymentDirectory;
     _applicationPool        = applicationPool;
     _applicationDownloader  = applicationDownloader;
     _applicationInstaller   = applicationInstaller;
     _deploymentStatusWriter = deploymentStatusWriter;
     _updateSessionManager   = updateSessionManager;
 }
Beispiel #17
0
        public static ContainerBuilder RegisterTypes(YamsConfig config, 
            IDeploymentRepository deploymentRepository, IUpdateSessionManager updateSessionManager)
        {
            var builder = new ContainerBuilder();

            RegisterConfig(builder, config);

            RegisterProcessFactory(builder);

            RegisterProcessStopper(builder);

            RegisterApplicationConfigSymbolResolver(builder);

            RegisterApplicationConfigParser(builder);

            RegisterConfigurableApplicationFactory(builder);

            RegisterApplicationDeploymentDirectory(builder);

            RegisterApplicationPool(builder);

            RegisterApplicationInstaller(builder);

            RegisterApplicationDownloader(builder);

            RegisterApplicationUpdateManager(builder);

            RegisterDeploymentWatcher(builder);

            builder.RegisterInstance(updateSessionManager);

            builder.RegisterInstance(deploymentRepository);

            builder.RegisterType<YamsService>().As<IYamsService>().SingleInstance();

            RegisterAppDeploymentMatcher(builder);

            builder.RegisterType<DiagnosticsTraceWriter>().As<ITraceWriter>().SingleInstance();
            builder.RegisterType<JsonSerializer>().As<IJsonSerializer>().SingleInstance();

            return builder;
        }
Beispiel #18
0
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository, 
     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, updateSessionManager).Build();
 }