mirror of https://github.com/cirruslabs/tart.git
feat(oci): accept any BlobStorage in DiskV2
This commit is contained in:
parent
2087608d50
commit
dd5993d752
|
|
@ -1,6 +1,6 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
protocol Disk {
|
protocol Disk {
|
||||||
static func push(diskURL: URL, registry: Registry, chunkSizeMb: Int, concurrency: UInt, progress: Progress) async throws -> [OCIManifestLayer]
|
static func push(diskURL: URL, registry: any BlobStorage, chunkSizeMb: Int, concurrency: UInt, progress: Progress) async throws -> [OCIManifestLayer]
|
||||||
static func pull(registry: Registry, diskLayers: [OCIManifestLayer], diskURL: URL, concurrency: UInt, progress: Progress, localLayerCache: LocalLayerCache?, deduplicate: Bool) async throws
|
static func pull(registry: Registry, diskLayers: [OCIManifestLayer], diskURL: URL, concurrency: UInt, progress: Progress, localLayerCache: LocalLayerCache?, deduplicate: Bool) async throws
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class DiskV2: Disk {
|
||||||
private static let holeGranularityBytes = 4 * 1024 * 1024
|
private static let holeGranularityBytes = 4 * 1024 * 1024
|
||||||
private static let zeroChunk = Data(count: holeGranularityBytes)
|
private static let zeroChunk = Data(count: holeGranularityBytes)
|
||||||
|
|
||||||
static func push(diskURL: URL, registry: Registry, chunkSizeMb: Int, concurrency: UInt, progress: Progress) async throws -> [OCIManifestLayer] {
|
static func push(diskURL: URL, registry: any BlobStorage, chunkSizeMb: Int, concurrency: UInt, progress: Progress) async throws -> [OCIManifestLayer] {
|
||||||
var pushedLayers: [(index: Int, pushedLayer: OCIManifestLayer)] = []
|
var pushedLayers: [(index: Int, pushedLayer: OCIManifestLayer)] = []
|
||||||
|
|
||||||
// Open the disk file
|
// Open the disk file
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue