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

Check the job model still suits our needs #191

Closed
1 of 3 tasks
atruskie opened this issue May 7, 2015 · 8 comments
Closed
1 of 3 tasks

Check the job model still suits our needs #191

atruskie opened this issue May 7, 2015 · 8 comments

Comments

@atruskie
Copy link
Member

atruskie commented May 7, 2015

Since we previously designed the job model, the requirements have changed.

  • Proposal: name change (so as not to cause confusion with resque jobs)
    • options: analysis_jobs, custom_jobs, user_jobs, analyses
  • Check required fields:
    • Name
    • Standard record metadata (created, modified, & users, etc..)
    • Cache of customised config
    • Total duration of saved search results
    • Total number of audio recordings from saved search results
    • Total number of resque jobs produced from saved search results
    • Date started (not same as modified?)
    • Current status (creating, generating, running, completed, paused, failed)
    • Last status date
    • others?
  • Relations:
    • users
    • saved_searches
    • projects (many:many, extra table needed, no API needed)
    • scripts

Note: no need for JobItems equivalent model/relation

@atruskie
Copy link
Member Author

atruskie commented May 7, 2015

Proposed additional field: cached status/progress (and accompanying last updated field).

Maybe a postgres JSON field where we can store cached counts of each status (success, failed, running, queued).

Will make showing a list of custom jobs and their progressed (say on the custom jobs list page) much more efficient.

@cofiem
Copy link
Contributor

cofiem commented May 10, 2015

Also check that API for create and status update matches spec in #193

@cofiem
Copy link
Contributor

cofiem commented May 10, 2015

current db structure:

create_table "jobs", force: :cascade do |t|
    t.string   "name",            limit: 255, null: false
    t.string   "annotation_name", limit: 255
    t.text     "script_settings"
    t.integer  "dataset_id",                  null: false
    t.integer  "script_id",                   null: false
    t.integer  "creator_id",                  null: false
    t.integer  "updater_id"
    t.integer  "deleter_id"
    t.datetime "deleted_at"
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
    t.text     "description"
  end

@cofiem
Copy link
Contributor

cofiem commented May 10, 2015

@atruskie Does the saved_search specify whether new audio recordings that match the filter are included in the job?

As we discussed, including something like audio_recording.created_at < [date] is how the issue of new recordings will be addressed?

What if a user wants to use an existing saved_search, but change only the audio_recording.created_at < [date] value?

What is there are lots of similar queries with only this value modified?

Not specifying the created_at value may mean that the saved_search will in the future match audio_recordings in other projects not accounted for in the custom_jobs_projects / projects_saved_searches table?

@atruskie
Copy link
Member Author

Like you said in comment, yeah, the matching new recordings trick will simply be a filter. Nothing explicit. Only requires saved search to filter created date to be less than a_date (again as you said).

RE: what if a user want to change that date? simple, we let them edit the date. Simpler yet, we don't even expose any of this functionality in the client until its needed. Good to know we have the architecture to support it though.

What is there are lots of similar queries with only this value modified?

  • I don't understand.

Not specifying the created_at value may mean that the saved_search will in the future match audio_recordings in other projects not accounted for in the custom_jobs_projects / projects_saved_searches table?

This should not be an issue. The query is executed once when the job starts (NB: perhaps worth saving the results, say in csv in job folder on disk, if only for debugging). It is correct when run, not important otherwise. If a user wants more recordings included, a new job to gets executed, which will execute once when started, and be correct when started.

@atruskie
Copy link
Member Author

@cofiem have we settled on a name?

I'm reviewing #196 and noticed the API endpoints are all /jobs - I still think the name is ambiguous.

@cofiem
Copy link
Contributor

cofiem commented May 12, 2015

Decided to change name to analysis_jobs. Any issues with this?

@atruskie
Copy link
Member Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants