none
Microsoft HPC, How to control cluster (job add, cancel, node online-offline) outside of domain RRS feed

  • Question

  • Hi,

    We use HPC Pack 2008 R2 Express with Service Pack 4 as express installation on Windows Server 2008 R2 Enterprise and install Topology 1. We are running an MPI Job on cluster like below code but I have controlled cluster with a windows application in domain. We want  to control cluster (job submission-scheduling and  node online-offline etc.) outside of domain. That is I want to have a cluster domain and one or more clients that are outside of domain. How can I do that? Thank a lot. 

                                   

    Microsoft.Hpc.Scheduler.IScheduler scheduler = new Microsoft.Hpc.Scheduler.Scheduler();

                    scheduler.Connect(Constant.HEADNODE_NAME);
            
                    Microsoft.Hpc.Scheduler.ISchedulerJob job = scheduler.CreateJob();
                    job.Name = "Matrix_calc";
                    job.UnitType = Microsoft.Hpc.Scheduler.Properties.JobUnitType.Node;
                    Microsoft.Hpc.Scheduler.ISchedulerTask task = job.CreateTask();
                    job.MinimumNumberOfNodes = 1;
                    job.MaximumNumberOfNodes = 4;
                    task.Name = "task_Matrix";

                    task.MinimumNumberOfNodes = 1;
                    task.MaximumNumberOfNodes = 4;
                    task.StdOutFilePath = "\\\\Share" + "\\Log.txt";
                    task.CommandLine = Constant.MPI_COMMAND + " " + task.MaximumNumberOfNodes + " " +     Constant.MPI_PROGRAM_NAME;

                    job.AddTask(task);

                    scheduler.SubmitJob(job, "user", "pass");

    Wednesday, March 11, 2015 12:17 PM

All replies

  • Thank for the answer. let's say I deploy a web service that includes below code on head node and

    I want to call this service with a client that is in outside domain. That is Head node have two ethernet cards. One of them is for domain and the other is for service calling.  can I do that?

    Thank you.

    Microsoft.Hpc.Scheduler.IScheduler scheduler = new Microsoft.Hpc.Scheduler.Scheduler();

                    scheduler.Connect(Constant.HEADNODE_NAME);
            
                    Microsoft.Hpc.Scheduler.ISchedulerJob job = scheduler.CreateJob();
                    job.Name = "Matrix_calc";
                    job.UnitType = Microsoft.Hpc.Scheduler.Properties.JobUnitType.Node;
                    Microsoft.Hpc.Scheduler.ISchedulerTask task = job.CreateTask();
                    job.MinimumNumberOfNodes = 1;
                    job.MaximumNumberOfNodes = 4;
                    task.Name = "task_Matrix";

                    task.MinimumNumberOfNodes = 1;
                    task.MaximumNumberOfNodes = 4;
                    task.StdOutFilePath = "\\\\Share" + "\\Log.txt";
                    task.CommandLine = Constant.MPI_COMMAND + " " + task.MaximumNumberOfNodes + " " +     Constant.MPI_PROGRAM_NAME;

                    job.AddTask(task);

                    scheduler.SubmitJob(job, "user", "pass");


    • Edited by validator12 Thursday, March 12, 2015 11:14 AM
    Thursday, March 12, 2015 11:12 AM
  • It's fine if you implement you own web service, as long as the user account running this service has permission to submit job to HPC cluster.

    Friday, March 13, 2015 1:30 AM
  • I implement my own WCF web service, I have called above scheduler code, but I can not connect. As you say, this is permission problem. What can I do to solve the permission problem. What should I do on IIS or anything

    Monday, March 16, 2015 7:24 AM
  • Hi Validator,

        It is possible that you build your own service and have other clients to call to your service. In order to do that, you need:

    1. Leverage Scheduler.ConnectServiceAsClient, with this method you service can submit jobs on behalf of others (Including your non-domain joined client). Even our REST API is building up on this API

    2. When you use this API, you need do your own client authentication, and know what domain user those clients maps to as you don't want your service submits jobs with one credential.

        With latest version of HPC (2012 R2 Update1) and a QFE (http://www.microsoft.com/en-us/download/details.aspx?id=45876) you are able to do Constraint Kerberos Delegation which means you can submit jobs just by providing the user's SPN. This feature will also help achieve what you are doing.


    Qiufang Shi

    Monday, March 16, 2015 8:44 AM
  • Ok . I implemented my own service and I write a method that includes below code but I do not know that what ServiceAsClientIdentityProvider object takes argument.  can you say it how it is.

      Microsoft.Hpc.Scheduler.IScheduler scheduler = new Microsoft.Hpc.Scheduler.Scheduler();
      ServiceAsClientIdentityProvider p = new ServiceAsClientIdentityProvider(); ??? I do not know what type argument is

       scheduler.ConnectServiceAsClient("cluster", null, "username", "pass");
       scheduler.Connect(Constant.HEADNODE_NAME);

    Monday, March 16, 2015 11:59 AM
  •         /// <summary>
            /// Connect to the scheduler with ServiceAsClient mode. Connect as the specified identity.
            /// </summary>
            /// <param name="cluster">The name of the cluster headnode.</param>
            /// <param name="identityProvider">A function that can provide the caller's identity.</param>
            /// <param name="userName">The name of the user to connect as.</param>
            /// <param name="password">The password of the user to connect as.</param>
            void ConnectServiceAsClient(string cluster, ServiceAsClientIdentityProvider identityProvider, string userName, string password);

    Thus what you need to provide is a function that can get call's identity, and it should return a string. For a simplest example, you can do as following:

         scheduler.ConnectServiceAsClient("localhost", () => this.username);


    Qiufang Shi

    Monday, March 16, 2015 1:02 PM
  • thank you for your help. I have connected.  I created a  delegate method that returns user name and I give the ServiceAsClientIdentityProvider object  to  ConnectServiceAsClient constructor as a parameter. 

    ServiceAsClientIdentityProvider p = new ServiceAsClientIdentityProvider(getIdentity);

    Thank you so much.

    Friday, March 20, 2015 7:54 AM