getumbrel / umbrel-dev

Automatically initialize and manage an Umbrel development environment
20 stars 15 forks source link

Multiarch support #29

Closed nevets963 closed 2 years ago

nevets963 commented 2 years ago

This branch adds multiarch support by using parallels for virtualisation on M1 Macs. All other platforms continue to use virtualbox. It uses NFS for the file share in attempt to resolve permission issues when using the virtualbox shared folder driver.

It automatically detects the vagrant provider that should be used by checking OS and arch. You can override this detection by setting the env. var. UMBREL_DEV_PROVIDER. eg. UMBREL_DEV_PROVIDER=parallels umbrel-dev boot

lukechilds commented 2 years ago

I'm getting this error on M1:

$ umbrel-dev boot
Traceback (most recent call last):
        14: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `<main>'
        13: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `new'
        12: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:178:in `initialize'
        11: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:984:in `process_configured_plugins'
        10: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:957:in `find_configured_plugins'
         9: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:957:in `each'
         8: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:959:in `block in find_configured_plugins'
         7: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:237:in `machine_config'
         6: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:201:in `block in machine_config'
         5: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:280:in `find'
         4: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:456:in `with_collection_lock'
         3: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:456:in `synchronize'
         2: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:457:in `block in with_collection_lock'
         1: from /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:281:in `block in find'
/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/box_collection.rb:389:in `dir_name': undefined method `gsub!' for true:TrueClass (NoMethodError)

Any ideas?

This is the exact line in the Vagrant source: https://github.com/hashicorp/vagrant/blob/v2.2.19/lib/vagrant/box_collection.rb#L389

FWIW if I checkout the parallels branch everything works correctly.

nevets963 commented 2 years ago

@lukechilds My bad, somehow I didn't git push a fix for that. Can you try again.

lukechilds commented 2 years ago

@nevets963 you absolute hero this is working flawlessly for me on M1 now, great work! bindfs seems like a great solution.

Would be great to transition to VMware as the backend (should only require minor tweaks) but lets not worry about that right now since this is working, we can come back to it after the next Umbrel release. Also since NFS + bindfs works so well we may as well just use it on all platforms to keep things consistent so we can drop the idea of using VMWare shared folders on VMWare.

lukechilds commented 2 years ago

Also a nice side affect is that chokidar fs events now work we don't need to rely on polling and can drop this: https://github.com/getumbrel/umbrel-dashboard/blob/67e092e2579daa134ccfefda2fea17d3145839ea/Dockerfile.dev#L6-L9

lukechilds commented 2 years ago

Testing VMware now, also just checking you saw this? https://github.com/getumbrel/umbrel-dev/pull/29#discussion_r834957683

lukechilds commented 2 years ago

Excellent work, really happy with the bindfs solution!