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

exp(feat): enable Virtualization.framework and Rosetta #282

Merged
merged 20 commits into from
Mar 28, 2023

Conversation

pendo324
Copy link
Member

@pendo324 pendo324 commented Mar 10, 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 feat: mount additional disks when using vz 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 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

  • 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.

BEGIN_COMMIT_OVERRIDE

exp(feat): enable Virtualization.framework and Rosetta (#282)

END_COMMIT_OVERRIDE

@pendo324 pendo324 added the enhancement New feature or request label Mar 10, 2023
@pendo324 pendo324 requested a review from ningziwen March 10, 2023 23:19
@pendo324 pendo324 self-assigned this Mar 10, 2023
@pendo324
Copy link
Member Author

All of the lint failures finally helped me fix my lint-on-save. Apparently I had to do a >Go: install/update tools in VSCode. It was throwing a very cryptic error before that golangci/golangci-lint#3533.

.gitmodules Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@ningziwen
Copy link
Member

Need e2e tests and README.md change

@pendo324
Copy link
Member Author

Need e2e tests and README.md change

Added some basic e2e tests for the two new scenarios and updated the README.

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
…osetta

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
@pendo324 pendo324 marked this pull request as ready for review March 27, 2023 17:33
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
increase test timeout

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
pkg/config/config.go Outdated Show resolved Hide resolved
finch.yaml Show resolved Hide resolved
finch.yaml Show resolved Hide resolved
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
ningziwen
ningziwen previously approved these changes Mar 28, 2023
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
@pendo324
Copy link
Member Author

Merging, and will investigate the Rosetta test failure as a separate issue

@pendo324 pendo324 enabled auto-merge (squash) March 28, 2023 17:06
@pendo324 pendo324 disabled auto-merge March 28, 2023 17:06
@pendo324 pendo324 merged commit fd3bf19 into runfinch:main Mar 28, 2023
pendo324 added a commit that referenced this pull request Mar 28, 2023
Issue #, if available:

*Description of changes:*
- Add a new "expr" PR type to track experimental features. An
"experimental" feature is something that can be used, but is not
guaranteed to be stable (such as the changes made by #282).

*Testing done:*
  - N/A


- [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>
@pendo324 pendo324 changed the title feat: enable Virtualization.framework and Rosetta exp(feat): enable Virtualization.framework and Rosetta Mar 28, 2023
@pendo324 pendo324 changed the title exp(feat): enable Virtualization.framework and Rosetta exp(feat): enable Virtualization.framework and Rosetta Mar 28, 2023
sam-berning pushed a commit that referenced this pull request Mar 29, 2023
🤖 I have created a release *beep* *boop*
---


## [0.5.0](v0.4.1...v0.5.0)
(2023-03-29)


### Features

* adds support bundles
([#210](#210))
([cc6be65](cc6be65))


### Bug Fixes

* Correctly set and pick up environment variables
([#315](#315))
([05227ce](05227ce))
* print debug logs after newline
([#273](#273))
([8faa7de](8faa7de))
* print debug logs when lima disk command fails
([#270](#270))
([78a3f50](78a3f50))


### Experimental

* **feat:** enable Virtualization.framework and Rosetta
([#282](#282))
([fd3bf19](fd3bf19))


### Build System or External Dependencies

* clean up finch-core _output directory in clean target
([#290](#290))
([4684a95](4684a95))
* **deps:** bump github.com/onsi/ginkgo/v2 from 2.8.4 to 2.9.0
([#265](#265))
([7e2d49e](7e2d49e))
* **deps:** bump github.com/onsi/ginkgo/v2 from 2.9.0 to 2.9.1
([#285](#285))
([d741a03](d741a03))
* **deps:** Bump github.com/onsi/gomega from 1.27.3 to 1.27.5
([#312](#312))
([e078234](e078234))
* **deps:** bump github.com/runfinch/common-tests from 0.6.1 to 0.6.2
([#300](#300))
([dd626a0](dd626a0))
* **deps:** bump github.com/spf13/afero from 1.9.4 to 1.9.5
([#263](#263))
([a0e277f](a0e277f))
* **deps:** bump golang.org/x/crypto from 0.6.0 to 0.7.0
([#264](#264))
([ec1c07f](ec1c07f))
* **deps:** bump golang.org/x/tools from 0.6.0 to 0.7.0
([#268](#268))
([8072e39](8072e39))
* **deps:** bump k8s.io/apimachinery from 0.26.2 to 0.26.3
([#306](#306))
([fe392cb](fe392cb))
* **deps:** Bump lima version
([#302](#302))
([0269743](0269743))
* **deps:** Bump submodules
([#281](#281))
([d4fd1f6](d4fd1f6))
* **deps:** Bump submodules
([#304](#304))
([b38af9f](b38af9f))
* **deps:** Bump submodules
([#307](#307))
([1a914ec](1a914ec))
* **deps:** Bump submodules
([#319](#319))
([e671224](e671224))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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 this pull request may close these issues.

Rosetta support for Finch
2 participants