Commit Graph

41 Commits

Author SHA1 Message Date
Morris Richman dd6bdc20cf Expose Command Structs for Plugins (#603)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Plugins technically exist, but to add shortcuts or to do existing things
with functions in `container` requires calling a compiled binary. This
pull request aims to remove that hurdle and instability by exposing
commands as a new `ContainerCommands ` target.

Simply import `ContainerCommands` and you can access almost
any command as if it were a native part of the binary. This makes
plugin development significantly easier.

Closes #609.
2025-09-17 15:24:26 -07:00
J Logan 79cc363e78 Relocates API server to Helpers, service to Services. (#616)
- Closes #615.

Improves project organization. Separates service so it can be tested and
used separately from the executable target. No functional changes.
2025-09-16 10:14:14 -07:00
J Logan a54be363f7 Add --labels for networks. (#600)
- Closes #557.
- Breaking change: removes `.upToNextOption` for labels on volumes as
this is not what is done for containers, and it forces the argument to
precede the options if a label is supplied, which is non-intuitive.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [x] Breaking change
- [x] Documentation update

## Motivation and Context
Consistent features and UX across managed resources.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-09-15 11:27:51 -07:00
J Logan 9692d79040 Bump containerization dependency to 0.7.2. (#610)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
0.7.1 containerization contained a couple inadvertent commit reverts.

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-15 09:07:42 -07:00
Kathryn Baldauf 1b68728629 Update builder shim version to 0.6.1 to support default global args (#605)
## Type of Change
- [x] Dependency update

## Motivation and Context
A change was made in container-builder-shim to support BuildKit's
default global args
https://github.com/apple/container-builder-shim/pull/44. A new tag of
container-builder-shim was made with this change and this PR updates to
that new tag for container-builder-shim.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-09-12 15:11:49 -07:00
J Logan 243115504e Use containerization 0.7.1. (#606)
- Makes available the proxy utility from containerization#288.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
The proxy utility allows forward progress on #533.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-12 12:49:57 -07:00
Dmitry Kovba 32e8c23265 Remove per-target concurrency checking (#601)
With `swift-tools-version: 6.2`, strict concurrency checking is enabled
by default - there is no need to enable it explicitly.
2025-09-11 11:42:02 -07:00
Danny Canter 8f6f39e89b Package.swift: Bump CZ to 0.7.0 (#584)
Closes #585

Has a fix for if a uid doesn't exist in /etc/passwd.
2025-09-08 11:35:30 -07:00
Danny Canter b50dc253e9 Bump CZ to 0.6.2 (#543)
Hopefully fixes CI..
2025-08-26 10:39:07 -07:00
Danny Canter 7f7090ff87 Bump CZ to 0.6.1 (#540)
This has one change since 0.6.0 that just adds a log in the guest to see
the spec for any execed processes.
2025-08-25 13:38:21 -07:00
J Logan 6767144d43 Bump containerization dependency to 0.6.0 (#526) 2025-08-19 18:58:09 -07:00
J Logan 07679d99c7 Extract version output logic so --version is consistent. (#517) 2025-08-18 10:27:27 -07:00
Sidhartha Mani 0885cdd6a9 Native Builder: DiffKey and Differ Procol (#482)
This PR introduces the `Differ` with methods:

```swift
// Differ protocol
func diff(base: Snapshot?, target: Snapshot) async throws -> Descriptor
func apply(descriptor: Descriptor, to base: Snapshot?) async throws -> Snapshot
```

It also introduces `DiffKey`, which is a MerkeTree based key for fast
diff computations between two dirs
2025-08-12 11:23:55 -07:00
J Logan 6242706c66 Fixes for install root and plugin detection. (#467)
- Sets up API server as source of truth for installation root, similarly
to what was done for the data root. `system start` establishes the
install root, setting the environment variable `CONTAINER_INSTALL_ROOT`
when launching the API server.
- The API server propagates the environment variable when launching
helpers, and returns the install root to the CLI via the health check
XPC.
- Includes several fixes for detecting plugins that use app bundle
layout.
2025-08-08 21:44:26 -07:00
J Logan d242864e9f Relocate and rename ClientDefaults. (#474)
- Part of #384.
- Rename to reflect that these are not just client defaults.
- Relocate so callers don't need the heavyweight coupling to
ContainerClient to access the type.
2025-08-08 16:04:32 -07:00
J Logan 88223d8add Select alternate data path with container system start --app-root path. (#419)
Closes #418.
2025-08-06 14:49:09 -07:00
Dmitry Kovba 9e9d056339 Transition to Mutex (#364)
Due to the reduced use of the macro, we can now fully transition to
`Mutex`.
2025-07-31 13:36:18 -07:00
Kathryn Baldauf 16f2630126 Add initial native builder code (#399)
We're working on making a pure swift container image build system that
leverages containerization. This PR represents our initial design and
initial work towards this goal.

The native builder is still in active development and most of the
implementation has not been started or completed. We will be opening a
series of issues that represent various (but not necessarily all) pieces
of work that need to be done here.

There are docs included in this PR that describe the overall design of
each component and outline some of our goals. The easiest way to view
the docs by themselves (since this is a massive PR) is to look at the
docs commit in the `Commits` tab.

We'd love any feedback! 

@wlan0

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-31 13:13:20 -07:00
Danny Canter ccd15edc16 Bump Containerization to 0.5.0 (#363)
0.5.0 introduces a new way to configure the containers and execs. This
is now done all upfront at constructor time in a callback style. I'm
very happy with the config improvements, but because IO can only be
setup at constructor time this makes it so that we need to supply IO at
creation time of the VM or exec, which isn't the end of the world. All
that really changes is `boostrap()` and `createProcess()` now take in IO
instead of slightly later in `process.start()`
2025-07-29 16:02:19 -04:00
Sidhartha Mani cc4a85bb09 add support for local build output (#369)
Fixes https://github.com/apple/container/issues/354
2025-07-23 15:59:28 -07:00
Sidhartha Mani f68919c137 [Build] fixes for tar output mode (#353)
Fixes https://github.com/apple/container/issues/347
2025-07-18 16:50:11 -07:00
J Logan 1de3036f9a Adds TCP and UDP port forwarders. (#338) 2025-07-18 12:08:52 -07:00
Kathryn Baldauf b2e7cb5e87 Add test for using previous stages as FROM source (#342)
Depends on https://github.com/apple/container-builder-shim/pull/38 and a
new builder image tag
Related to https://github.com/apple/container/issues/334

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-16 14:35:29 -07:00
Dmitry Kovba f889c1bf76 Use the new @SendablePropertyUnchecked macro (#332)
Changes in this PR require merging
https://github.com/apple/containerization/pull/212 in containerization
and creating a new tag.
2025-07-14 16:57:55 -07:00
Kathryn Baldauf f0d82d2032 Handle when keychain query returns an unhandled error (#331)
Depends on https://github.com/apple/containerization/pull/210
Related to https://github.com/apple/container/issues/254

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-14 14:52:12 -07:00
J Logan 7272328cf3 Use swift package edit instead of CONTAINERIZATION_PATH. (#318)
- Closes #294.
2025-07-09 14:06:28 -07:00
Sidhartha Mani 3c71bdc98d [Build] update builder shim to 0.3.0 (#288) 2025-07-01 16:39:56 -07:00
Aditya Ramani 4bfa6c29ec Add unpack strategy to SnapshotStore (#274)
Define a `UnpackStrategy` function type in the `SnapshotStore` to give
more control over how an image is unpacked.

Previously, we were creating a 512 GB sparse block file for the initial
file system of a container, which is overkill.

With this change, the vminit image is unpacked to a smaller block file,
while container images are unpacked to the 512 GB block

Follows the same pattern as
https://github.com/apple/container/blob/main/Sources/Helpers/RuntimeLinux/RuntimeLinuxHelper.swift#L71

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-07-01 11:22:22 -04:00
J Logan 3b5c253059 Adds container network for macOS 26. (#243)
See discussion below for example. For multiple network interfaces in a
single container we'll want to integrate against a containerization that
includes apple/containerization#156.

The change bumps the containerization dependency to 0.2.0 and addresses
the breaking API changes.

```console
% container network
OVERVIEW: Manage container networks

USAGE: container network <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  create                  Create a new network
  delete, rm              Delete one or more networks
  list, ls                List networks
  inspect                 Display information about one or more networks

  See 'container help network <subcommand>' for detailed help.
```
2025-06-27 14:12:29 -07:00
Kathryn Baldauf 4a6a1f15d8 Add test that we replace meta args in builder correctly (#255)
Depends on https://github.com/apple/container-builder-shim/pull/24 

Related to https://github.com/apple/container/issues/252

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-24 13:25:58 -07:00
Dmitry Kovba 51c1b879d2 Update to Swift 6.2 (#195)
This PR updates to Swift 6.2 and resolves a build error after updating
to Swift 6.2-snapshot in
https://github.com/apple/containerization/pull/94.
2025-06-13 17:27:50 -07:00
Kathryn Baldauf 878ebbda2e Add default year for hawkeye formatting (#180)
This adds a default year to use when a file does not yet have git
attributes (aka for a newly created file).

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-13 09:50:05 -07:00
Dmitry Kovba 206f3cc07c Improve accuracy of progress updates (#144)
This PR resolves the problem of dropped progress updates and ensures the
accuracy of the information provided in the progress bar. Additionally,
it adds the displaying of the finished state to the progress bar.
Requires merging and tagging
https://github.com/apple/containerization/pull/91.
2025-06-12 23:36:38 -07:00
Kathryn Baldauf 3838be5207 Update protos and add builder shim version in Package.swift (#176)
This PR updates the protos to match the recent changes in
https://github.com/apple/container-builder-shim/pull/15.

This PR additionally adds the builder shim version as a variable in
Package.swift. This allows us to be consistent with the builder tag used
for the builder shim image and when building protobuf files.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-12 10:51:00 -07:00
J Logan 2d262dc0fc Removes build variable that is not needed after launch. (#151) 2025-06-11 13:21:53 -07:00
LamTrinh.Dev f4383d78dd Append .git for dependencies in Package.swift for consistency. (#82)
Append `.git` for `dependencies` in `Package.swift` for consistency.
2025-06-10 15:54:41 -07:00
Aditya Ramani 523cfe4f52 Bump to using Containerization 0.1.0 (#50)
Also update the `container-builder-shim` image to 0.1.0

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-06-09 11:18:49 -07:00
Aditya Ramani 33782141fb Bump to using Containerization 0.0.4 (#45)
- Includes updates for setting MTU to 1280
- Also includes bug fixes for LinuxContainer IO streams
2025-06-08 21:34:31 -07:00
Kathryn Baldauf 7523d68251 Update to containerization 0.0.3 (#21)
Update containerization to take new breaking changes
https://github.com/apple/containerization/pull/22

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-06 14:39:51 -07:00
Kathryn Baldauf 31a0cb2f4e Update alpine images used (#1)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-05 15:52:13 -07:00
Kathryn Baldauf 8e9670c8f8 Initial commit
Co-authored-by: Aditya Ramani <a_ramani@apple.com>
Co-authored-by: Agam Dua <agam_dua@apple.com>
Co-authored-by: Danny Canter <danny_canter@apple.com>
Co-authored-by: Dmitry Kovba <dkovba@apple.com>
Co-authored-by: Eric Ernst <eric_ernst@apple.com>
Co-authored-by: Evan Hazlett <ehazlett@apple.com>
Co-authored-by: Gilbert Song <gilbertsong@apple.com>
Co-authored-by: Hugh Bussell <hbussell@apple.com>
Co-authored-by: John Logan <john_logan@apple.com>
Co-authored-by: Kathryn Baldauf <k_baldauf@apple.com>
Co-authored-by: Madhu Venugopal <mvenugopal@apple.com>
Co-authored-by: Michael Crosby <michael_crosby@apple.com>
Co-authored-by: Sidhartha Mani <sidhartha_mani@apple.com>
Co-authored-by: Tanweer Noor <tnoor@apple.com>
Co-authored-by: Ximena Perez Diaz <xperez528@gmail.com>
Co-authored-by: Yibo Zhuang <yzhuang@apple.com>
2025-06-05 15:51:55 -07:00