Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Fix first pull

f-trycuab77e58244c22
diff --git a/libs/lume/src/ContainerRegistry/ImageContainerRegistry.swift b/libs/lume/src/ContainerRegistry/ImageContainerRegistry.swift
index ddf5ea1f95..d51d92b3a4 100644
--- a/libs/lume/src/ContainerRegistry/ImageContainerRegistry.swift
+++ b/libs/lume/src/ContainerRegistry/ImageContainerRegistry.swift
@@ -1011,6 +1011,12 @@ class ImageContainerRegistry: @unchecked Sendable {
// Move files to final location
try FileManager.default.moveItem(at: tempVMDir, to: URL(fileURLWithPath: vmDir.dir.path))
+ // If caching is disabled, clean up the cache entry
+ if !cachingEnabled {
+ Logger.info("Caching disabled - cleaning up temporary cache entry")
+ try? cleanupCacheEntry(manifestId: manifestId)
+ }
+
Logger.info("Download complete: Files extracted to \(vmDir.dir.path)")
Logger.info(
"Note: Actual disk usage is significantly lower than reported size due to macOS sparse file system"
@@ -1020,6 +1026,16 @@ class ImageContainerRegistry: @unchecked Sendable {
)
}
+ // Helper function to clean up a specific cache entry
+ private func cleanupCacheEntry(manifestId: String) throws {
+ let cacheDir = getImageCacheDirectory(manifestId: manifestId)
+
+ if FileManager.default.fileExists(atPath: cacheDir.path) {
+ Logger.info("Removing cache entry for manifest ID: \(manifestId)")
+ try FileManager.default.removeItem(at: cacheDir)
+ }
+ }
+
// Shared function to handle disk image creation - can be used by both cache hit and cache miss paths
private func createDiskImageFromSource(
sourceURL: URL, // Source data to decompress