kleveross / ormb

Docker for Your ML/DL Models Based on OCI Artifacts
Apache License 2.0
452 stars 61 forks source link

Python SDK installs Linux pre-compiled binaries on Mac OS #181

Closed gbolmier closed 2 years ago

gbolmier commented 3 years ago

/kind bug

What happened:

pip installing ormb Python SDK installed Linux binaries on my Mac OS machine.

What you expected to happen:

I would expect Darwin binaries instead.

How to reproduce it (as minimally and precisely as possible):

Run pip install ormb on a mac, then try any ormb command in a Python interpreter, e.g.:

import ormb

ormb.push(ref)

or in a terminal using the installed pre-compiled binaries path:

$ /usr/local/miniconda/base/envs/temp/lib/python3.7/site-packages/ormb/bin/ormb push <ref>
zsh: exec format error: ormb

Here is the executable file type:

$ file -b /usr/local/Caskroom/miniconda/base/envs/temp/lib/python3.7/site-packages/ormb/bin/ormb
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
for GNU/Linux 3.2.0, Go BuildID=Vh_I6gshxrIYk3nyfbU4/8lRYVkdsHynt31-8VZSv/bWN64Rk8-0IaZNAJyZHM/D7BNeRxCP-crkwFL38Mt,
BuildID[sha1]=7c1f9737776ee71b657b552b5d8af535515cd2d3, stripped

Anything else we need to know?:

It doesn't look like the problem comes from extern-sdk/python/git_release.py.

On my system:

import platform
import sys

platform.platform().lower()
> 'darwin-20.5.0-x86_64-i386-64bit'

sys.platform
> 'darwin'

Therefore, the following loop:

https://github.com/kleveross/ormb/blob/980a50629afc81960e02a0cc4aacf6e75c068263/extern-sdk/python/git_release.py#L33-L37

should give to asset_name the following value 'ormb_0.0.11_Darwin_i386.tar.gz', which doesn't exist in the releases after v0.0.9, I guess it automatically falls back on 'ormb_0.0.11_Linux_x86_64.tar.gz'?

gaocegege commented 3 years ago

Thanks for the issue. I will try to fix it ASAP

gaocegege commented 2 years ago

We may migrate to https://github.com/oras-project/oras-py in the near future. Maybe I do not have the bandwidth for it.

Thus /help-wanted

gbolmier commented 2 years ago

Thanks for the update @gaocegege 👍