Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Real-Time Update of Record

16 views
Skip to first unread message

ar...@g.harvard.edu

unread,
Aug 23, 2015, 2:45:51 PM8/23/15
to sumatra-users
Hi, 

Thanks for the great software. We have been using Sumatra in our group for a couple weeks now and really liking it. 

One issue though. Many of our experimental jobs run for several days. Currently when using `smt run` the records are only created after the job is completed. Ideally, we would like to be able to create the record immediately at launch, and maybe update things (stdout mainly) every half-hour or so. We're using a remote datastore backed by postgres, and wouldn't mind switching to the Python API for record creation. Is it possible/advisable to update records in this way? It would be amazing to have a snippet showing the Python API example from the docs with an update-able job record. 

Cheers,
Sasha 

Andrew Davison

unread,
Sep 1, 2015, 8:58:13 AM9/1/15
to sumatr...@googlegroups.com
Dear Sasha,

I wasn't sure how easy this would be, but it turns out to be straightforward, although I've only tested it with a DjangoRecordStore using SQLite, so ymmv.

All you need to do is call `project.add_record(record)` immediately after creating the record (before the job starts), and then call `project.record_store.save(project.name, record)` any time you want to update the record.

Here is a gist showing an example: https://gist.github.com/apdavison/c4c1f5ba26345d20f7b3

Cheers,

Andrew
Reply all
Reply to author
Forward
0 new messages