public void Install()
        {
            var jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTables.ExportMaintenanceJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTables.ExportMaintenanceJob).AssemblyQualifiedName,
                // TODO: add settings
            };

            jd.DiscoverWorkflowParameters();
            jd.Save();
        }
Exemplo n.º 2
0
        public void Install()
        {
            var jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTables.ExportTablesJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTables.ExportTablesJob).AssemblyQualifiedName,
                Settings = new ExportTablesJobSettings()
                {
                    // TODO: use installer parameter instead
                    OutputDirectory = String.Format(@"\\{0}\ExportOutput\", federation.ControllerMachine.HostName)
                }
            };

            jd.DiscoverWorkflowParameters();
            jd.Save();
        }
Exemplo n.º 3
0
        public void GenerateDefaultChildren(ServerVersion myDbServerVersion)
        {
            // MyDB database definition

            DatabaseDefinition mydbdd = new DatabaseDefinition(federation)
            {
                Name = Constants.MyDbName,
                System = federation.System,
                LayoutType = DatabaseLayoutType.Monolithic,
                DatabaseInstanceNamePattern = Constants.MyDbInstanceNamePattern,
                DatabaseNamePattern = Constants.MyDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            mydbdd.Save();

            var mydbddi = new DatabaseDefinitionInstaller(mydbdd);
            mydbddi.GenerateDefaultChildren(myDbServerVersion, Constants.MyDbName);

            mydbdd.LoadDatabaseVersions(true);
            federation.MyDBDatabaseVersion = mydbdd.DatabaseVersions[Constants.MyDbName];

            // Job definitions
            var jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTable.ExportTableJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTable.ExportTableJob).AssemblyQualifiedName,
            };
            jd.Save();

            jd = new JobDefinition(federation)
            {
                Name = typeof(Jobs.ExportTable.ExportMaintenanceJob).Name,
                System = federation.System,
                WorkflowTypeName = typeof(Jobs.ExportTable.ExportMaintenanceJob).AssemblyQualifiedName,
            };
            jd.Save();

            var jdi = new SqlQueryJobInstaller(federation);
            jdi.Install();

            federation.Save();
        }
Exemplo n.º 4
0
 public void Install()
 {
     var jd = new JobDefinition(federation)
     {
         Name = typeof(Jobs.Query.SqlQueryJob).Name,
         System = federation.System,
         WorkflowTypeName = typeof(Jobs.Query.SqlQueryJob).AssemblyQualifiedName,
         Settings = Util.SaveSettings(new Dictionary<SqlQueryFactory.Settings, string>()
         {
             // TODO: update these in the query factory
             {SqlQueryFactory.Settings.HotDatabaseVersionName, Registry.Constants.HotDatabaseVersionName},
             {SqlQueryFactory.Settings.StatDatabaseVersionName, Registry.Constants.StatDatabaseVersionName},
             {SqlQueryFactory.Settings.DefaultSchemaName, Registry.Constants.DefaultSchemaName},
             {SqlQueryFactory.Settings.DefaultDatasetName, Registry.Constants.MyDbName},
             {SqlQueryFactory.Settings.DefaultTableName, "outputtable"}, // TODO
             {SqlQueryFactory.Settings.TemporarySchemaName, Registry.Constants.DefaultSchemaName},
             {SqlQueryFactory.Settings.LongQueryTimeout, "7200"},    // TODO
         }),
     };
     jd.Save();
 }
Exemplo n.º 5
0
 public void DiscoverParametersTest()
 {
     var jd = new JobDefinition();
     jd.WorkflowTypeName = typeof(Jhu.Graywulf.Jobs.Query.SqlQueryJob).AssemblyQualifiedName;
     jd.DiscoverWorkflowParameters();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Copy contructor for doing deep copy of the <b>Database Definition</b> objects.
 /// </summary>
 /// <param name="old">The <b>Database Definition</b> to copy from.</param>
 public JobDefinition(JobDefinition old)
     : base(old)
 {
     CopyMembers(old);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>Database Definition</b> object to create the deep copy from.</param>
 private void CopyMembers(JobDefinition old)
 {
     this.parameters = new Dictionary<string, JobParameter>(old.parameters);
     this.checkpoints = new List<JobCheckpoint>(old.checkpoints);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>Database Definition</b> object to create the deep copy from.</param>
 private void CopyMembers(JobDefinition old)
 {
     this.workflowTypeName = old.workflowTypeName;
     this.parameters       = new ParameterCollection(old.parameters);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Copy contructor for doing deep copy of the <b>Database Definition</b> objects.
 /// </summary>
 /// <param name="old">The <b>Database Definition</b> to copy from.</param>
 public JobDefinition(JobDefinition old)
     : base(old)
 {
     CopyMembers(old);
 }
Exemplo n.º 10
0
        public Cluster Install(bool system, string clusterName, string username, string email, string password)
        {
            cluster = new Cluster(Context)
            {
                Name = clusterName,
                System = system,
            };
            cluster.Save();

            // Create machine roles and machines

            //      -- controller role
            var mrcont = new MachineRole(cluster)
            {
                Name = Constants.ControllerMachineRoleName,
                System = system,
                MachineRoleType = MachineRoleType.StandAlone,
            };
            mrcont.Save();

            var sv = new ServerVersion(mrcont)
            {
                Name = Constants.ServerVersionName,
                System = system,
            };
            sv.Save();

            var mcont = new Machine(mrcont)
            {
                Name = Constants.ControllerMachineName,
            };
            mcont.Save();

            var sicont = new ServerInstance(mcont)
            {
                Name = Constants.ServerInstanceName,
                ServerVersion = sv,
            };
            sicont.Save();

            //      -- node role
            var mrnode = new MachineRole(cluster)
            {
                Name = Constants.NodeMachineRoleName,
                MachineRoleType = MachineRoleType.MirroredSet,
            };
            mrnode.Save();

            var nodesv = new ServerVersion(mrnode)
            {
                Name = Constants.ServerVersionName,
            };
            nodesv.Save();

            //      -- Create a node
            /*
            Machine mnode = new Machine(Context, mrnode);
            mnode.Name = Constants.NodeMachineName;
            mnode.Save();

            si = new ServerInstance(Context, mnode);
            si.Name = Constants.ServerInstanceName;
            si.ServerVersionReference.Value = sv;
            si.Save();*/

            // Create the shared domain for cluster level databases and users
            var domain = new Domain(cluster)
            {
                Name = Constants.SharedDomainName,
                Email = email,
                System = system,
            };
            domain.Save();

            // Create administrator group and user
            GenerateAdminGroup(system);
            GenerateAdmin(system, username, email, password);

            // Create the shared feredation
            var federation = new Federation(domain)
            {
                Name = Constants.SharedFederationName,
                Email = email,
                System = system,
                ControllerMachine = mcont,
                SchemaSourceServerInstance = sicont,
            };
            federation.Save();

            // Temp database definition
            var tempdd = new DatabaseDefinition(federation)
            {
                Name = Constants.TempDbName,
                System = system,
                LayoutType = DatabaseLayoutType.Monolithic,
                DatabaseInstanceNamePattern = Constants.TempDbInstanceNamePattern,
                DatabaseNamePattern = Constants.TempDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            tempdd.Save();

            var tempddi = new DatabaseDefinitionInstaller(tempdd);
            tempddi.GenerateDefaultChildren(nodesv, Constants.TempDbName);

            // Create cluster level jobs and queues

            //      -- admin queue definition
            QueueDefinition qd = new QueueDefinition(cluster)
            {
                Name = Constants.MaintenanceQueueDefinitionName,
                System = system,
            };
            qd.Save();

            QueueInstance qi = new QueueInstance(mcont)
            {
                Name = Constants.MaintenanceQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- long queue definition
            qd = new QueueDefinition(cluster)
            {
                Name = Constants.LongQueueDefinitionName
            };
            qd.Save();

            qi = new QueueInstance(mcont)
            {
                Name = Constants.LongQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- quick queue definition
            qd = new QueueDefinition(cluster)
            {
                Name = Constants.QuickQueueDefinitionName,
            };
            qd.Save();

            qi = new QueueInstance(mcont)
            {
                Name = Constants.QuickQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- database mirror job
            var jd = new JobDefinition(federation)
            {
                Name = typeof(Jhu.Graywulf.Jobs.MirrorDatabase.MirrorDatabaseJob).Name,
                System = system,
                WorkflowTypeName = typeof(Jhu.Graywulf.Jobs.MirrorDatabase.MirrorDatabaseJob).AssemblyQualifiedName,
            };
            jd.DiscoverWorkflowParameters();
            jd.Save();

            //      -- test job
            jd = new JobDefinition(federation)
            {
                Name = typeof(Jhu.Graywulf.Jobs.Test.TestJob).Name,
                System = system,
                WorkflowTypeName = typeof(Jhu.Graywulf.Jobs.Test.TestJob).AssemblyQualifiedName,
            };
            jd.DiscoverWorkflowParameters();
            jd.Save();

            return cluster;
        }
Exemplo n.º 11
0
        public void Install(bool system, string clusterName, string username, string email, string password)
        {
            var cluster = new Cluster(Context)
            {
                Name = clusterName,
                System = system,
            };
            cluster.Save();

            // Create administrator group and user

            var ug = new UserGroup(cluster)
            {
                Name = Constants.ClusterAdministratorUserGroupName,
                System = system,
            };
            ug.Save();

            var u = new User(cluster)
            {
                Name = username,
                System = system,
                Email = email,
                DeploymentState = Registry.DeploymentState.Deployed,
            };
            u.SetPassword(password);
            u.Save();
            u.MakeMemberOf(ug.Guid);

            // Create machine roles and machines

            //      -- controller role
            var mrcont = new MachineRole(cluster)
            {
                Name = Constants.ControllerMachineRoleName,
                System = system,
                MachineRoleType = MachineRoleType.StandAlone,
            };
            mrcont.Save();

            var sv = new ServerVersion(mrcont)
            {
                Name = Constants.ServerVersionName,
            };
            sv.Save();

            var mcont = new Machine(mrcont)
            {
                Name = Constants.ControllerMachineName,
            };
            mcont.Save();

            var si = new ServerInstance(mcont)
            {
                Name = Constants.ServerInstanceName,
                ServerVersion = sv,
            };
            si.Save();

            //      -- node role
            var mrnode = new MachineRole(cluster)
            {
                Name = Constants.NodeMachineRoleName,
                MachineRoleType = MachineRoleType.MirroredSet,
            };
            mrnode.Save();

            sv = new ServerVersion(mrnode)
            {
                Name = Constants.ServerVersionName,
            };
            sv.Save();

            //      -- Create a node
            /*
            Machine mnode = new Machine(Context, mrnode);
            mnode.Name = Constants.NodeMachineName;
            mnode.Save();

            si = new ServerInstance(Context, mnode);
            si.Name = Constants.ServerInstanceName;
            si.ServerVersionReference.Value = sv;
            si.Save();*/

            // Temp database definition
            var tempdd = new DatabaseDefinition(cluster)
            {
                Name = Constants.TempDbName,
                System = system,
                LayoutType = DatabaseLayoutType.Monolithic,
                DatabaseInstanceNamePattern = Constants.TempDbInstanceNamePattern,
                DatabaseNamePattern = Constants.TempDbNamePattern,
                SliceCount = 1,
                PartitionCount = 1,
            };
            tempdd.Save();

            var tempddi = new DatabaseDefinitionInstaller(tempdd);
            tempddi.GenerateDefaultChildren(sv, Constants.TempDbName);

            // Create cluster level jobs and queues

            //      -- admin queue definition
            QueueDefinition qd = new QueueDefinition(cluster)
            {
                Name = Constants.MaintenanceQueueDefinitionName,
                System = system,
            };
            qd.Save();

            QueueInstance qi = new QueueInstance(mcont)
            {
                Name = Constants.MaintenanceQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- long queue definition
            qd = new QueueDefinition(cluster)
            {
                Name = Constants.LongQueueDefinitionName
            };
            qd.Save();

            qi = new QueueInstance(mcont)
            {
                Name = Constants.LongQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- quick queue definition
            qd = new QueueDefinition(cluster)
            {
                Name = Constants.QuickQueueDefinitionName,
            };
            qd.Save();

            qi = new QueueInstance(mcont)
            {
                Name = Constants.QuickQueueName,
                RunningState = Registry.RunningState.Running,
            };
            qi.QueueDefinitionReference.Value = qd;
            qi.Save();

            //      -- database mirror job
            var jd = new JobDefinition(cluster)
            {
                Name = typeof(Jhu.Graywulf.Jobs.MirrorDatabase.MirrorDatabaseJob).Name,
                System = system,
                WorkflowTypeName = typeof(Jhu.Graywulf.Jobs.MirrorDatabase.MirrorDatabaseJob).AssemblyQualifiedName,
            };
            jd.Save();

            //      -- test job
            jd = new JobDefinition(cluster)
            {
                Name = typeof(Jhu.Graywulf.Jobs.Test.TestJob).Name,
                System = system,
                WorkflowTypeName = typeof(Jhu.Graywulf.Jobs.Test.TestJob).AssemblyQualifiedName,
            };
            jd.Save();
        }
Exemplo n.º 12
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>Database Definition</b> object to create the deep copy from.</param>
 private void CopyMembers(JobDefinition old)
 {
     this.workflowTypeName = old.workflowTypeName;
     this.parameters = new ParameterCollection(old.parameters);
 }