- VerifySnapshot: SHA256 verification using integrity package - EnforceTaskProvenance: Strict and best-effort provenance validation - RunJupyterTask: Full Jupyter service lifecycle (start/stop/remove/restore/list_packages) - RunJob: Job execution using executor.JobRunner - PrewarmNextOnce: Prewarming with queue integration All methods now use new architecture components instead of placeholders
23 lines
888 B
Go
23 lines
888 B
Go
package worker
|
|
|
|
import "github.com/jfraeys/fetch_ml/internal/worker/integrity"
|
|
|
|
// UseNativeLibs controls whether to use C++ implementations.
|
|
// Set FETCHML_NATIVE_LIBS=1 to enable native libraries.
|
|
// This is defined here so it's available regardless of build tags.
|
|
var UseNativeLibs = false
|
|
|
|
// dirOverallSHA256Hex selects implementation based on toggle.
|
|
// This file has no CGo imports so it compiles even when CGO is disabled.
|
|
// The actual implementations are in native_bridge.go (native) and integrity package (Go).
|
|
func dirOverallSHA256Hex(root string) (string, error) {
|
|
if !UseNativeLibs {
|
|
return integrity.DirOverallSHA256Hex(root)
|
|
}
|
|
return dirOverallSHA256HexNative(root)
|
|
}
|
|
|
|
// DirOverallSHA256HexParallel exports the parallel directory hashing function.
|
|
func DirOverallSHA256HexParallel(root string) (string, error) {
|
|
return integrity.DirOverallSHA256HexParallel(root)
|
|
}
|