lando icon indicating copy to clipboard operation
lando copied to clipboard

The Great Armification

Open dustinleblanc opened this issue 4 years ago • 55 comments

Lando is a wondrous chap, but he is currently only compatible with the x86 hardware found in the last great generation of Corellian Freighters, probably because of the traumatic experience of the loss of L3. Now that the great conflict has ended, and we're forming the new Republic, it's time for Lando to get up to date with the latest starship hardware, namely:

https://www.apple.com/macbook-pro-13/

and it would be super cool if he also could hang with https://www.raspberrypi.org/products/raspberry-pi-400/ (though this would be a bit more of a stretch).

We've known this was coming for a while, but now that release day is here (and we have hardware on order), we should start getting things ready for the new world.

some docs on docker things we probably need to do: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

dustinleblanc avatar Nov 11 '20 14:11 dustinleblanc

@dustinleblanc so the lando binary/installer obviously is going to need to be ARM ready. Luckily i dont think that will be a considerable challenge.

We should take some time to think about the docker image part of this though. It does not appear that bitnami intends to support ARM variants of their images. That is a problem. All the official docker images support ARM though. In my mind this could be a good opportunity to reimagine how we do a lot of our core services so that we

  1. Get things ready for the "Starbuck Maneuver" (v4)
  2. Remove our dependency on Bitnami
  3. Have offloaded the ARM concern to Docker eg we dont have our own images anymore

We could also consider ARM support just being a V4 thing use it as a forcing function both for us and the user to switch.

pirog avatar Nov 12 '20 14:11 pirog

Agreed on all of the above. When my new machine shows up, first thing I am going to see is if new Apple fanciness can load the x86 docker magic via the universal binary / rosetta 2 business. If that does work for some reason, that will definitely give us more wiggle room

dustinleblanc avatar Nov 12 '20 14:11 dustinleblanc

I'm one of those interested in an ARM port. I naively tried to install Lando on a RPI a couple of months ago (Lando documentation did not explain yet that it was x86 only). I know it seems a bit crazy to use a RPI for this but don't forget that the raspberry pi now offers RPI4 models with 8GB (NOT the Raspberry pi 400, unfortunately) , which can be enough in some cases especially if you develop headless, RESTful web services of some sort.

Not the main use case, I know, but if Lando is ported to a multi-arch build everybody is winning: Apple Silicon users, RPI users etc. Good luck!

pbattino avatar Nov 23 '20 10:11 pbattino

“We’ll be following your career with great interest.”

andrew-boyd avatar Dec 24 '20 13:12 andrew-boyd

@dustinleblanc - about 2 weeks ago my machine arrived. The docker tech preview from a little over a week ago is easy to install and run. At a glance, the list of known issues seems pleasantly benign. I've not looked further (unrelated issue with the machine; it's going back to Apple at their request). In any case, these teaser notes seemed worth posting. Interested to learn what others discover!

kay-o avatar Dec 28 '20 03:12 kay-o

fwiw, very recent DDEV pre-release with full M1 support.

kay-o avatar Jan 04 '21 12:01 kay-o

Yeah I saw that DDev got that out which is great! We've done some testing that has been promising, but we still have work to do.

dustinleblanc avatar Jan 04 '21 14:01 dustinleblanc

@dustinleblanc how can we help with Testing?

dwhoban avatar Jan 14 '21 05:01 dwhoban

I have access to an M1 MacBook Air - would also be happy to run through any processes that are helpful

andrew-boyd avatar Jan 14 '21 14:01 andrew-boyd

@andrew-boyd I got adventerous last night and did the following:

  1. Installed docker preview
  2. Installed Lando from source
  3. created a new project
  4. started new project
  5. It just worked 👍

Was a little slow on some things I did but otherwise all worked as expected. There are some more complex things I want to try today.

dwhoban avatar Jan 14 '21 21:01 dwhoban

@dwhoban I did the same - with an existing Laravel project from our org - to less success. 😆

Screen Shot 2021-01-12 at 9 46 20 PM

andrew-boyd avatar Jan 15 '21 20:01 andrew-boyd

@dwhoban I take it back! I must have borked something with that particular project. I've been able to install and run several projects successfully using the latest Docker preview build with Lando!

andrew-boyd avatar Jan 16 '21 21:01 andrew-boyd

Also had luck using Lando with an M1 MacBook Pro. Installed the Docker developer preview, installed Lando (3.0.25) customizing the install to not install Docker (which I recognize is not a supported configuration.) Created and started a Drupal 9 project that seemed to work fine.

If I run into any quirks as I continue to use it, I'll follow up here.

backlineint avatar Feb 20 '21 22:02 backlineint

Already ran into some quirks :)

Upon further restarts things seemed to be getting hung up on the message Scanning to determine which services are ready... Please standby... ? I was able to get past this by adding the following to .lando.yml as mentioned in this issue:

services:
  appserver:
    scanner: false

It works, but unsurprisingly seems to indicate that something funky is going on.

backlineint avatar Feb 21 '21 23:02 backlineint

I have used Lando successfully on my M1 MBP with the drupal8 and drupal9 recipes.

I have not gotten the pantheon recipe to work. The main issue (or at least the one I didn't get past) is that the edge container fails to start, so you get 404s for the lando URLs.

image

I assume there's some incompatibility with that varnish image.

jeffm2001 avatar Feb 25 '21 17:02 jeffm2001

As a workaround you CAN disable the edge, cache and index services in your Landofile. https://docs.lando.dev/config/pantheon.html#customizing-the-stack

On Thu, Feb 25, 2021 at 12:42 PM Jeff Mann [email protected] wrote:

I have used Lando successfully on my M1 MBP with the drupal8 and drupal9 recipes.

I have not gotten the pantheon recipe to work. The main issue (or at least the one I didn't get past) is that the edge container fails to start, so you get 404s for the lando URLs.

[image: image] https://user-images.githubusercontent.com/18371709/109193625-924fb980-7766-11eb-8c7d-d370dd8bf77f.png

I assume there's some incompatibility with that varnish image.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lando/lando/issues/2688#issuecomment-786080351, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOFUBT5ZVDTC44MI3GTMTTA2DW3ANCNFSM4TSBIK3A .

pirog avatar Feb 25 '21 17:02 pirog

Was looking at this more today, we might be able to just buy an M1 mini, set it up somewhere, install the GitHub runner app on it, and get arm builds rolling ourselves. https://gregmfoster.medium.com/using-m1-mac-minis-to-power-our-github-actions-ios-ci-540c55af13ea

dustinleblanc avatar Jul 14 '21 14:07 dustinleblanc

So how faster lando on mac M1 in comparison with lando (docksal) on intel based mac with virtual box?

Trying to decide if it is a time to sell my 32GB, i7 intel mac and buy mac with m1 for Drupal development.

So far, the bad part about development on intel based mac is that it either extremely slow (if using native docker) or drying the battery (if using the virtual box). Have also to say, that non of existing intel mac variant for development with docker is not that fast as native Linux + docker setup. I am curious, if that situation changed on m1 mac.

dstorozhuk avatar Sep 12 '21 20:09 dstorozhuk

Does anyone have a guide on how to change an existing Lando config to use ARM images if using an M1 Mac? Or would Lando automatically detect if someone is on ARM and use ARM Docker images if available?

rlorenzo avatar Oct 02 '21 07:10 rlorenzo

Adding a link to #3137 as that issue is a blocker to Pantheon recipes using Lando on an M1. (Though it looks like @reynoldsalec is actively working on a PR. 🎉 ) The current Pantheon recipe uses an Intel image and triggers qemu virtualization inside Docker Desktop. Two layers of virtualization is too much for Docker Desktop and can lead to strange failures that seem random. I would be curious is someone with an M1 Max has enough power and resources to make that moot. 🤔

Also, a note for anyone that may have .lando.yml service overrides, make sure none of your overrides are calling in Intel images. We had an example where we were adding PHP to our node service to allow Pattern Lab builds to work, but the PHP image we added in was Intel specific.

joshuami avatar Nov 12 '21 22:11 joshuami

Does anyone have a guide on how to change an existing Lando config to use ARM images if using an M1 Mac? Or would Lando automatically detect if someone is on ARM and use ARM Docker images if available?

Would love this as well. I'm specifically having my mariadb database container conk out on a Drupal 9 recipe, but only from large queries (like a db-import). I suspect it has something to do with using an emulated mariadb docker image, but... I can't figure out how to test using the ARM image. Noob life.

kencyong avatar Nov 13 '21 08:11 kencyong

@kencyong I found that Lando uses ARM based images when possible. But for the database images, they depend on Bitnami containers. ARM support is coming. Just watch https://github.com/bitnami/charts/issues/7305

They cannot commit to a timeline/timeframe, but they are working on it.

Once ARM-based Bitnami images are available, then I believe doing a lando rebuild will use the newer image.

rlorenzo avatar Nov 13 '21 08:11 rlorenzo

I was trying to run Lando today from source on an arm64 Ubuntu, but starting the default Drupal 9 recipe would crash with this error:

Error response from daemon: Invalid network mode: invalid container format container:<name|id>

Any updates on the progress of this Great Armification?

aleksijohansson avatar Dec 05 '21 03:12 aleksijohansson

@pirog mentioned "Remove our dependency on Bitnami". Will it happen? Still early 2022 is the goal for v4? Thank you

dcorb avatar Dec 07 '21 22:12 dcorb

Yes it will happen. Early 2022 is still the goal but will be hard to hit. Guessing if it happens by then its still going to be alpha-level and not yet 100% feature complete with v3 meaning if you have a lot of different kinds of projects running on lando you probably wont be able to switch all of them over to v4 right away.

pirog avatar Dec 07 '21 23:12 pirog

Thank you for all your work @pirog, definitely a big job.

Wondering if anybody has had any luck using custom images? I'm a big ol' noob, and I've tried to define using the docker versions of mariadb and nginx instead of the bitnami versions in lando.yml, but with no success so far.

kencyong avatar Dec 08 '21 00:12 kencyong

@kencyong I was just trying the same and failed as well. I tried it by overriding the database service, but maybe that is not the right approach. Would also appreciate some help in how/if its possible to use the official docker mariadb image with lando.

I tried it with that config:

database:
    type: mariadb:custom
    overrides: 
      image: mariadb:latest

But as said, this fails and i see this in the logs:

database_1         | lando 12:21:41.24 INFO  ==> Lando handing off to: /launch.sh
database_1         | lando 12:21:41.24 DEBUG ==> Running command with exec...
database_1         | /launch.sh: line 10: /entrypoint.sh: No such file or directory```

megadesk3000 avatar Dec 14 '21 12:12 megadesk3000

@megadesk3000 Thanks for sharing that. Same thing for me.

kencyong avatar Dec 14 '21 19:12 kencyong

@kencyong We managed to get a working arm compatible mariadb container with the following config:

database:
    type: compose
    services:
      image: mariadb:latest
      command: docker-entrypoint.sh mariadbd
      volumes:
        - data_volume:/var/lib/mysql/data
      restart: always
      environment:
        MARIADB_ROOT_PASSWORD: drupal
        MARIADB_DATABASE: drupal
        MARIADB_USER: drupal
        MARIADB_PASSWORD: drupal
    volumes:
      data_volume:

Maybe that is useful until the image lando uses supports the new M1.

jan-steffen avatar Dec 21 '21 08:12 jan-steffen

@jan-steffen Thanks so much for posting this, I was able to use a modified version of this as well and start up a mariadb container that appears to be running almost as expected:

services:
  database:
    type: compose
    services:
      image: mariadb:latest
      command: docker-entrypoint.sh mariadbd
      restart: always
      ports: 
        - '3306'
      environment:
        MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
        MARIADB_DATABASE: drupal
        MARIADB_USER: drupal
        MARIADB_PASSWORD: drupal

The only thing that doesn't seem to work is the lando db-import command, but that might be a configuration thing on my end. Instead of using db-import, I just import my SQL dump manually and it works just fine!

Thanks again!

kencyong avatar Dec 22 '21 10:12 kencyong