ml6team / fondant

Production-ready data processing made easy and shareable
https://fondant.ai/en/stable/
Apache License 2.0
341 stars 25 forks source link

Make pulling images on M1 / ARM silicon more user friendly #344

Open RobbeSneyders opened 1 year ago

RobbeSneyders commented 1 year ago

Currently users who try to pull images on their M1 silicon (eg. using the local runner) will run into the following issue:

no matching manifest for linux/arm64/v8 in the manifest list entries

They can solve this by setting the DOCKER_DEFAULT_PLATFORM environment variable.

export DOCKER_DEFAULT_PLATFORM=linux/amd64

This will instruct docker to pull images built for the linux/amd64 platform instead. From the docker docs:

Some images do not support the ARM64 architecture. You can add --platform linux/amd64 to run (or build) an Intel image using emulation.

However, attempts to run Intel-based containers on Apple silicon machines under emulation can crash as qemu sometimes fails to run the container. In addition, filesystem change notification APIs (inotify) do not work under qemu emulation. Even when the containers do run correctly under emulation, they will be slower and use more memory than the native equivalent.

In summary, running Intel-based containers on Arm-based machines should be regarded as “best effort” only. We recommend running arm64 containers on Apple silicon machines whenever possible, and encouraging container authors to produce arm64, or multi-arch, versions of their containers. This issue should become less common over time, as more and more images are rebuilt supporting multiple architectures.

I see different actions we can take with different levels of investment and return:

GeorgesLorre commented 1 year ago

Building multi-arch images has nice benefits:

Downsides:

GeorgesLorre commented 1 year ago

If it is only for local development (local runner on Mac's M1 chips) then I would just alter the docker-compose file to include the platform.

https://github.com/compose-spec/compose-spec/blob/master/spec.md#platform

RobbeSneyders commented 1 year ago

The major clouds also offer ARM machines, especially Amazon it seems. Not sure how popular those are, but those would benefit from multi-arch images as well.

RobbeSneyders commented 11 months ago

Since this might have an impact on image size as well, let's take https://github.com/ml6team/fondant/issues/573 into account and maybe tackle them together.

GeorgesLorre commented 10 months ago

As a temporary fix we will add the:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

on the fondant side. Until we are ready to build ARM images (with reasonable size)