# Show Projected Start time on Interactive Sessions page

**URL:** https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481
**Category:** Feature Requests and Roadmap Discussion
**Tags:** feature-request
**Created:** [August 21, 2025, 3:52pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481 "2025-08-21T15:52:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![CarrieBrown](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/carriebrown/32/2945_2.png) [@CarrieBrown](https://discourse.openondemand.org/u/CarrieBrown)
#### Post date: [August 21, 2025, 3:52pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/1 "2025-08-21T15:52:36Z")

</div>

When submitting jobs through OOD, many of our users are confused about what to do when they observe a job in the “Queued” state for a long time.

It would be helpful to have the Projected Start Time (from squeue –start output) shown in the card for the job.

This could take the same spot where “Time Remaining” is for running jobs.

---

<div class="post-metadata">

### Author: ![ric](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ric/32/63_2.png) [@ric](https://discourse.openondemand.org/u/ric)
#### Post date: [August 21, 2025, 4:15pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/2 "2025-08-21T16:15:45Z")

</div>

How would you deal with the edge cases, like start is dependent on something? Many of the jobs “just queued” are waiting on a resource and have N/A in the START\_TIME column; e.g.

```auto
          14439049 standard st_archi <username> PD N/A 1 (null) (DependencyNeverSatisfied)

```

Would you have OOD display the “DependencyNeverSatisified” string as the Projected Start Time?

---

<div class="post-metadata">

### Author: ![jrlagrone](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jrlagrone/32/2715_2.png) [@jrlagrone](https://discourse.openondemand.org/u/jrlagrone)
#### Post date: [August 21, 2025, 5:00pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/3 "2025-08-21T17:00:12Z")

</div>

We’re also interested in this. It’s on my TODO list to try to implement something locally, but currently have no idea when I’ll have time to try. I feel like I’ve seen other recent discussions about this.

Ric, we’re especially concerned with edge cases. While we’ve tried to prevent it with checks on the forms, users submitting a job that can never start and no way of seeing that from the interactive sessions page is a frequent issue for us.

I think it’s implementation + docs issue. Basically, show users whatever slurm says and then a link to docs explaining what that means. How many jobs have a predicted start time is also highly dependent on local Slurm confs. I think I would add “eligible” times in as well.

---

<div class="post-metadata">

### Author: ![jrlagrone](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jrlagrone/32/2715_2.png) [@jrlagrone](https://discourse.openondemand.org/u/jrlagrone)
#### Post date: [August 21, 2025, 5:01pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/4 "2025-08-21T17:01:32Z")

</div>

see also: [Custom notices on session card while a job is starting](https://discourse.openondemand.org/t/custom-notices-on-session-card-while-a-job-is-starting/4342)

---

<div class="post-metadata">

### Author: ![jrlagrone](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jrlagrone/32/2715_2.png) [@jrlagrone](https://discourse.openondemand.org/u/jrlagrone)
#### Post date: [August 21, 2025, 7:53pm UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/5 "2025-08-21T19:53:17Z")

</div>

Here’s a start. Tighter integration into the cards would be more work, but this lets you show some extra info to users without any significant changes. This would be a in a custom `info.md.erb` on a per app basis.

```auto
<%-
require 'open3'

class CheckJob

  @cache = ActiveSupport::Cache::FileStore.new("/users/#{User.new.name}/.cache/OpenOnDemand/", :expires_in => 60.seconds)

  def self.CheckJob(job_id)
    begin
      # get job info from squeue
      script = "/hpc/sys/apps/slurm/current/bin/squeue -j " + job_id + " -ho '%T,%S'"
      o, status = Open3.capture2e(script)
      tmp_output = o.split("\n")
      output = tmp_output[0].split(',')
      return output
    end
  end

  def self.GetJobState(job_id)
    begin
      @GetJobState = @cache.fetch("#{User.new.name}/queues/" + job_id, race_condition_ttl: 30.seconds) do
        self.CheckJob(job_id)
      end
      return @GetJobState
    end
  end
end

def valid_time_string?(time_string)
  begin
    Time.parse(time_string)
    true
  rescue ArgumentError
    false
  end
end

-%>

<%- if queued? -%>
> **Job Status** : <%= CheckJob.GetJobState(job_id)[0] %>

> **Predicted or Actual Start Time** : 
<%- if valid_time_string?(CheckJob.GetJobState(job_id)[1]) -%>
<%= Time.parse(CheckJob.GetJobState(job_id)[1]).strftime("%B %d, %Y at %I:%M %p") %>
<%- else -%>
Unknown
<%- end -%>

> For an explanation of the job status values, see https://slurm.schedmd.com/squeue.html#SECTION_JOB-STATE-CODES

> Predicted start times are based on job requests currently in the queue. They are not available for all jobs and
are often not accurate. Jobs usually, but not always, start before the predicted time. 
<%- end -%>

```

There’s probably better ways to do that and you may need to modify how I setup the cache, path to slurm commands, etc.

Looks like:

 ![Screenshot 2025-08-21 at 2.50.51 PM](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/b0176db675930cafb94a72f8b4a3ab2c0504fb0e.png)

---

<div class="post-metadata">

### Author: ![buzh](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/buzh/32/1394_2.png) [@buzh](https://discourse.openondemand.org/u/buzh)
#### Post date: [August 27, 2025, 10:57am UTC](https://discourse.openondemand.org/t/show-projected-start-time-on-interactive-sessions-page/4481/6 "2025-08-27T10:57:00Z")

</div>

Thanks for this!

Instead of hardcoding the cache path, I changed it so it uses ~/ondemand/.cache:

```auto
  @cache = ActiveSupport::Cache::FileStore.new(
    File.join(ENV["HOME"], "ondemand", ".cache"),
    expires_in: 60.seconds
  )

```
