ersilia-os / ersilia

The Ersilia Model Hub, a repository of AI/ML models for infectious and neglected disease research.
https://ersilia.io
GNU General Public License v3.0
224 stars 148 forks source link

πŸ› Bug: Fetching models on MacBook (M1) results in 404 error due to looking for linux/arm64 #1156

Closed kartikey-vyas closed 5 months ago

kartikey-vyas commented 5 months ago

Describe the bug.

Running ersilia -v fetch eos2r5a (same outcome for any model ID) results in:

404 Client Error for http+docker://localhost/v1.45/images/ersiliaos/eos2r5a:latest/json: Not Found ("No such image: ersiliaos/eos2r5a:latest")

Conditions:

I think I know whats wrong.

By default, fetch will eventually call ModelPuller which tries to pull from DockerHub via a command like:

docker pull ersiliaos/eos2r5a:latest

The output from this command when it can't find the image is this log:

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

The regex command which is used to search this log to determine whether to raise DockerConventionalPullError is

re.search(r"no match.*platform.*manifest", pull_log):

This command won't find anything since there is no matching string platform in the error log, so it will just assume it was successful. It should be an easy fix and I'm happy to do it, but I thought I'd raise it here first to make sure this is undesirable behaviour.

Describe the steps to reproduce the behavior

  1. run ersilia -v fetch eos2r5a on an apple silicon device

Operating environment

macOS Sonoma 14.4.1

DhanshreeA commented 5 months ago

Hey @kartikey-vyas thank you for opening this issue. It's interesting to me that on my Mac (M3 Pro, Docker desktop v4.30.0 and v4.31.0) I see the error string:

no match for platform in manifest: not found

and not the one you've mentioned here. However I agree, removing platform would generalize this exception better. I'll go ahead and merge your PR.