* GC avoidance and tmpDeterminstic
* change tmpDeterministic to use hashing
- temporaryDeterministic() now takes in a key and hashes it
- creates directory with the hash
* Update Sources/tart/VMStorageOCI.swift
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* Don't delete an initiator of pruning
Sometimes people have an image that is greater than half of the disk itself. In that case such image will be pulled and prunned right away.
This change makes sure that an image that is being cloned from is not pruned right away.
* Resolve symbolic links
* Allow mounting a single directory without a name
To utilize `VZSingleDirectoryShare` which seems more stable than `VZMultipleDirectoryShare`.
We've been having reports from users that mounted directories occasionally return "no such file" errors when building large projects. I took a stab at reproducing the issue by running https://github.com/devMEremenko/XcodeBenchmark in a mounted directory:
```bash
tart run --dir=workdir-test:~/workspace-temp/XcodeBenchmark ventura-xcode
```
And I was able to reproduce the "no such file" error on the first try! After looking into the issue I decided to try `VZSingleDirectoryShare` as this PR changes and to my pleasant surprise it all worked like a charm the next run. So it seems there is a bug in `VZMultipleDirectoryShare` integration with virtiofs. Since in most cases users only mount a single directory it makes sense to allow doing it wihtout providing a `name`.
So now it will be possible to run the following command:
```bash
tart run --dir=~/workspace-temp/XcodeBenchmark ventura-xcode
```
Which will make `~/workspace-temp/XcodeBenchmark` available under `/Volumes/My Shared Files/` without any intermediate directories.
* Reformat
* Updated description
* Suspend/resume support
* Use RuntimeError.SuspendFailed for consistency's sake
* Add a comment about "Running" field deprecation
* Use compute credits
* Use Mac-specific input devices and remove --no-{audio,entropy}
* Suspend the VM when closing window and running with --suspendable
* Snapshotting Improvements (#539)
* Don't use static field for arguments
It throws a runtime error
* Fixed suspendability
* Lazy generation of new MAC addresses
To support cloning on suspended VMs
* Refactored
* formatted
* Configurable signal for window closing
* reformatted
* Don't generate MAC only for suspended VMs
* Removed misleading comment
* Reverted
* Lock while a suspendable VM is starting
* Lock on TART_HOME
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* Optimistically check if we need to do anything on a pull
Right now on a pull we always acquire a lock for a registry host. This is problematic because, for example, host can be pulling `ghcr.io/cirruslabs/macos-ventura-xcode:15-beta-2` image when a new request will come to pull `ghcr.io/cirruslabs/macos-ventura-xcode:latest` if needed.
In this situation, even though `ghcr.io/cirruslabs/macos-ventura-xcode:latest` is already cached and linked, `tart pull` will wait for a lock.
This change optimistically check if there is something to do at all before acquiring a lock.
* Fix linter errors
---------
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* tart push: allow pushing OCI VMs from the cache too
* Check for RemoteName earlier
* Refactored pushing of OCI images under new tag (#466)
* Refactored pushing of OCI images under new tag
* Fixed compilation
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* tart list: show if the VM is running or not
* Boolean "running" field instead of "state", similarly to "tart get"
* Re-use VMDirectory.running() in "tart get"
* Option to pass externally created serial console
See https://github.com/cirruslabs/tart/pull/364#issuecomment-1472111742 for details
* Fixed compilation
* Apply suggestions from code review
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
---------
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* support ZVirtioConsoleDevice for linux vm, user can control the vm via serial port with screen command
* cleanup code, fix indent
* add --serial option to tart
* remove serial in vmconfig, fix Serial.swift
---------
Co-authored-by: peternguyen93 <peternguyen9321@gmail.com>
Co-authored-by: peter <peter@starlabs.sg>
* JSON output for `get` and `list` commands
In the light of the upcoming `1.0.0` release and stabilizing of the API, let's introduce some breaking changes for the good.
Removed all the `--cpu`, `--memory`, `--disk` and `--display` flags and replaced with a single `--json` flag for machine-readable output.
Added `--json` option to the `list` command to output a single JSON list. Notably removed `--quite` flag since it seemed unnecessary.
Fixes#297
* Added Size to `list` output
Fixes#379
* Added running state to `get`
Fixes#393
* Better signature
* Updated tests
* More test fixes