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

The Great Armification #2688

Open
dustinleblanc opened this issue Nov 11, 2020 · 55 comments
Open

The Great Armification #2688

dustinleblanc opened this issue Nov 11, 2020 · 55 comments
Labels
Projects

Comments

@dustinleblanc
Copy link
Collaborator

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/

@pirog
Copy link
Sponsor Member

pirog commented Nov 12, 2020

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

@dustinleblanc
Copy link
Collaborator Author

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

@pbattino
Copy link

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!

@andrew-boyd
Copy link

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

@kay-o
Copy link
Contributor

kay-o commented Dec 28, 2020

@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!

@pirog pirog added this to Backlog in Starbuck Dec 28, 2020
@kay-o
Copy link
Contributor

kay-o commented Jan 4, 2021

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

@dustinleblanc
Copy link
Collaborator Author

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.

@dwhoban
Copy link

dwhoban commented Jan 14, 2021

@dustinleblanc how can we help with Testing?

@andrew-boyd
Copy link

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

@dwhoban
Copy link

dwhoban commented Jan 14, 2021

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

@andrew-boyd
Copy link

@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
Copy link

@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!

@backlineint
Copy link
Sponsor

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
Copy link
Sponsor

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.

@jeffm2001
Copy link
Contributor

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.

@pirog
Copy link
Sponsor Member

pirog commented Feb 25, 2021 via email

pirog added a commit that referenced this issue Mar 9, 2021
pirog added a commit that referenced this issue Mar 10, 2021
#2688: Force DOCKER_BUILDKIT=1 for now
pirog added a commit that referenced this issue Apr 16, 2021
@dustinleblanc
Copy link
Collaborator Author

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

@dstorozhuk
Copy link

dstorozhuk commented Sep 12, 2021

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.

@rlorenzo
Copy link

rlorenzo commented Oct 2, 2021

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?

@joshuami
Copy link

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.

@kencyong
Copy link

kencyong commented Nov 13, 2021

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.

@rlorenzo
Copy link

@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 bitnami/charts#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.

@ChandeepKhosa
Copy link

ChandeepKhosa commented Mar 29, 2022

I'm using Drupal 9 with Platform.sh hosting on a new project and also experienced the issue with my MariaDB server appearing not to run.

My workaround, thanks to help from Alec was these steps

  • mkdir project
  • lando init
  • rm -rf .lando.yml
  • git checkout main
  • lando start (if an error occurs, try running lando composer install after it)

@marcomc
Copy link

marcomc commented Apr 8, 2022

@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!

It worked neatly, thanks

@marcomc
Copy link

marcomc commented Apr 8, 2022

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

Hi, thanks, that worked for me too!
any change you have been able to setup an override also for the nginx service?

@awm086
Copy link

awm086 commented Jun 3, 2022

@marcomc @jan-steffen with your config does the database persists between rebuilds? when I run lando rebuild the db data is gone.

@jan-steffen
Copy link

jan-steffen commented Jun 3, 2022

I had that problem as well in the past. It seems, that my volume definition was not 100% correct. Here is my updated config, where the database now survives the rebuild ;)

database:
    volumes:
      mariadb: {}
    type: compose
    services:
      image: mariadb:10.6.5
      command: docker-entrypoint.sh mariadbd
      volumes:
        - mariadb:/var/lib/mysql
      environment:
        MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
        MARIADB_DATABASE: drupal
        MARIADB_USER: drupal
        MARIADB_PASSWORD: drupal

@note: I had massive performance issues on multiple of our projects with the latest mariadb image. I figured out for me, that 10.6.5 was the latest version that does not have those issues without knowing the reason. But maybe that helps someone else.

@awm086
Copy link

awm086 commented Jun 3, 2022

@jan-steffen is the last d in mariadbd a typo? or is it the mariadb demon?

updated: mariadbd is the correct one

I tried all variations. nothing is persisting the data for me between lando rebuild's. Can you share your entire .lando.yml

update: I had incorrect mapping. : mariadb:/var/lib/mysql is the correct one.

@jan-steffen
Copy link

@awm086 So its working for you now?

@awm086
Copy link

awm086 commented Jun 6, 2022

@jan-steffen yes - thank you.

@CodeJourneymen
Copy link

CodeJourneymen commented Aug 26, 2022

Lando recipe for Postgres ARM64/Apple Silicon/M1/M2

Using the MariaDB recipe as a start (from #2688 (comment))
I ended up with the following which is working for me - after some educated guesses and much Googling.

You probably want to replace databasepsql with database to work by default.
I was running 2 DB's side by side, one AMD64 (default lando bitnami postgres), one ARM64.

NOTE: lando info doesn't show the port forwarding (Container) 5432 -> (Host)37604 but it does work (I connect PHPStorm database via port 37604 on localhost)

I could lando db-export from the AMD64 DB, then lando db-import into the ARM64 DB.
I then updated settings.php to point to the Arm Postgres DB and it all worked.

NOTE: The DB doesn't survive a land rebuild, not sure how to fix that yet.

# Postgres M1 compatible image - until Lando supports images not from bitnami (no M1 support).
  databasepsql:
    volumes:
      postgresdb: { }
    type: compose
    services:
      #image: postgres:14.3-alpine
      image: postgres:12-alpine
      # Host Port : Container Port
      ports:
        - 37604:5432
      command: docker-entrypoint.sh postgres
      volumes:
        - postgresdb:/var/lib/postgres/data
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: postgres
        POSTGRES_DB: drupal9
        POSTGRES_HOST_AUTH_METHOD: trust

@CodeJourneymen
Copy link

I guess the documentation we should look at is https://docs.lando.dev/config/services.html#building-a-custom-service

And the examples are at https://github.com/lando/compose/tree/main/examples/compose

@lefte
Copy link

lefte commented Aug 27, 2022

I just wanted to add a personal example that might work for those who want a workaround while waiting on official bitnami Lando ARM support for their M1 Macbook, like I did.

After a lot of tweaks to Docker, and trying out many GitHub and SO search recommendations, I changed my .lando.yml file from this:

[snip]
  elasticsearch:
    type: elasticsearch:7
    portforward: 9200
    plugins: [analysis-icu, analysis-phonetic]
[snip]

...to use zcube's bitnami multi-architectue images as a custom image instead:

[snip]
  elasticsearch:
    type: elasticsearch:custom
    portforward: 9200
    plugins: [analysis-icu, analysis-phonetic]
    overrides:
      image: zcube/bitnami-compat-elasticsearch:7.17.6-debian-11-r23
[snip]

There are a ton of supported builds for a bunch of major bitnami services that should provide drop-in replacement (example) for Lando's recipes, while we wait on bitnami or Lando to do this work themselves. I hope it helps some other poor soul, trying to get his local dev working on a new laptop. Good luck, friends!

@ccjjmartin
Copy link
Contributor

As a note, I had to add the following line into my database > services > environment section to make lando db-import work:

        MYSQL_DATABASE: drupal7

The issue I ran into was that MARIADB_DATABASE wasn't being picked up by that command but if you give them both the same value like:

        MYSQL_DATABASE: drupal7
        MARIADB_DATABASE: drupal7

Then you can use a custom mariadb database container and still use lando db-import and it will default to the right database, as a side note, it would be nice if the db-import command had a parameter that allowed picking the database name. To my knowledge there isn't one.

@CodeBrauer
Copy link

CodeBrauer commented Nov 29, 2022

What worked best for me so far (setup is a bit tricky, but it works better than expected)

  • Installed UTM
  • Installed Debian 11 x86_64 with GUI from netinstall ISO
  • Installed ssh, docker, php, composer, git via apt
  • Installed lando-x64-v3.6.4.deb
  • Now just ssh in the machine
  • Added bindAddress: 0.0.0.0 to ~/.lando/config.yml
  • git pulled my project, lando start
  • Works fine!
  • Set proxy.appserver: <url> in local macOS hosts file to remote VM IP address.

Working with code:

  • Using PHPStorm with Remote Development (Beta) via SSH

Performance is a bit slow, but I had zero issues so far. Mainly I need to do it this way because I need a current version of Docker Desktop on my Mac for other projects and the version of lando is causing too many problems.

@CodeBrauer
Copy link

CodeBrauer commented Jan 11, 2023

Has anyone successfully run lando on macOS 12.6+ (Monterey) with Docker Desktop v4.15.0+?

I'm currently working with a heavy workaround, so I can develop the projects further. Sad to see there is currently no real approach to get M1 going. I tried myself fixing it, but I lack certain knowledge about Landos architecture of for contributing a PR.

I would be happy to give you tips on how to get lando working with the current Docker Desktop version under M1/M2.

@pirog
Copy link
Sponsor Member

pirog commented Jan 13, 2023

FWIW i've been running with Docker Desktop 4.15.0 and macOS 13.1 for quite awhile without issues. The x64 images that run under emulation with QEMU have generally worked ok for me although there is a performance hit. The new Rosetta emulation backend in Docker 4.16 may improve that.

Lando 4 is being designed to run on only official docker images so MOST services of reasonably recent versions will have native support for arm64 images.

@ccjjmartin
Copy link
Contributor

@CodeBrauer The only issue one of my coworkers hit recently was that the new version of docker ... or maybe new OSX, I think he was on Ventura 14.x, is that one of them adds support for a new file sharing method that doesn't play well with lando. If you stick with the "legacy osxfs" file sharing method or the "gRPC" file sharing method you should be good but you will have to go into the docker preferences on a Mac and adjust it to one of these since the default on the new docker is a new 3rd option. FYI, I haven't done it myself yet, just heard through Slack.

@reynoldsalec
Copy link
Sponsor Member

@CodeBrauer + @ccjjmartin latest pre-release available (Lando 3.9.0) should improve compatibility with VirtioFS (and also contains support for Docker Desktop up to 4.16.1): https://github.com/lando/lando/releases/tag/v3.9.0

@CodeBrauer
Copy link

CodeBrauer commented Jan 26, 2023

@reynoldsalec Thank you very much for that information! Currently, running macOS 12.6, Docker Desktop 4.16.2 and using gRPC FUSE - I have no problems using lando 🙌🏼

@bronius
Copy link

bronius commented Apr 13, 2023

Hello, friends. I stumbled upon this thread looking for localdev lando drupal 9 with mysql/mariadb on M1/M2 arm macbook. I am new enough to lando to not completely understand this, but it works:

name: <whatever it's called>
recipe: drupal9
config:
  php: 8.1
  database: pantheon-mariadb

The key here is config: database: pantheon-mariadb where config: database: mariadb or mariadb:10.3 or any any anything else would keep building the intel x86 build. The builder.js in the pantheon recipe may tell you more than it tells, me, but I don't think we need to point to pantheon-mariadb if we can understand how to point to the right maridb:10.3 that will intelligently select between arm/intel based on whatever host machine it is executed requires:

https://github.com/lando/pantheon/blob/main/services/pantheon-mariadb/builder.js

Hope this helps, and I hope someone can explain more 😄

@oriolroger
Copy link

Hi all. I had the same problem with an Apple M2 silicon chip, and I finally got it working, adding this to my lando.yml:

  database:
    type: mysql:custom
    overrides:
      image: bitnami/mysql:5.7.42-debian-11-r13

The lando slack channel was really helpful with this. Thanks!

@atera-web
Copy link

Hi all. I had the same problem with an Apple M2 silicon chip, and I finally got it working, adding this to my lando.yml:

  database:
    type: mysql:custom
    overrides:
      image: bitnami/mysql:5.7.42-debian-11-r13

The lando slack channel was really helpful with this. Thanks!

is this under config: ? causes some error for me

@osopolar
Copy link
Contributor

@atera-web under "services", see also https://docs.lando.dev/core/v3/services.html#overrides

@pirog
Copy link
Sponsor Member

pirog commented Jul 24, 2023

just to provide some updates here, we are about a month away from rolling out the first of our "v4" service preview for Lando 3. MariaDB/MySQL will likely be the first two services supported and will be fully ARMed for Apple Silicon usage.

@reynoldsalec
Copy link
Sponsor Member

reynoldsalec commented Oct 17, 2023

...if you're interested in progress here, check out: https://lando.dev/blog/2023/09/25/v320-extended.html, particularly the section starting with "Lando 4 Service Preview".

tl;dr is that we have the "base" layer for the Lando v4 services done, now we need to create the next abstraction layer and start reimplementing all the basic services.

For now, highly recommend trying the "Use Rosetta for x86/amd64 emulation on Apple Silicon" in the "Features in Development" section of your Docker Desktop settings if you have critical errors related to ARM support; that's resolved at least one compatibility issue for me.

@lhridley
Copy link

lhridley commented Feb 7, 2024

So...having just started working with a company that uses Lando for local development (I have used DDEV for years), I've run into many frustrating issues with this as well. Most of our developer team is overseas, and they all have Linux laptops, while I was issued a 2023 Macbook Pro with an M2 Max chip and 32G of RAM.

I have Rosetta 2 installed, and have Docker for Desktop running in emulation mode with Rosetta for x86/amd64 emulation enabled.

After working through several issues attempting to get existing Lando projects to spin up without crashing, I've stumbled upon a combination of the following that seems to be working at the moment:

  1. Only run one lando project at a time, shut down one project with lando stop before attempting to switch to another project.

  2. Add overrides to the services that are crashing to the .lando.yml file as follows:

database:
  overrides:
    platform: linux/amd64
node:
  ....
  overrides:
    platform: linux/amd64

Sharing for anyone else spinning on this issue, as I have sunk hours into resolving this, having come from using DDEV for local development where Apple Silicon has been supported for quite some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Starbuck
Needs triage
Development

No branches or pull requests