locked
HPC Add Task To Existing Job Using C# Rest RRS feed

  • Question

  • My problem is I have a job that can be submitted by any number of users...If no job exists in the queue then a new job is submitted with one task and no problem.  If another job is submitted and one already exists I want to add a task to the existing job and make the second task dependant on the first.

    Everything seems fine - however when the second task gets added to the existing job - the task always stays at the configuring state.

    I'm using c# to call the REST interface - and I'm just POSTing an Add Task to the existing job.

    Am I missing something?  Do I need to re-post the job?

    Thanks

    Danial

    Monday, September 30, 2013 12:50 PM

All replies

  • To modify the task level of a job the calling identity must be the owner of the job, Job Administrator (v4sp1) or Cluster Administrator.

    I would expect the REST API to return some sort of failure related to auth if the identity attempting the POST does not meet the above requirements.

    Are you seeing 200 OK or something else?  If not 200 ok there might be helpful information in the response body as well... although with auth this is often "terse"...

    d

    Tuesday, October 1, 2013 5:23 PM
  • Nope, everything submits fine. 

    First, I make the POST call to /job/id/tasks.

    I get the returned taskID from that call, then I proceed to add the custom parameters associated with that task.

    However the task status just stays at configuring....its like when I create a job, add a task, and don't post a submit job command. In that case the job stays at configuring.

    Its like I'm missing a submit task post....interestingly when you look at the .NET library there is a submit task method - but its doesn't seem to be in the REST API.

    Wednesday, October 2, 2013 12:26 PM
  • Ok... well keep the identity auth requirements in the back of your mind as we,  hopefully, move forward.

    You are correct that "ISchedulerJob.SubmitTask()" is needed to add a task to an already-submitted-job.  The Scheduler REST API does not include this feature.

    Assuming you are using REST/port-443 for compelling reasons... you might look into enabling "ISchedulerOverHTTPS", which was introduced in v3sp4: Job Scheduling via HTTPS v3sp4

    You have not mentioned what version of the HPC stack you are running... and where.  OnPremise, IAAS and/or possibly "Windows Azure HPC Scheduler" (discontinued in v4sp1) all possibly include this but differ in some details.

    d


    • Edited by DarylMsft Wednesday, October 2, 2013 8:47 PM comma
    Wednesday, October 2, 2013 7:29 PM
  • We are running HPC Pack 2012 (4.0.3906.0) on windows server 2012. Its an on premise cluster...
    Thursday, October 3, 2013 1:43 AM
  • Enabling "Job Scheduling Over HTTPS" is an option for you then.

    Indeed... if/since you have enabled the REST API (ie: web components), the listener is already sharing port 443 and your C# code can use IScheduler directly.  You should be able to supply a "https://headnode" string to the .Connect() method.

    The CLI/PSH tools also accept this sort of HN specification...

    One complication of this approach is that certificate chain trust is enforced.   So cert chain trust must be established between any calling clients and the HN.

    d



    • Edited by DarylMsft Thursday, October 3, 2013 8:39 PM a bit more technically correct
    Thursday, October 3, 2013 7:59 PM
  • Fantastic!

    I'll give it a try...thanks.

    Monday, October 7, 2013 11:39 AM