Update dependencies and clean up project structure. Add cloud.google.com/go/compute/metadata as an indirect requirement in go.mod. Remove unused files and update package.json for Vite and React plugins. Refactor Makefile for improved build process.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -496,10 +497,10 @@ func (c *Client) processTask(task map[string]interface{}, jobName, outputFormat
|
||||
cmd.Dir = workDir
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
errMsg := fmt.Sprintf("blender failed: %w\nOutput: %s", err, string(output))
|
||||
errMsg := fmt.Sprintf("blender failed: %v\nOutput: %s", err, string(output))
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "render_blender")
|
||||
c.sendStepUpdate(taskID, "render_blender", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
// Find rendered output file
|
||||
@@ -508,7 +509,7 @@ func (c *Client) processTask(task map[string]interface{}, jobName, outputFormat
|
||||
errMsg := fmt.Sprintf("output file not found: %s", outputFile)
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "render_blender")
|
||||
c.sendStepUpdate(taskID, "render_blender", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
c.sendLog(taskID, types.LogLevelInfo, fmt.Sprintf("Blender render completed for frame %d", frameStart), "render_blender")
|
||||
c.sendStepUpdate(taskID, "render_blender", types.StepStatusCompleted, "")
|
||||
@@ -523,10 +524,10 @@ func (c *Client) processTask(task map[string]interface{}, jobName, outputFormat
|
||||
|
||||
outputPath, err := c.uploadFile(jobID, outputFile)
|
||||
if err != nil {
|
||||
errMsg := fmt.Sprintf("failed to upload output: %w", err)
|
||||
errMsg := fmt.Sprintf("failed to upload output: %v", err)
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, uploadStepName)
|
||||
c.sendStepUpdate(taskID, uploadStepName, types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
c.sendLog(taskID, types.LogLevelInfo, "Output file uploaded successfully", uploadStepName)
|
||||
c.sendStepUpdate(taskID, uploadStepName, types.StepStatusCompleted, "")
|
||||
@@ -1001,10 +1002,10 @@ sys.stdout.flush()
|
||||
cmd.Dir = workDir
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
errMsg := fmt.Sprintf("blender metadata extraction failed: %w\nOutput: %s", err, string(output))
|
||||
errMsg := fmt.Sprintf("blender metadata extraction failed: %v\nOutput: %s", err, string(output))
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "extract_metadata")
|
||||
c.sendStepUpdate(taskID, "extract_metadata", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
// Parse output (metadata is printed to stdout)
|
||||
@@ -1016,16 +1017,16 @@ sys.stdout.flush()
|
||||
errMsg := "Failed to extract JSON from Blender output"
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "extract_metadata")
|
||||
c.sendStepUpdate(taskID, "extract_metadata", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
metadataJSON = metadataJSON[jsonStart : jsonEnd+1]
|
||||
|
||||
var metadata types.BlendMetadata
|
||||
if err := json.Unmarshal([]byte(metadataJSON), &metadata); err != nil {
|
||||
errMsg := fmt.Sprintf("Failed to parse metadata JSON: %w", err)
|
||||
errMsg := fmt.Sprintf("Failed to parse metadata JSON: %v", err)
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "extract_metadata")
|
||||
c.sendStepUpdate(taskID, "extract_metadata", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
c.sendLog(taskID, types.LogLevelInfo, fmt.Sprintf("Metadata extracted: frames %d-%d, resolution %dx%d",
|
||||
@@ -1038,10 +1039,10 @@ sys.stdout.flush()
|
||||
|
||||
// Submit metadata to manager
|
||||
if err := c.submitMetadata(jobID, metadata); err != nil {
|
||||
errMsg := fmt.Sprintf("Failed to submit metadata: %w", err)
|
||||
errMsg := fmt.Sprintf("Failed to submit metadata: %v", err)
|
||||
c.sendLog(taskID, types.LogLevelError, errMsg, "submit_metadata")
|
||||
c.sendStepUpdate(taskID, "submit_metadata", types.StepStatusFailed, errMsg)
|
||||
return fmt.Errorf(errMsg)
|
||||
return errors.New(errMsg)
|
||||
}
|
||||
|
||||
c.sendStepUpdate(taskID, "submit_metadata", types.StepStatusCompleted, "")
|
||||
|
||||
Reference in New Issue
Block a user