Skip to content

Conversation

@dobrac
Copy link
Contributor

@dobrac dobrac commented Nov 18, 2025

Note

Introduce Sandbox.Shutdown for faster, clean VM teardown during provisioning; ensure full block writes in diff export and add cache cleanup for template cache files.

  • Sandbox / Provisioning:
    • Add Sandbox.Shutdown(ctx) to pause VM, disable uffd, snapshot to temp files, and close resources.
    • Use Shutdown in base provision phase instead of Pause snapshot workflow; remove unused snapshot handling.
  • Block Diff:
    • In block/cache.ExportToDiff, verify full block writes by checking n against blockSize and error on short write.
  • Storage:
    • Add TemplateCacheFiles.Close(config) to remove cache dir; used by Sandbox.Shutdown.
  • Logs:
    • Tweak cache miss log: "building new step layer".

Written by Cursor Bugbot for commit a7ce236. This will update automatically on new commits. Configure here.

@dobrac dobrac added the bug Something isn't working label Nov 18, 2025
@dobrac dobrac force-pushed the speed-up-provisioning-shutdown branch from b856cee to a7ce236 Compare November 18, 2025 23:51
return nil, err
}

if int64(n) != m.blockSize {
Copy link
Member

Choose a reason for hiding this comment

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

Should be ok, just thinking if there is no way the last block/page can be short (it would violate other assumptions though.)

defer tf.Close(s.config)

// The snapfile is required only because the FC API doesn't support passing /dev/null
snapfile := template.NewLocalFileLink(tf.CacheSnapfilePath(s.config))
Copy link
Member

@ValentaTomas ValentaTomas Nov 19, 2025

Choose a reason for hiding this comment

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

In the modified FC, would you prefer to have an ability to skip snapfile too/have it delivered as returned body from pause, that you can then more easily discard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this use case, yes, accepting it in body or be able to put there /dev/null would be useful. But before that, let's see if it's desired that the reboot doesn't flush. Waiting on a reply from the FC team

Copy link
Member

@ValentaTomas ValentaTomas left a comment

Choose a reason for hiding this comment

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

Left some comments that I would like to sync on, but otherwise lgtm.

@dobrac dobrac merged commit 99185fd into main Nov 19, 2025
28 checks passed
@dobrac dobrac deleted the speed-up-provisioning-shutdown branch November 19, 2025 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants