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

Rosetta support for Finch #218

Closed
mediouni-m opened this issue Feb 13, 2023 · 0 comments · Fixed by #282
Closed

Rosetta support for Finch #218

mediouni-m opened this issue Feb 13, 2023 · 0 comments · Fixed by #282
Labels
enhancement New feature or request

Comments

@mediouni-m
Copy link

What is the problem you're trying to solve?.
Running x86_64 applications in a relatively fast manner on Finch. Qemu has a number of bugs and underperforms by quite a bit performance-wise.

Describe the feature you'd like
Rosetta for Linux is already supported by Lima when using the Apple VMM through Virtualization.framework. As such, enable this support for Finch.

Additional context

This feature requires macOS Ventura.

By default, we might want to have a separate VM for x86_64 and arm64 containers. This is because VMs with Rosetta for Linux support enabled come with always on TSO. As that scenario has stronger memory ordering guarantees than what the Arm architecture mandates, the downside of this is not catching a number of concurrency bugs when running locally.

Rosetta for Linux only covers 64-bit x86 applications. It doesn't attempt to cover the 32-bit x86 apps scenario.

@weikequ weikequ added the enhancement New feature or request label Feb 16, 2023
pendo324 added a commit that referenced this issue Mar 28, 2023
Issue #, if available: Closes #218 

*Description of changes:*
Adds support for Lima's Virtualization.framework and Rosetta features,
through the use of new finch.yaml configuration options (`vmType` and
`rosetta`). `vmType` also sets the `mountType` to `virtiofs`, since that
is only available when using Virtualization.framework.

To support this, a few things needed to be changed on our side:
- Disk migration. Although lima-vm/lima#1405
(which adds persistent disk support to `vmType: vz` in Lima) will
auto-convert persistent disks from QCOW2 to RAW when they are attempted
to be used with `vmType: vz`, because of the way our disks are persisted
with symlinks, we also have to do this
- Move some hardcoded lima config from finch.yaml to be programatically
toggled in `pkg/config/lima_config_applier`
- This allows things like the qemu user mode scripts to be installed
only when they are needed. Installing them all the time, and then trying
to use Rosetta as a binformat_misc handler causes conflicts
- This also opens up possibilities of future customization based on
Finch's config values

Currently, because lima-vm/lima#1405 is not
merged yet, this PR references [a specific branch of my own finch-core
repo](https://github.com/pendo324/finch-core/tree/lima-with-vz-extra-disk)
which includes the Lima change already. It also edits the Makefile to do
a build of Lima from the submodule directly, and overwrite the Lima
downloaded from the archive. These changes will be removed once the Lima
change is merged upstream.

*Testing done:*
   - unit tests
   - e2e tests
   - local testing on Intel and Apple Silicon machines

- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants