Include final render time in task details #99731
Labels
No Label
Good First Issue
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Job Type
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: studio/flamenco#99731
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After a Blender render task is done, the task details should contain timing information.
It might be good to split this up into two bits of info:
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @dr.sybren
Should i start crating this feature ?
it would be useful to show worker time statistics
also can be used by manager for worker task scheduling policy
the way i plan to implement this is by adding two more entries in the databse as :
started_at and completed_at in the task table of the database same as updated_at column
can you guide me how to change the schema of the database table in this project and necessary referances for it ?
Hi @saurabhjadhav1911 , thanks for your offer to help!
Please also join #flamenco on Blender Chat, it's the best place to ask questions about Flamenco development.
Although this could be a reasonable start, I think it might be better to have a new table
task_execution_log
or something like that, that contains task execution events. The thing is -- a task can be run multiple times. A Worker might fail at a task (for example because it doesn't have enough memory, crashing Blender), after which another Worker can pick it up and complete it. For such cases I think it would be easier to build, and easier to reason about, a table that has "events" for task status changes, something like:id
task_id
created_at
from_status
to_status
worker_id
description
1
421
2023-12-29T11:04:00+00:00
queued
active
555
1
421
2023-12-29T11:12:00+00:00
active
completed
555
1
421
2023-12-29T11:30:00+00:00
completed
queued
NULL
There
task_id
is a foreign key to thetasks
table,worker_id
a nullable foreign ID to theworkers
table. Note that there is noupdated_at
, as entries in this table are not supposed to be ever updated.This is just a rough idea that I have in my mind, if you have ideas to improve, please do discuss!
That's done with Goose. Basically you create a new file in the
internal/manager/persistence/migrations
directory. Flamenco will pick it up and use Goose to change the database schema.To test these files you can also use
make db-migrate-status
to get the migration status,make db-migrate-up
to do a migration step, andmake db-migrate-down
to roll back a migration step. This makes it possible to test your migration without having to recompile & run Flamenco Manager. In order to run these commands you need the goose binary, which you can install withgo install github.com/pressly/goose/v3/cmd/goose@latest
.That should get you started. If you have any more questions, feel free to reach out.
I have added the migration with new table
240c5c4abb
please verify this
now do i need to add an API POST endpoint for directly writing to task_execution_log table from worker ?
or the database table need to be updated inside manager when state status changes through any of the existing worker/task endpoints ?
Now that I think of it some more: here it's better to have an
ON DELETE SET NULL
for this constraint. Also add aworker_name
column. That way, if the worker is ever removed, the log on the task remain valid. Thefk_task_execution_log_task
constraint is good -- the logs should disappear when the task gets removed.This one. As a design "rule of thumb" I try to keep the workers as dumb and simple as possible. So if there's bookkeeping that can be done by the Manager, it should be done by the Manager.
Please also take a look at #104273. Not that that is a requirement for this feature, but it might give you some ideas on how to implement this feature in a way that makes it possible to transition to some internal event system later.