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

Rosetta emulation not working in Colima #990

Open
1 of 5 tasks
jannetak opened this issue Feb 23, 2024 · 3 comments
Open
1 of 5 tasks

Rosetta emulation not working in Colima #990

jannetak opened this issue Feb 23, 2024 · 3 comments

Comments

@jannetak
Copy link

jannetak commented Feb 23, 2024

Description

I have been trying to run x86 images in Docker using my M2-Mac. Previously it has been working, but currently I have some issues and system is detected as arm64 instead of x86.

As an example, I have been using Tensorflow serving image https://www.tensorflow.org/tfx/serving/docker

When I run it, I got following error:

docker run -t --rm -p 8501:8501
-v "$TESTDATA/saved_model_half_plus_two_cpu:/models/half_plus_two"
-e MODEL_NAME=half_plus_two
tensorflow/serving
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/usr/bin/tf_serving_entrypoint.sh: line 3: 7 Illegal instruction (core dumped) tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=${MODEL_NAME} --model_base_path=${MODEL_BASE_PATH}/${MODEL_NAME} "$@"

Version

colima version && limactl --version && qemu-img --version
colima version 0.6.8
git commit: 9b0809d
limactl version 0.20.1
qemu-img version 8.2.1
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

FATA[0000] colima is not running

Reproduction Steps

  1. brew install colima
  2. colima start --profile rosetta --cpu 2 --memory 6 --arch aarch64 --vm-type=vz --vz-rosetta
  3. docker context use colima-rosetta
  4. docker pull --platform=linux/amd64 tensorflow/serving
  5. git clone https://github.com/tensorflow/serving
  6. TESTDATA="$(pwd)/serving/tensorflow_serving/servables/tensorflow/testdata"
  7. docker run -t --rm -p 8501:8501
    -v "$TESTDATA/saved_model_half_plus_two_cpu:/models/half_plus_two"
    -e MODEL_NAME=half_plus_two
    tensorflow/serving

Expected behaviour

TensorFlow Serving container and open the REST API port

Additional context

No response

@jannetak
Copy link
Author

By reinstalling everything, status is now ok:
colima status
INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/profilename/.colima/default/docker.sock

and it uses right context:
docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
colima colima unix:///Users/profilename/.colima/default/docker.sock
colima-rosetta * colima [profile=rosetta] unix:///Users/profilename/.colima/rosetta/docker.sock
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock

still the same issue:

_WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/usr/bin/tf_serving_entrypoint.sh: line 3: 7 Illegal instruction (core dumped) tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=${MODEL_NAME} --model_base_path=${MODEL_BASE_PATH}/${MODEL_NAME} "$@"
_

@jannetak
Copy link
Author

colima list
PROFILE STATUS ARCH CPUS MEMORY DISK RUNTIME ADDRESS
default Running aarch64 2 2GiB 60GiB docker
rosetta Running aarch64 2 6GiB 60GiB docker

If I delete default profile and leave only rosetta profile, colima status gives:
_colima delete default
are you sure you want to delete colima and all settings? [y/N] y
INFO[0000] deleting colima
INFO[0001] deleting ... context=docker
INFO[0002] done

colima status
FATA[0000] colima is not running_

@megavenik
Copy link

megavenik commented Apr 9, 2024

colima start --profile rosetta --cpu 2 --memory 6 --arch aarch64 --vm-type=vz --vz-rosetta

I'm not a maintainer and, tbh colima newbie, but shouldn't you use x86_64 instead of aarch64?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants