Closed Nollde closed 3 months ago
This is a minimum example of the issue:
git clone git@github.com:Nollde/recast_example_docker_x86.git
cd recast_example_docker_x86
conda create -n recast-tmp python
conda activate recast-tmp
pip install recast-atlas
$(recast catalogue add $PWD)
recast run examples/helloworld
@Nollde In v0.4.0
PR https://github.com/recast-hep/recast-atlas/pull/129 went in which addresses perhaps some of this as setting DOCKER_DEFAULT_PLATFORM
in the environment now sets the --platform
flag in docker run
.
There are now also linux/arm64
platform Docker images in the recast/recastatlas
container image manifest for tags v0.4.0
and future following PR https://github.com/recast-hep/recast-atlas/pull/134. This of course doesn't really help unless the other containers in your workflow also have linux/arm64
images in their manifests, but at least provides native containers for local validation checks.
Your minimal failing example in https://github.com/recast-hep/recast-atlas/issues/117#issuecomment-1777745063 should now pass with
$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 # For this example linux/arm64 will work too now
$ recast run --backend docker <workflow name>
Can you give feedback on if this helps for the time being, and if there are additional UX changes that would help here?
Hi Matthew, thank you very much! I can confirm that my example now works with the suggested changes.
I think it is awesome that you can now use the --platform
argument.
Just for completeness I attach an example of two executions, first on my native architecture, second emulated:
It will probably take some time until whole production workflows can be tested on this (if you would want this as it is potentially much slower) as you also need to make linux/arm64
images for all of them as you say. However, I believe this is not something that can be addressed within recast-atlas.
I greatly appreciate your efforts with the mentioned PR! Since it fully addresses the immediate issue, I think we can consider it resolved and close it.
Thanks, @Nollde! This was a very helpful Issue, so thank you for taking the time to report it and to debug with me!
Problem
Developing Recast workflows on ARM chips (e.g. Apple M1/2) is currently limited as most docker images only support x86 architectures.
Description
Natively docker images are tied to processor architectures. Therefore running images which are built for x86 architectures is not possible on ARM architectures. When using the Recast docker backend, images are started within images which adds an extra layer of complexity.
Solutions
I currently see two solutions to the issue:
docker run --platform linux/amd64 ...
or env varexport DOCKER_DEFAULT_PLATFORM=linux/amd64
). While this can easily be enabled for the docker image of Recast itself (currentlyrecast/recastatlas:v0.3.0
), enabling it for the docker images that Recast starts would require changes in the Recast code. My temporary local solution can be found here. Using emulation at runtime is easy but can be slow.I am happy to discuss further steps to enable the development of Recast workflows on ARM architectures.
Comments