public void CanSpecifyAdditionalPools()
        {
            var poolConfig = new PoolConfigurationModel {
                PoolName = "mypool", AdditionalPools = "pool1,pool2"
            };

            Assert.Equal("mypool,pool1,pool2", poolConfig.GetDeadlinePoolsString());
            Assert.Null(poolConfig.GetDeadlineGroupsString());
        }
        public void UseGroupInsteadOfPool()
        {
            var poolConfig = new PoolConfigurationModel {
                PoolName = "mypool", UseDeadlineGroups = true,
            };

            Assert.Equal("mypool", poolConfig.GetDeadlineGroupsString());
            Assert.Null(poolConfig.GetDeadlinePoolsString());
        }
        public void DefaultsToPoolName()
        {
            var poolConfig = new PoolConfigurationModel {
                PoolName = "mypool"
            };

            Assert.Equal("mypool", poolConfig.GetDeadlinePoolsString());
            Assert.Null(poolConfig.GetDeadlineGroupsString());
        }
示例#4
0
        public static void AddDeadlinePoolsAndGroups(this IList <MetadataItem> metadata, PoolConfigurationModel poolConfiguration)
        {
            if (metadata == null)
            {
                return;
            }

            var pools = poolConfiguration.GetDeadlinePoolsString();

            if (!string.IsNullOrEmpty(pools))
            {
                metadata.AddOrUpdateMetadata(MetadataKeys.DeadlinePools, pools);
            }

            var groups = poolConfiguration.GetDeadlineGroupsString();

            if (!string.IsNullOrEmpty(groups))
            {
                metadata.AddOrUpdateMetadata(MetadataKeys.DeadlineGroups, groups);
            }
        }
示例#5
0
        private void AppendDeadlineParamsToStartTask(
            PoolConfigurationModel poolConfiguration,
            RenderingEnvironment environment,
            StartTask startTask,
            DeadlineConfig deadlineConfig,
            InstallationPackage deadlinePackage,
            bool isWindows)
        {
            var commandLine   = startTask.CommandLine;
            var resourceFiles = new List <ResourceFile>(startTask.ResourceFiles);

            if (deadlinePackage != null && !string.IsNullOrEmpty(deadlinePackage.Container))
            {
                resourceFiles.Add(GetContainerResourceFile(deadlinePackage.Container, deadlinePackage.PackageName));
                commandLine += GetParameterSet(isWindows, "installerPath", deadlinePackage.PackageName);
            }

            if (isWindows & environment.Domain != null && environment.Domain.JoinDomain)
            {
                commandLine += GetParameterSet(isWindows, "domainJoin");
                commandLine += GetParameterSet(isWindows, "domainName", environment.Domain.DomainName);
                commandLine += GetParameterSet(isWindows, "domainJoinUserName", environment.Domain.DomainJoinUsername);

                if (!string.IsNullOrWhiteSpace(environment.Domain.DomainWorkerOuPath))
                {
                    commandLine += GetParameterSet(isWindows, "domainOuPath", environment.Domain.DomainWorkerOuPath);
                }
            }

            if (environment.KeyVaultServicePrincipal != null)
            {
                commandLine += GetParameterSet(isWindows, "tenantId", environment.KeyVaultServicePrincipal.TenantId.ToString());
                commandLine += GetParameterSet(isWindows, "applicationId", environment.KeyVaultServicePrincipal.ApplicationId.ToString());
                commandLine += GetParameterSet(isWindows, "keyVaultCertificateThumbprint", environment.KeyVaultServicePrincipal.Thumbprint);
                commandLine += GetParameterSet(isWindows, "keyVaultName", environment.KeyVault.Name);
            }

            var repoPath = isWindows ? deadlineConfig.WindowsRepositoryPath : deadlineConfig.LinuxRepositoryPath;

            if (!string.IsNullOrWhiteSpace(repoPath))
            {
                commandLine += GetParameterSet(isWindows, "deadlineRepositoryPath", deadlineConfig.WindowsRepositoryPath);
            }

            if (!string.IsNullOrEmpty(deadlineConfig.RepositoryUser))
            {
                commandLine += GetParameterSet(isWindows, "deadlineRepositoryUserName", deadlineConfig.RepositoryUser);
            }

            if (!string.IsNullOrEmpty(deadlineConfig.ServiceUser))
            {
                commandLine += GetParameterSet(isWindows, "deadlineServiceUserName", deadlineConfig.ServiceUser);
            }
            else
            {
                // If the Deadline slave is running under the start task context (not a service)
                // then we don't want to wait for success as it will block after launching the
                // Deadline launcher to prevent it being killed.
                startTask.WaitForSuccess = false;
            }

            if (deadlineConfig.LicenseMode != null)
            {
                commandLine += GetParameterSet(isWindows, "deadlineLicenseMode", deadlineConfig.LicenseMode.ToString());
            }

            if (!string.IsNullOrEmpty(deadlineConfig.DeadlineRegion))
            {
                commandLine += GetParameterSet(isWindows, "deadlineRegion", deadlineConfig.DeadlineRegion);
            }

            if (!string.IsNullOrEmpty(deadlineConfig.LicenseServer))
            {
                commandLine += GetParameterSet(isWindows, "deadlineLicenseServer", deadlineConfig.LicenseServer);
            }

            var pools = poolConfiguration.GetDeadlinePoolsString();

            if (!string.IsNullOrEmpty(pools))
            {
                commandLine += GetParameterSet(isWindows, "deadlinePools", pools);
            }

            var groups = poolConfiguration.GetDeadlineGroupsString();

            if (!string.IsNullOrEmpty(groups))
            {
                commandLine += GetParameterSet(isWindows, "deadlineGroups", groups);
            }

            var limitGroups = poolConfiguration.GetDeadlineExcludeFromLimitGroupsString(deadlineConfig);

            if (!string.IsNullOrWhiteSpace(limitGroups))
            {
                commandLine += GetParameterSet(isWindows, "excludeFromLimitGroups", limitGroups);
            }

            commandLine += "; ";

            if (!isWindows)
            {
                commandLine += "wait";
            }

            startTask.CommandLine   = commandLine;
            startTask.ResourceFiles = resourceFiles;
        }