* Support setting root disk synchronization mode
Adds a new VMConfig parameter (tart get / tart set) called 'sync' which
can be set to 'full' (default), 'fsync', or 'none', corresponding with
the values of VZDiskImageSynchronizationMode and allowing a tradeoff
between data integrity and speed.
* Remove unused import
* Fix formatting
* Make root disk sync behaviour a commandline option
* tart pull: try to re-use APFS blocks by cloning the base image
* Punch a hole when a zero chunk is detected
* Properly retrieve errno when hole punching operation fails
* tart pull: do not retry on RuntimeError
* Ensure that the holes we're about to punch are FS block size-aligned
* VMDirectory: remove unused static variables
* tart pull: log if we've found an image to deduplicate against
* Do not prematurely read contents from disk
* Only consider candidates with deduplicatedBytes more than 0
* APFS reuse UX/DX improvements (#870)
* Show how much deduplication happening
Improvement to the APFS deduplication logic which checks whether a disk image file `mayShareFileContent` with some other file, and then we put a custom attribute to track the deduplication since there is no way to get this information from APFS itself.
It's not 100% accurate but given that OCI cache is immutable the actual disk usage can only be lover than that.
* Use string attribute
* Update Sources/tart/URL+Prunable.swift
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Added SizeOnDisk colume
---------
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
This is accomplished by saving the OCI VM image manifests on "tart pull"
in "manifest.json" file and then using them on successive "tart pull"'s
to find the best candidate that results in the most de-duplication,
measured in bytes.
* Support remote VM names in --disk command-line argument
* tart set: introduce "--disk" to support replacing VM's disk contents
* Complete the code comment
For macOS this brings up a dialog, asking the user if they are sure
they want to shut down, which makes this less useful for automated
graceful shutdowns, but it may behave better on Linux, and there
might be ways to instruct macOS to not ask the user, so it's still
a nice feature, and aligns with the SIGUSR1 for suspend, and SIGINT
for non-graceful shutdown.
* Drop Monterey Support
People will still be able to run and SSH into Monterey VMs or use VNC but pointing devices/keyboard won't work.
Fixes#841
* Fixed x86 build
The latest release has this error:
> error: Project not found. Please check that you entered the project and organization slugs correctly.
Which seems indicating that Auth is broken and we are getting 404? In the Sentry Settings I didn't find any token which I find strange. So I created one and re-encrypted.
* Give Virtualization.framework a chance to stop the VM on tart stop
We were letting the CancellationError bubble up all the way until
it terminated app, which meant we didn't hit the shutdown code
in run(), stopping the VM and the network.
We now catch CancellationError and proceed to gracefully shut down.
We only stop the VM if it's still running, as a VM that has been
stopped via the menu can't be stopped again.
* Gracefully shut down VM when Tart is quit via menu
Normally the quit action will result in AppKit calling exit(),
but we want to gracefully shut down the VM, so we use the same
path as for closing of the VM window, namely signal our own
process with SIGINT or SIGUSR1.
If that doesn't work we let AppKit terminate as before.
This fixes the "Warning: NSActivity <_NSActivityAssertion:
0x600001f785a0> was ended multiple times" warning seen on
the console when quitting Tart via the menu.
* Activate Tart after application finishes launching
This ensures that the VM window has been shown by the time we
activate, so that we consistently activate and bring the VM
window to the front.
* Document how to mount the shared directory on Linux at boot time
* Use admonition
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* add VM completion for run command
* add VM completion for stop command
* create ShellCompletions utilities
* add shell completions to some commands
* add shell completion for fqn command
* run command: fix tiny typo
* add shell completion for get command
* more shell completions
* remove unnecessary `try`
* refactor ShellCompletions file
The URLSession async/await functions do not report progress through
the normal URLSessionTaskDelegate callbacks, as reported in:
https://developer.apple.com/forums/thread/723015
We don't want to use URLSession.bytes, as that results in a much
slower download speed compared to URLSession.download, but we can
work around the lack of progress callbacks by observing the
progress on the URLSessionTask itself.
Fixes#767