Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare stage: support TART_EXECUTOR_ROOT_DISK_OPTS environment variable #96

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,21 @@ that required paid sponsorship upon exceeding a free limit.

| Name | Default | Description |
|---------------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `TART_EXECUTOR_SSH_USERNAME` | admin | SSH username to use when connecting to the VM |
| `TART_EXECUTOR_SSH_PASSWORD` | admin | SSH password to use when connecting to the VM |
| `TART_EXECUTOR_SSH_PORT` | 22 | Connect to the VM at the given SSH port |
| `TART_EXECUTOR_RANDOM_MAC` | true | Generate a new MAC address and therefore use a unique local IP address for every cloned VM |
| `TART_EXECUTOR_HEADLESS` | true | Run the VM in headless mode (`true`) or with GUI (`false`) |
| `TART_EXECUTOR_ALWAYS_PULL` | true | Always pull the latest version of the Tart image (`true`) or only when the image doesn't exist locally (`false`) |
| `TART_EXECUTOR_INSECURE_PULL` | false | Set to `true` to connect the OCI registry via insecure HTTP protocol |
| `TART_EXECUTOR_PULL_CONCURRENCY` | | Override the Tart's default network concurrency parameter (`--concurrency`) when pulling remote VMs from the OCI-compatible registries |
| `TART_EXECUTOR_SOFTNET` | false | Whether to enable [Softnet](https://github.com/cirruslabs/softnet) software networking (`true`) or disable it (`false`) |
| `TART_EXECUTOR_SOFTNET_ALLOW` | | Comma-separated list of CIDRs to allow the traffic to when using Softnet isolation |
| `TART_EXECUTOR_BRIDGED` | | Use bridged networking, for example, "en0". Use `tart run --net-bridged=list` to see names of all available interfaces. |
| `TART_EXECUTOR_HEADLESS` | true | Run the VM in headless mode (`true`) or with GUI (`false`) |
| `TART_EXECUTOR_HOST_DIR`<sup>1</sup> | false | Whether to mount a temporary directory from the host for performance reasons (`true`) or use a directory inside of a guest (`false`) |
| `TART_EXECUTOR_SHELL` | system default | Alternative [Unix shell](https://en.wikipedia.org/wiki/Unix_shell) to use (e.g. `bash -l`) |
| `TART_EXECUTOR_INSECURE_PULL` | false | Set to `true` to connect the OCI registry via insecure HTTP protocol |
| `TART_EXECUTOR_INSTALL_GITLAB_RUNNER` | | Set to `brew` to install GitLab Runner [via Homebrew](https://docs.gitlab.com/runner/install/osx.html#homebrew-installation-alternative), `curl` to install the latest version [using cURL](https://docs.gitlab.com/runner/install/osx.html#manual-installation-official) or `major.minor.patch` to install a specific version [using cURL](https://docs.gitlab.com/runner/install/bleeding-edge.html#download-any-other-tagged-release) |
| `TART_EXECUTOR_PULL_CONCURRENCY` | | Override the Tart's default network concurrency parameter (`--concurrency`) when pulling remote VMs from the OCI-compatible registries |
| `TART_EXECUTOR_RANDOM_MAC` | true | Generate a new MAC address and therefore use a unique local IP address for every cloned VM |
| `TART_EXECUTOR_ROOT_DISK_OPTS` | | When set, this value will be passed to `tart run`'s `--root-disk-opts` command-line argument. |
| `TART_EXECUTOR_SHELL` | system default | Alternative [Unix shell](https://en.wikipedia.org/wiki/Unix_shell) to use (e.g. `bash -l`) |
| `TART_EXECUTOR_SOFTNET_ALLOW` | | Comma-separated list of CIDRs to allow the traffic to when using Softnet isolation |
| `TART_EXECUTOR_SOFTNET` | false | Whether to enable [Softnet](https://github.com/cirruslabs/softnet) software networking (`true`) or disable it (`false`) |
| `TART_EXECUTOR_SSH_PASSWORD` | admin | SSH password to use when connecting to the VM |
| `TART_EXECUTOR_SSH_PORT` | 22 | Connect to the VM at the given SSH port |
| `TART_EXECUTOR_SSH_USERNAME` | admin | SSH username to use when connecting to the VM |
| `TART_EXECUTOR_TIMEZONE` | | Timezone to set in the guest (or `auto` to pick up the timezone from host), see `systemsetup listtimezones` for a list of possible timezones |

<sup>1</sup>: to use the directory mounting feature, both the host and the guest need to run macOS 13.0 (Ventura) or newer.
Expand Down
1 change: 1 addition & 0 deletions internal/tart/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Config struct {
SoftnetAllow string `env:"SOFTNET_ALLOW"`
Headless bool `env:"HEADLESS" envDefault:"true"`
RandomMAC bool `env:"RANDOM_MAC" envDefault:"true"`
RootDiskOpts string `env:"ROOT_DISK_OPTS"`
AlwaysPull bool `env:"ALWAYS_PULL" envDefault:"true"`
InsecurePull bool `env:"INSECURE_PULL" envDefault:"false"`
PullConcurrency uint8 `env:"PULL_CONCURRENCY"`
Expand Down
4 changes: 4 additions & 0 deletions internal/tart/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ func (vm *VM) Start(
}
}

if config.RootDiskOpts != "" {
runArgs = append(runArgs, "--root-disk-opts", config.RootDiskOpts)
}

if config.Bridged != "" {
runArgs = append(runArgs, "--net-bridged", config.Bridged)
}
Expand Down