Skip to content

Add OCI transport and base clone with DiskImageKit - #1304

Open
yzhuang-oai wants to merge 2 commits into
support-diskimagekitfrom
support-diskimagekit-phase2
Open

Add OCI transport and base clone with DiskImageKit #1304
yzhuang-oai wants to merge 2 commits into
support-diskimagekitfrom
support-diskimagekit-phase2

Conversation

@yzhuang-oai

Copy link
Copy Markdown

This is the second PR adding support for new
DiskImageKit ASIF layers to tart VM images.

https://developer.apple.com/documentation/diskimagekit

This change implements the OCI transport logic and
adds the tart clone --base option to clone an existing
VM image into the new layered VM image format.

Issue: #1269

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3f8702752

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMDirectory.swift
Comment thread Sources/tart/VMDirectory.swift
Comment thread Sources/tart/VMStorageOCI.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from e3f8702 to ed67af0 Compare August 6, 2026 01:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed67af0ddb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMDirectory.swift
Comment thread Sources/tart/VMDirectory.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit branch 2 times, most recently from 7641f87 to 4f50c8d Compare August 6, 2026 23:15
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from ed67af0 to 1274d23 Compare August 6, 2026 23:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1274d23499

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMStorageOCI.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from 1274d23 to 2a302c9 Compare August 7, 2026 00:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a302c9d2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMStorageOCI.swift
Comment thread Sources/tart/VMDirectory+OCI.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit branch from 4f50c8d to 6d110c7 Compare August 7, 2026 00:06
This change adds transport logic to support push/pull of
ASIF layers for VM image.
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from 2a302c9 to 4e13bb5 Compare August 7, 2026 00:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e13bb5b9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMStorageOCI.swift
Comment thread Sources/tart/VMDirectory+OCI.swift
Comment thread Sources/tart/Commands/Clone.swift Outdated
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from 4e13bb5 to ad27fc7 Compare August 7, 2026 03:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad27fc75ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/Commands/Clone.swift Outdated
Comment thread Sources/tart/VMDirectory+Archive.swift Outdated
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase2 branch from ad27fc7 to 9129de6 Compare August 7, 2026 03:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9129de6550

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let reclaimBytes = min(unallocatedBytes, Int(pruneLimit) * 1024 * 1024 * 1024)
if reclaimBytes > 0 {
try Prune.reclaimIfNeeded(UInt64(reclaimBytes), sourceVM)
if sourceVM.isStandalone {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reclaim runtime headroom for stacked clones

When cloning a stacked OCI record or local stacked VM on a constrained host, this guard skips automatic pruning entirely, even though the newly created writable overlay can later grow toward the full guest disk size. As a result, --prune-limit becomes ineffective for the new clone modes and a VM can encounter ENOSPC while reclaimable cache entries remain; calculate suitable writable headroom from the stacked disk geometry instead of limiting reclamation to standalone sources.

Useful? React with 👍 / 👎.

// digest identifies this OCI cache record and stacked VMs pin it.
try manifestData.write(to: tmpVMDir.manifestURL)

try move(digestName, from: tmpVMDir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve explicit-pull status while repairing a digest

When a digest was explicitly pulled, its shared stacked content later becomes missing or corrupt, and the same digest is repaired through a tag, this replacement discards the existing directory's .explicitly-pulled marker. Because the tag path does not execute the name == digestName branch that recreates the marker, moving or deleting that tag later lets gc() remove a digest the user explicitly requested to retain; preserve the marker across replacement.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant