WIP: 103268-job-task-progress #104185
No reviewers
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#104185
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Nitin-Rawat-1/flamenco:103268-job-task-progress"
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?
Issue #103268: This PR aims to implement the feature in the reference issue in the future. Right now approval of the project maintainer is required for the work done till now.
SocketIOTaskProgressUpdate
for broadcasting progress updates 2053b25ecf2abfae2a0c
to218e476e78
I think this logic should be pulled into a separate function, and probably even use a different struct. That way the 'keeping track of frame processing progress' logic is separate from the 'rendering with Blender' code. I'm thinking along the lines of something like this:
In theory a task can consist of multiple blender-render commands, though, so this will have to be tracked on the task level, not just the command level. It's probably a good idea to create some
CommandProgressListener
interface, and use that to bridge the command runner functions and the task executor.@ -21,2 +22,4 @@
var regexpFileSaved = regexp.MustCompile("Saved: '(.*)'")
var regexpFrameNumber = regexp.MustCompile("Fra:[0-9]+")
var prevFrame string
I don't see the need to declare these variables here.
@ -27,6 +32,7 @@ type BlenderParameters struct {
argsBefore []string // Additional CLI arguments defined by the job compiler script, to go before the blend file name.
blendfile string // Path of the file to open.
args []string // Additional CLI arguments defined by the job compiler script, to go after the blend file name.
numFrames float64 // Additional CLI argument defined by the job compiler script, to define the total number of frame that are needed to be rendered.
This is not a CLI argument. It's just for Flamenco's bookkeeping, and won't be passed to Blender in any way.
@ -47,2 +53,4 @@
wg.Add(1)
go func() {
prevFrame = ""
renderedNumFrames = 0
Why are these set here? They're not used in this goroutine. Also Go initializes variables to the zero value, so it's likely to be a no-op. It can cause a race condition, though, because the goroutine runs asynchronously from the rest of the code.
@ -140,1 +148,4 @@
// Ignore the `ok` return value, as a missing numFrames key is fine:
parameters.numFrames, _ = cmdParameter[float64](cmd, "numFrames")
if parameters.numFrames != 0 {
This
if
is not necessary.totalNumFrames
is initialized to zero anyway, so ifparamters.numFrames == 0
, the assignment can safely be done as it just reassigns zero.@ -50,2 +52,3 @@
//go:generate go run github.com/golang/mock/mockgen -destination mocks/cli_runner.gen.go -package mocks git.blender.org/flamenco/internal/worker CommandLineRunner
// CommandLineRunner is an interface around exec.CommandContext().
//
//go:generate go run github.com/golang/mock/mockgen -destination mocks/cli_runner.gen.go -package mocks git.blender.org/flamenco/internal/worker CommandLineRunner
Try to keep the changes in a PR to a minimum. Unless there is a good reason, keep the ordering of these comments the same. That'll make it easier to see what actually changed.
@ -100,0 +109,4 @@
if ctx.Err() != nil {
return ctx.Err()
}
resp, err := l.client.TaskProgressUpdateWithResponse(ctx, taskID, progress)
This should not use the API client directly. If the Manager cannot be reached, the progress updates should be queued in the buffer, just like regular task updates.
Checkout
From your project repository, check out a new branch and test the changes.