30 Commits

Author SHA1 Message Date
Kathryn Baldauf 811abf75bf Add checksum validation to hawkeye installation (#1869)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-30 11:08:49 -07:00
Harshit Singh Bhandari 79f797b879 Auto-install hawkeye in ensure-hawkeye-exists.sh (#1644)
- Fixes #1642.
- The `ensure-hawkeye-exists.sh` now actually
  ensures that hawkeye is installed. If it is not
  installed, the script informs that the installation
  uses `curl | sh` and asks the user to confirm
  before proceeding.
- Automated workflows can bypass the prompt
  by invoking the script with the `-y`/`--auto-install`
  option, or by setting the environment variable
  `HAWKEYE_AUTO_INSTALL=1`.
- Export HAWKEYE_AUTO_INSTALL=1  in every
  Git workflow job that runs make check, to
  ensure license/format checks don't stall.
2026-06-05 09:04:05 -07:00
J Logan c5a8d7a802 Reorganize Swift package targets for network plugin. (#1615)
- Part of #1404.
- Updates containerization to 0.33.2.
- Reorganizes network plugin targets into:
  - `ContainerNetworkClient` - network plugin client and default types
- `ContainerNetworkServer` - separate protocols for `Network` which
manages the underlying virtual network, `NetworkService`, which takes a
network and implements the API, and an actor `NetworkHarness` that
marshals between the API and the XPC protocol. The service-harness
separation will help us ensure XPC protocol compatibility in both
directions as we evolve the plugin APIs.
- Removes `disableAllocator()` which is no longer used since #1545
switched over to using XPC connections between runtime and network
plugin instances to track whether a network has attached containers.
2026-05-28 15:26:31 -07:00
AJ Emory afeceb05d4 Reorganize runtime targets for scalable plugin support (#1577)
## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Closes #1569

Separates generic runtime infrastructure from Linux-specific
implementation into distinct SPM targets:

- ContainerRuntimeClient — generic runtime plugin client API
- ContainerRuntimeLinuxClient — Linux-specific types
- ContainerRuntimeLinuxServer — Linux runtime service + interface
strategy implementations

Renames types to reflect the runtime/sandbox distinction:
- SandboxClient → RuntimeClient
- SandboxService → RuntimeService
- SandboxRoutes → RuntimeRoutes
- SandboxKeys → RuntimeKeys

Breaking for external consumers:
- ContainerSandboxService removed, replaced by ContainerRuntimeClient +
ContainerRuntimeLinuxServer
- Public types renamed

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2026-05-20 12:57:10 -07:00
Saehej Kang 2ee3f3d0a1 [scripts]: add prompt for updating container with unsigned package (#1468)
Closes #1467 and some minor QOL updates
2026-05-01 17:04:35 -07:00
Patrick Linnane fd2de35440 ensure-container-stopped.sh: don't fail on launchctl errors (#1461)
- Fixes #1281. Supersedes #1306.
- When `-a` runs as a regular user (such as via
  `brew install container`), two launchctl failures
  bubble up as a non-zero exit and break Homebrew's
  post-install:
  - `bootout` against `system` requires root.
  - `launchctl print` lists Mach endpoint names that
    aren't loaded jobs, so `bootout` returns
    `No such process` on them.
- Skip `system` when not root, and treat individual
  `bootout` failures as non-fatal. Same fix applied to
  the non-`-a` `xargs` pipeline.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-04-29 19:42:49 -07:00
J Logan 04c597c577 Update builder API to use grpc-swift-2. (#1309) (#1416)
- Closes #1308.
- Applies dependency and code changes similar to
apple/containerization#578.
- Upgrades hawkeye to latest version.
- Update StderrLogHandler not to create a (non-Sendable) Swift time
formatter object for every log message.
2026-04-20 08:39:43 -07:00
Eric Ernst f8ba57ebd2 Revert "Update builder API to use grpc-swift-2. (#1309)" (#1324)
This reverts commit 50900938c4, restoring
the grpc-swift-1 based builder API while preserving build secrets and
hidden docker dir support added in a00ec5c.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2026-03-18 01:33:21 -07:00
J Logan 85ec7ed543 Remove user defaults on userdata uninstall. (#1317)
- Closes #1316.
2026-03-16 17:34:08 -07:00
J Logan 50900938c4 Update builder API to use grpc-swift-2. (#1309)
- Closes #1308.
- Applies dependency and code changes similar to
apple/containerization#578.
- Upgrades hawkeye to latest version.
- Update StderrLogHandler not to create a (non-Sendable) Swift time
formatter object for every log message.
2026-03-16 10:33:36 -07:00
Saehej Kang 339a3895c0 [scripts]: add update-container script for upgrade/downgrades (#1173)
- Closes #1171
2026-02-24 17:52:13 -08:00
J Logan 3ad0914fd2 Fix CI integration test coldstart issues. (#1230)
- Closes #1206.
- Closes #1185.
- Closes #507.
- Addresses existing log messages for #642.
- Nondeterministic CI errors are resulting from very slow launch times
for the first runtime helper, which causes ContainersService to be
locked for longer than our 20 sec timeout. Bumping the timeout to 60
seconds addresses this case for now.
- Since many log messages needed to be changed to troubleshoot the
issue, updated all log messages to use structured logging, and
implemented consistent entry/exit logging for all service operations.
- Added logging for ContainerService lock acquisition to help with
finding root cause for the slow service startup.
- Plumbed the `--debug` flag on both `container system start` and
`container system logs` so that the flag is actually useful.
- Updated the `install-init.sh` script so that can install in a custom
app root directory.
2026-02-19 09:58:09 -08:00
William Laverty 5c8633703e Add explanatory message before admin password prompt in uninstall script (#1118)
- Added message: "This script requires an administrator password to
remove the application files from system directories."
- Fixes #1111
2026-02-02 13:57:59 -08:00
Patrick Linnane 14c279fcd2 Add option to stop services in all launchd domains (#1077)
- Services started from Terminal run in the `gui/$uid`
  launchd domain. When `ensure-container-stopped.sh`
  runs from a different context, `launchctl managername`
  may return a different domain, causing the script to
  check the wrong domain and miss running services.
  I noticed this after upgrading `container` via Homebrew.
- Introduces a getopt option `-a` that allows booting out all
  domains explicitly. Also adds `-h` for a usage message.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
2026-01-23 17:56:35 -08:00
J Logan b1577d8d07 Adds opt-in pre-commit hook for format and header checks. (#1062)
- Closes #639.
- Adds swift format configuration that removes lint checks so we can use
`swift lint` to perform format-only tests.
- Adds `check` target that invokes format and header checks.
- Adds pre-commit script that runs `make check`.
- Adds `pre-commit` target that installs the check script as a
pre-commit hook.

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

## Motivation and Context
Avoids wasting time and commit rewrites.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2026-01-16 15:50:47 -08:00
J Logan 356c8d2f88 Reorganize client libraries. (#1020)
- Closes #461.
- Extract core types into ContainerResources target.
- Extract ContainerNetworkServiceClient from ContainerNetworkService.
- Relocate sandbox client from ContainerClient to
ContainerSandboxServiceClient.
- Relocate ContainerClient to ContainerAPIServiceClient.
- Common structure from services and clients under Source/Services.

Updated project hierarchy:

```
Sources/CAuditToken - audit token access wrapper
Sources/CLI - CLI executable
Sources/ContainerBuild - builder
Sources/ContainerCommands - CLI command implementations
Sources/ContainerLog - logging helpers
Sources/ContainerPersistence - persistent data and system property helpers
Sources/ContainerPlugin - plugin system
Sources/ContainerResource - resource (container, image, volume, network) types
Sources/ContainerVersion - version helpers
Sources/ContainerXPC - XPC helpers
Sources/CVersion - injected project version
Sources/DNSServer - container DNS resolver
Sources/Helpers - service executables
Sources/Services/*/Client - service clients
Sources/Services/*/Server - service implementations
Sources/SocketForwarder - port forwarding
Sources/TerminalProgress - progress bar
```

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

## Motivation and Context
The ContainerClient library was a bit of a grab bag. This refactor
applies a more sensible project and library structure for resource data
types, services, and clients.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [ ] Added/updated docs
2026-01-06 08:27:14 -08:00
Kathryn Baldauf d6f052d206 Update license header on all files to include the current year (#1024)
## Motivation and Context
Now that we're in 2026, we need to update the license headers on all the
files. Unfortunately, Hawkeye doesn't have an attribute for the current
year to help us avoid this in the future. Instead, I had to work around
this by doing the following:

1. Update licenserc.toml with:
     ```
      [properties]
       ... (other properties)
       currentYear = "2026"
     ```
 
2. Update scripts/license-header.txt with
    ```
Copyright ©{{ " " }}{%- set created = attrs.git_file_created_year or
attrs.disk_file_created_year -%}{%- set modified = props["currentYear"]
-%}{%- if created != modified -%} {{created}}-{{modified}}{%- else
-%}{{created}}{%- endif -%}{{ " " }}{{ props["copyrightOwner"] }}.
    ```

Then I removed these two changes before committing. After this PR is
merged, all files will have recently had git updates, so the existing
code for setting the modified year should work as intended.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-01-05 13:09:34 -08:00
Dmitry Kovba 7e4eaddf30 Improvements to Makefile (#822) 2025-10-29 16:41:30 -07:00
GenkaOk d9ca04f553 Update make-docs.sh to prevent HTML errors (#771)
Fix 2 HTML errors:
1) Start tag seen without seeing a doctype first. Expected <!DOCTYPE
html>.
2) Element head is missing a required instance of child element title.
2025-10-16 14:56:48 -07:00
J Logan bfc5ca9222 Removes "all rights reserved" from license header. (#711)
Closes #63.
2025-10-03 13:28:16 -07:00
Kathryn Baldauf 2525d557ef Uninstaller: call usage if incorrect number of options are provided (#556)
This PR improves the user experience when using the uninstall script to
include usage output when an incorrect number of options are provided to
the script.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-08-29 14:19:44 -07:00
J Logan 7272328cf3 Use swift package edit instead of CONTAINERIZATION_PATH. (#318)
- Closes #294.
2025-07-09 14:06:28 -07:00
Dmitry Kovba de2be705de Remove the support for CURRENT_SDK (#251)
This PR removes the no longer needed support for `CURRENT_SDK`.
2025-06-26 10:40:34 -04:00
Dmitry Kovba 65e173333b Redirect to the documentation from the homepage (#245)
This PR fixes the homepage at https://apple.github.io/container/
2025-06-23 10:19:44 -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
J Logan 6690f6d076 Corrections and refinements for user documentation. (#35) 2025-06-07 21:00:47 -07:00
J Logan bc9865bb81 Removes docc targets we currently do not need. (#27) 2025-06-06 12:08:03 -07:00
Kathryn Baldauf ec4185fcc7 Publish docs github action (#9)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-05 15:53: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