Skip to content

Commit 5b83b4a

Browse files
authored
Rename config file to config.toml. (apple#1568)
- Closes apple#1565. - `runtime-config.toml` suggested the config pertains to just the runtime (managing container workloads) aspect of the system. - Also renames `ADDR` columns to `IP` in `container ls` and `container builder status`.
1 parent f8f7e2c commit 5b83b4a

8 files changed

Lines changed: 33 additions & 33 deletions

File tree

BUILDING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ to prepare your build environment.
8080
>
8181
> **Note:** If you have already run `swift package edit`, whether intentionally or by accident, follow the steps in the next section to restore the normal `containerization` dependency. Otherwise, the modified `Package.swift` file will not work, and the project may fail to build.
8282

83-
5. If you want `container` to use any changes you made in the `vminit` subproject of Containerization, set the init image in your runtime configuration file at `~/.config/container/runtime-config.toml`:
83+
5. If you want `container` to use any changes you made in the `vminit` subproject of Containerization, set the init image in your runtime configuration file at `~/.config/container/config.toml`:
8484

8585
```toml
8686
[vminit]
@@ -102,7 +102,7 @@ to prepare your build environment.
102102

103103
To revert to using the Containerization dependency from your `Package.swift`:
104104

105-
1. If you were using the local init filesystem, remove the `init` override from your `~/.config/container/runtime-config.toml` (or delete the `[vminit]` section if no other image settings are present).
105+
1. If you were using the local init filesystem, remove the `init` override from your `~/.config/container/config.toml` (or delete the `[vminit]` section if no other image settings are present).
106106

107107
2. Use the Swift package manager to restore the normal `containerization` dependency and update your `Package.resolved` file. If you are using Xcode, revert your `Package.swift` change instead of using `swift package unedit`.
108108

@@ -130,14 +130,14 @@ To test changes that require the `container-builder-shim` project:
130130

131131
1. Clone the [container-builder-shim](https://github.com/apple/container-builder-shim) repository and navigate to its directory.
132132

133-
2. After making the necessary changes, build the custom builder image, set it as the active builder image in `~/.config/container/runtime-config.toml`, and remove the existing `buildkit` container so the new image will be used:
133+
2. After making the necessary changes, build the custom builder image, set it as the active builder image in `~/.config/container/config.toml`, and remove the existing `buildkit` container so the new image will be used:
134134

135135
```bash
136136
container build -t builder .
137137
container rm -f buildkit
138138
```
139139

140-
Add the following to your `~/.config/container/runtime-config.toml`:
140+
Add the following to your `~/.config/container/config.toml`:
141141

142142
```toml
143143
[build]

Sources/ContainerCommands/Builder/BuilderStatus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private struct PrintableBuilder: ListDisplayable {
7777
}
7878

7979
static var tableHeader: [String] {
80-
["ID", "IMAGE", "STATE", "ADDR", "CPUS", "MEMORY"]
80+
["ID", "IMAGE", "STATE", "IP", "CPUS", "MEMORY"]
8181
}
8282

8383
var tableRow: [String] {

Sources/ContainerCommands/Container/ContainerList.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension Application {
5454

5555
extension PrintableContainer: ListDisplayable {
5656
static var tableHeader: [String] {
57-
["ID", "IMAGE", "OS", "ARCH", "STATE", "ADDR", "CPUS", "MEMORY", "STARTED"]
57+
["ID", "IMAGE", "OS", "ARCH", "STATE", "IP", "CPUS", "MEMORY", "STARTED"]
5858
}
5959

6060
var tableRow: [String] {

Sources/ContainerPersistence/ConfigurationLoader.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol LoadablePluginConfiguration: LoadableConfiguration {
3131
}
3232

3333
public enum ConfigurationLoader {
34-
private static let configFilename = "runtime-config.toml"
34+
private static let configFilename = "config.toml"
3535
private static let configDirectory = "config"
3636
private static let READ_ONLY: Int = 0o444
3737
private static let READ_AND_WRITE: Int = 0o644
@@ -50,12 +50,12 @@ public enum ConfigurationLoader {
5050
/// Returns the configuration file path under an explicit base directory.
5151
///
5252
/// Path shape depends on `kind`:
53-
/// - `.home`: `<base>/runtime-config.toml` (user source under `~/.config/container`)
54-
/// - e.g. `~/.config/container/runtime-config.toml`
55-
/// - `.appRoot`: `<base>/config/runtime-config.toml` (read-only copy of user config)
56-
/// - e.g. `~/Library/Application Support/com.apple.container/config/runtime-config.toml`
57-
/// - `.installRoot`: `<base>/etc/container/runtime-config.toml` (system defaults shipped with install)
58-
/// - e.g. `/usr/local/etc/container/runtime-config.toml`
53+
/// - `.home`: `<base>/config.toml` (user source under `~/.config/container`)
54+
/// - e.g. `~/.config/container/config.toml`
55+
/// - `.appRoot`: `<base>/config/config.toml` (read-only copy of user config)
56+
/// - e.g. `~/Library/Application Support/com.apple.container/config/config.toml`
57+
/// - `.installRoot`: `<base>/etc/container/config.toml` (system defaults shipped with install)
58+
/// - e.g. `/usr/local/etc/container/config.toml`
5959
///
6060
/// - Parameters:
6161
/// - base: Directory to resolve against.
@@ -83,8 +83,8 @@ public enum ConfigurationLoader {
8383
/// Load the `ContainerSystemConfig` by layering TOML files with first-match-wins precedence.
8484
///
8585
/// Providers are consulted in the order given — values from earlier files override
86-
/// later ones. The default order is user config (`<appRoot>/config/runtime-config.toml`)
87-
/// > system config (`<installRoot>/etc/container/config/runtime-config.toml`).
86+
/// later ones. The default order is user config (`<appRoot>/config/config.toml`)
87+
/// > system config (`<installRoot>/etc/container/config/config.toml`).
8888
///
8989
/// An empty `configurationFiles` array falls back to `defaultConfigFiles()`.
9090
///
@@ -186,9 +186,9 @@ public enum ConfigurationLoader {
186186
/// is deleted and replaced with a fresh copy, which is then marked read-only.
187187
///
188188
/// - Parameters:
189-
/// - source: File to copy from. Defaults to `<home>/container/runtime-config.toml`.
189+
/// - source: File to copy from. Defaults to `<home>/container/config.toml`.
190190
/// - destination: Directory to copy into — the filename is appended automatically.
191-
/// Defaults to `<appRoot>/config/runtime-config.toml`.
191+
/// Defaults to `<appRoot>/config/config.toml`.
192192
public static func copyConfigurationToReadOnly(
193193
from source: FilePath? = nil,
194194
to destination: FilePath? = nil

Sources/ContainerPersistence/ContainerSystemConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import ContainerVersion
1919
import ContainerizationExtras
2020
import Foundation
2121

22-
/// Top-level configuration decoded from runtime-config.toml.
22+
/// Top-level configuration decoded from config.toml.
2323
///
2424
/// Each section maps to a nested struct. Missing keys fall back to
2525
/// hardcoded defaults via custom `init(from:)` implementations.

Tests/ContainerPersistenceTests/ConfigurationLoaderTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ struct ConfigurationLoaderTests {
217217

218218
@Test func copyConfigToAppRoot() async throws {
219219
try await TemporaryStorage.withTempDir { tempDir in
220-
let source = tempDir.appending("runtime-config.toml")
220+
let source = tempDir.appending("config.toml")
221221
try Self.writeToml("[build]\ncpus = 8", to: source)
222222

223223
let destBase = tempDir.appending("dest")
224224
try ConfigurationLoader.copyConfigurationToReadOnly(from: source, to: destBase)
225225

226-
let destFile = destBase.appending("config").appending("runtime-config.toml")
226+
let destFile = destBase.appending("config").appending("config.toml")
227227
let copied = try String(contentsOf: URL(filePath: destFile.string), encoding: .utf8)
228228
#expect(copied.contains("cpus = 8"))
229229

@@ -235,7 +235,7 @@ struct ConfigurationLoaderTests {
235235

236236
@Test func copyConfigOverwritesExistingReadOnlyDestination() async throws {
237237
try await TemporaryStorage.withTempDir { tempDir in
238-
let source = tempDir.appending("runtime-config.toml")
238+
let source = tempDir.appending("config.toml")
239239
let destBase = tempDir.appending("dest")
240240

241241
try Self.writeToml("[build]\ncpus = 8", to: source)
@@ -244,7 +244,7 @@ struct ConfigurationLoaderTests {
244244
try Self.writeToml("[build]\ncpus = 16", to: source)
245245
try ConfigurationLoader.copyConfigurationToReadOnly(from: source, to: destBase)
246246

247-
let destFile = destBase.appending("config").appending("runtime-config.toml")
247+
let destFile = destBase.appending("config").appending("config.toml")
248248
let copied = try String(contentsOf: URL(filePath: destFile.string), encoding: .utf8)
249249
#expect(copied.contains("cpus = 16"))
250250

@@ -259,7 +259,7 @@ struct ConfigurationLoaderTests {
259259
let source = tempDir.appending("nonexistent.toml")
260260
let destBase = tempDir.appending("dest")
261261
try ConfigurationLoader.copyConfigurationToReadOnly(from: source, to: destBase)
262-
let destFile = destBase.appending("config").appending("runtime-config.toml")
262+
let destFile = destBase.appending("config").appending("config.toml")
263263
#expect(!FileManager.default.fileExists(atPath: destFile.string))
264264
}
265265
}

docs/how-to.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Use `container ls` to see that the container is on the `foo` subnet:
345345

346346
```console
347347
% container ls
348-
ID IMAGE OS ARCH STATE ADDR
348+
ID IMAGE OS ARCH STATE IP
349349
my-web-server web-test:latest linux arm64 running 192.168.65.2
350350
```
351351

@@ -360,7 +360,7 @@ Networks support both IPv4 and IPv6. When creating a network without explicit su
360360

361361
## Configure default network subnets
362362

363-
You can customize the default IPv4 and IPv6 subnets used for new networks by editing your runtime configuration file at `~/.config/container/runtime-config.toml`:
363+
You can customize the default IPv4 and IPv6 subnets used for new networks by editing your runtime configuration file at `~/.config/container/config.toml`:
364364

365365
```toml
366366
[network]
@@ -668,7 +668,7 @@ image = "ghcr.io/apple/containerization/vminit:0.30.1"
668668

669669
### Example: Disable Rosetta for builds
670670

671-
If you want to prevent the use of Rosetta translation during container builds on Apple Silicon Macs, set the following in `~/.config/container/runtime-config.toml`:
671+
If you want to prevent the use of Rosetta translation during container builds on Apple Silicon Macs, set the following in `~/.config/container/config.toml`:
672672

673673
```toml
674674
[build]

docs/tutorial.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If you haven't created any containers yet, the command outputs an empty list:
4242

4343
<pre>
4444
% container list --all
45-
ID IMAGE OS ARCH STATE ADDR
45+
ID IMAGE OS ARCH STATE IP
4646
%
4747
</pre>
4848

@@ -97,7 +97,7 @@ You can save keystrokes by abbreviating commands and options. For example, abbre
9797

9898
<pre>
9999
% container ls -a
100-
ID IMAGE OS ARCH STATE ADDR
100+
ID IMAGE OS ARCH STATE IP
101101
%
102102
</pre>
103103

@@ -113,7 +113,7 @@ sudo container system dns create test
113113

114114
Enter your administrator password when prompted. The first command requires administrator privileges to create a file containing the domain configuration under the `/etc/resolver` directory, and to tell the macOS DNS resolver to reload its configuration files.
115115

116-
With the domain set to `test`, if you use `--name my-web-server` to start a container, queries to `my-web-server.test` will respond with that container's IP address. You can customize the domain in `~/.config/container/runtime-config.toml`.
116+
With the domain set to `test`, if you use `--name my-web-server` to start a container, queries to `my-web-server.test` will respond with that container's IP address. You can customize the domain in `~/.config/container/config.toml`.
117117

118118
## Build an image
119119

@@ -182,11 +182,11 @@ container run --name my-web-server --detach --rm web-test
182182

183183
The `--detach` flag runs the container in the background, so that you can continue running commands in the same terminal. The `--rm` flag causes the container to be removed automatically after it stops.
184184

185-
When you list containers now, `my-web-server` is present, along with the container that `container` started to build your image. Note that its IP address, shown in the `ADDR` column, is `192.168.64.3`:
185+
When you list containers now, `my-web-server` is present, along with the container that `container` started to build your image. Note that its IP address, shown in the `IP` column, is `192.168.64.3`:
186186

187187
<pre>
188188
% container ls
189-
ID IMAGE OS ARCH STATE ADDR
189+
ID IMAGE OS ARCH STATE IP
190190
buildkit ghcr.io/apple/container-builder-shim/builder:0.0.3 linux arm64 running 192.168.64.2
191191
my-web-server web-test:latest linux arm64 running 192.168.64.3
192192
%
@@ -305,7 +305,7 @@ container image push some-registry.example.com/fido/web-test:latest
305305

306306
> [!NOTE]
307307
> By default `container` is configured to use Docker Hub.
308-
> You can change the default registry by setting `domain` under `[registry]` in `~/.config/container/runtime-config.toml`:
308+
> You can change the default registry by setting `domain` under `[registry]` in `~/.config/container/config.toml`:
309309
> ```toml
310310
> [registry]
311311
> domain = "some-registry.example.com"
@@ -338,7 +338,7 @@ If you list all running and stopped containers, you will see that the `--rm` fla
338338

339339
<pre>
340340
% container list --all
341-
ID IMAGE OS ARCH STATE ADDR
341+
ID IMAGE OS ARCH STATE IP
342342
buildkit ghcr.io/apple/container-builder-shim/builder:0.0.3 linux arm64 running 192.168.64.2
343343
%
344344
</pre>

0 commit comments

Comments
 (0)