Skip to content

Conversation

@ajemory
Copy link

@ajemory ajemory commented Jan 22, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Closes #1046 -- Right now we're creating container bundles in ContainersService. Move this to the SandboxService to make it easier to support different container bundle types.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@dcantah
Copy link
Member

dcantah commented Jan 23, 2026

Needs a make fmt

@jglogan
Copy link
Contributor

jglogan commented Jan 28, 2026

@ajemory Could you rebase this onto main and push the PR again? As it stands hawkeye is freaking out on the header checks.

Comment on lines 301 to 305
// Create bundle if it doesn't exist
if !(await self.bundleExists(at: path)) {
let metadataPath = Self.getMetadataPath(for: id)
try await sandboxClient.createBundle(metadataPath: metadataPath)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we just have the SandboxService call bundle.create in bootstrap? We don't really need the bundle created in here right?

Copy link
Author

Choose a reason for hiding this comment

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

Just to clarify, you're suggesting to call bundle.create from SandboxService bootstrap instead of ContainersService bootstrap? Yeah, I think that's a better solution. I'll make the changes!

Comment on lines +238 to +240
let metadataPath = FileManager.default.temporaryDirectory
.appendingPathComponent("bundle-metadata-\(configuration.id).json")

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use getMetadataPath here instead?


/// Get metadata file path for the given container ID
private static func getMetadataPath(for containerID: String) -> URL {
FileManager.default.temporaryDirectory
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer we just write the metadata to the bundle directory itself instead of a temporary location but also welcome to other thoughts on this. I think that way we just delete the bundle when the container is cleaned up and we're good to go. Plus then we know the file path in the SandboxService for free.

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.

[Request]: Move container bundle creation to SandboxService

5 participants