Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record status while in progress #325

Merged
merged 6 commits into from
Sep 10, 2017

Conversation

guyer
Copy link
Contributor

@guyer guyer commented Jan 23, 2016

It's probably a reflection on my skills as a programmer, but most of my jobs either crash or freeze. As a result, sumatra doesn't record a lot of the things I'd like to know later (I only saw the Real-Time Update of Record thread after I wrote this).

This pull request causes the record to be saved at intermediate points, tags the status, and records the resultcode in the event of an error, and colors the status tags in the web view. I've tested with sqlite, postgresql, and shelve. I can't get sumatra server to work in order to test that.

I originally tackled this by adding a new status property to the Record objects. This forced an upgrade to the database, lots of tinkering with the formatting and web templates, a new subcommand, and it wasn't possible to filter results based on status without a lot more code. Recording the status as a tag avoids all that at the cost of a somewhat more complex process for setting tags. As such, I think tags are a better approach.

@apdavison
Copy link
Contributor

Thinking of the longer term, I think adding a status property to the Record objects would be the cleanest approach, but pragmatically I'm happy to go with the tag solution.

I'll give this a test run next week; if someone else could also take a look and comment, I'd appreciate it.

@guyer
Copy link
Contributor Author

guyer commented Jan 23, 2016

I'm happy to flesh out the status property if you think that's a better direction to go.

A few notes on how I approached this:

  • Status tags require a unique format; I chose leading and trailing underscores, e.g., _killed_ as being not too obtrusive and not requiring escaping in the shell. It's a 2-line change in sumatra/core.py to choose something else. A status property wouldn't need this.
    • It's not very hard to strip the underscores and format status tags with an underline in smtweb. I think it looks better, but this breaks the logic of the tagList drop down somehow. I know so little about javascript that I can't even find table.draw, much less understand it.
  • I hijacked the label styles from bootstrap.min.css, but statuses should probably get their own.
  • I'd like to display the PID, slurm job info, or whatever, so that I can attach a debugger or kill off zombies if need be. system2.tee is the only place that knows enough, though, so this is a deeper breach in encapsulation than I wanted to make, at least without input from the devs. Maybe this is best done in conjunction with Evaluate SAGA-Python for launching jobs #319 (or similar).

@joaanna
Copy link

joaanna commented May 19, 2017

@guyer what is the status? is building from your branch a stable option? Thanks in advance for your answer

@apdavison apdavison added this to the 0.8 milestone Sep 10, 2017
@apdavison apdavison merged commit a88b372 into open-research:master Sep 10, 2017
@guyer guyer deleted the record_status-as_tag branch February 26, 2018 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants