Refactor installation and runner scripts for enhanced usability and security

- Updated the installation script to clarify that production wrappers do not include fixed test secrets, improving user guidance for local testing.
- Modified the jiggablend-manager and jiggablend-runner scripts to remove fixed test configurations, emphasizing the use of local test credentials via `make init-test`.
- Enhanced error handling in the runner script to ensure that an API key is provided, improving security and user feedback.
- Added new flags and options for the runner, including sandboxing capabilities and GPU ray tracing control, enhancing flexibility for users.
- Improved README documentation to reflect changes in usage and configuration, ensuring users have clear instructions for setup and execution.
This commit is contained in:
2026-07-12 10:01:15 -05:00
parent a3defe5cf6
commit 1a69fcfd04
47 changed files with 2718 additions and 402 deletions
+30 -2
View File
@@ -38,6 +38,11 @@ func init() {
runnerCmd.Flags().BoolP("verbose", "v", false, "Enable verbose logging (same as --log-level=debug)")
runnerCmd.Flags().Duration("poll-interval", 5*time.Second, "Job polling interval")
runnerCmd.Flags().Bool("force-cpu-rendering", false, "Force CPU rendering for all jobs (disables GPU rendering)")
runnerCmd.Flags().Bool("disable-rt", false, "Disable GPU ray tracing acceleration (HIPRT, OptiX, etc.)")
runnerCmd.Flags().Int("hip-gpu-sample-batch", 0, "Max samples per GPU render pass on gfx115x (0=disabled; merges batches into one EXR when >0)")
runnerCmd.Flags().String("sandbox", "podman", "Blender sandbox backend: podman (default; bind-mounts host Blender tarball + GPU devices) or none")
runnerCmd.Flags().Bool("sandbox-network", false, "Allow network inside the sandbox (default: isolated; manager I/O stays in the runner process)")
runnerCmd.Flags().String("sandbox-image", "", "Thin OS image for podman backend (default: fedora-minimal; Blender is not inside the image)")
// Bind flags to viper with JIGGABLEND_ prefix
runnerViper.SetEnvPrefix("JIGGABLEND")
@@ -53,6 +58,11 @@ func init() {
runnerViper.BindPFlag("verbose", runnerCmd.Flags().Lookup("verbose"))
runnerViper.BindPFlag("poll_interval", runnerCmd.Flags().Lookup("poll-interval"))
runnerViper.BindPFlag("force_cpu_rendering", runnerCmd.Flags().Lookup("force-cpu-rendering"))
runnerViper.BindPFlag("disable_rt", runnerCmd.Flags().Lookup("disable-rt"))
runnerViper.BindPFlag("hip_gpu_sample_batch", runnerCmd.Flags().Lookup("hip-gpu-sample-batch"))
runnerViper.BindPFlag("sandbox", runnerCmd.Flags().Lookup("sandbox"))
runnerViper.BindPFlag("sandbox_network", runnerCmd.Flags().Lookup("sandbox-network"))
runnerViper.BindPFlag("sandbox_image", runnerCmd.Flags().Lookup("sandbox-image"))
}
func runRunner(cmd *cobra.Command, args []string) {
@@ -66,7 +76,11 @@ func runRunner(cmd *cobra.Command, args []string) {
verbose := runnerViper.GetBool("verbose")
pollInterval := runnerViper.GetDuration("poll_interval")
forceCPURendering := runnerViper.GetBool("force_cpu_rendering")
disableRT := runnerViper.GetBool("disable_rt")
hipGPUSampleBatch := runnerViper.GetInt("hip_gpu_sample_batch")
sandboxBackend := runnerViper.GetString("sandbox")
sandboxNetwork := runnerViper.GetBool("sandbox_network")
sandboxImage := runnerViper.GetString("sandbox_image")
var r *runner.Runner
defer func() {
@@ -115,13 +129,27 @@ func runRunner(cmd *cobra.Command, args []string) {
}
logger.Info("Runner starting up...")
if disableRT {
logger.Info("GPU ray tracing acceleration disabled (--disable-rt)")
}
if hipGPUSampleBatch > 0 {
logger.Infof("HIP GPU sample batching enabled: %d samples per pass", hipGPUSampleBatch)
}
logger.Infof("Blender sandbox backend: %s (network=%v)", sandboxBackend, sandboxNetwork)
logger.Debugf("Generated runner ID suffix: %s", runnerIDStr)
if logFile != "" {
logger.Infof("Logging to file: %s", logFile)
}
// Create runner
r = runner.New(managerURL, name, hostname, forceCPURendering)
r = runner.NewWithOptions(managerURL, name, hostname, runner.RunnerOptions{
ForceCPURendering: forceCPURendering,
DisableRT: disableRT,
HipGPUSampleBatch: hipGPUSampleBatch,
SandboxBackend: sandboxBackend,
SandboxNetwork: sandboxNetwork,
SandboxImage: sandboxImage,
})
// Check for required tools early to fail fast
if err := r.CheckRequiredTools(); err != nil {