Repository navigation
Restructure the ContainerSystem as ContainersCore, add networking, in-app help and split Settings - #7
Merged
Conversation
…reorganize the app's folders
…ge name suggestions menu
2 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
For all but trivial fixes, make sure to first create a GitHub issue that concisely describes the bug or desired enhancement as justification for the change. Large PRs with no justifying issue will be closed.
Related Issue
Closes #
Type of Change
Motivation and Context
The ContainerSystem split the container system across
SystemManager,ContainerRuntimeand a plugin loader, and managers returned app-side copies of what they managed. Its model, names and storage now follow Apple's container project, so features developed there are easier to bring to the app.Containers couldn't reach each other or the Mac by name, and Settings was one long pane. The documentation was only on the website.
Memory profiling found that building images could leave 10 idle threads behind for each failed attempt to connect to the builder.
Description
Framework
ContainerSystemproject is nowContainersCore, laid out by layer:System/(with its internalServices/),Managers/,Container/,Image/,Network/,Volume/,Common/,Build/.ContainerSystem.sharedreplacesSystemManagerandContainerRuntime. It owns the status, the lifecycle, the prerequisites and the settings, and creates its services when it starts and releases them when it stops.ContainerService(split into+Configuration,+Interfaces,+Lifecycle,+Processesand+Streams),ImageService,NetworkService,VolumeService,KernelService,ReportServiceandDNSService. Managers reach them through the system's throwing…Serviceproperties.HTTP2ConnectBufferingHandler.Resources
ManagedContainer,ImageResource,VolumeResourceandNetworkResource, each aManagedResourcewith validatedResourceLabels. The part that's stored is its…Configuration. They replaceImageSummary,VolumeSummaryand the app'sContainerItem,ImageItemandVolumeItem.ImageManager.digestsInUse()andVolumeManager.namesInUse().container(withID:),layers(of:platform:),domains(in:),markRead(ids:),isRead(id:)andreport(withID:).Storage
config.tomlin its folder (SystemConfiguration): the kernel, the init and builder images, build and container CPUs and memory, the DNS domain, the registry and the subnet.<name>/entity.jsonin their own folders.ContainerSystem.canStoreData(in:),AppRootError).Networking
NetworkManagercreates and deletes networks, and the Network settings pane lists them. Custom networks are hidden for now (NetworkManager.supportsCustomNetworks), since a sandboxed app can't use vmnet without thecom.apple.vm.networkingentitlement. The default network falls back to the Mac's shared NAT.DNSServiceresolves container hostnames for the Mac and the containers, and the localhost domains in/etc/resolver.App
scripts/update-help.shcopies the website's documentation intoHelp.bundle.ContainerCreateForm,ImageBuildFormandVolumeCreateFormhold what's entered in the create sheets. The Create Container sheet is split into General, Process and Management, and the create sheets share one size.ResourceEntry<Resource>values built byActivityCenter, with tasks keyed byResourceID.ContainerStatsSummary).Extensions/is folded intoModels/,Utilities/andViews/Components/.SuggestionTextFieldreplaces the suggestions modifier, and picking the suggestion that's already typed now closes the menu.Fixes
Builderno longer shuts down a group it didn't create.Docs and CI
AGENTS.md: rewritten for the ContainersCore layout, services, resources, forms and naming.README.mdandCONTRIBUTING.md: updated.ContainersCoreTests, and the build runs swift-format lint.Testing
Added
AppRootTests,SystemConfigurationTests,ResourceLabelsTests,NetworksTests,DNSServiceTests,FolderEventsTestsandImageManagerTests, and replacedMockContainerRuntimewithMockContainerSystem.Profiled with Instruments' Leaks template,
leaks,heapandfootprintwhile building images (failed, cancelled and completed builds), running containers, opening and closing windows, and stopping and starting the system:leaks: 2 leaks for 192 bytes, a vmnet configuration inside Containerization'sVmnetNetwork, once per system start.