osohq / oso

Oso is a batteries-included framework for building authorization in your application.
https://docs.osohq.com
Apache License 2.0
3.47k stars 174 forks source link

Support linux aarch64 #1529

Open magicarm22 opened 2 years ago

magicarm22 commented 2 years ago

I'm trying to run the docker image on a Mac M1 laptop. But when docker container python:3.10-slim-bullseye tried to install oso, I got an error:

pipenv sync
[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement oso==0.26.0 (from versions: none)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for oso==0.26.0
ERROR: Couldn't install package: oso
 Package installation failed...
patrickod commented 2 years ago

Hey @magicarm22

we currently don't have official support Linux arm64 builds for Python yet, however one of our community members has created a set of Python Oso Docker images which support aarch64 which you can use in these circumstances. In particular I think the documentation on copying over existing aarch64 builds from the source image into your own might be most relevant to your use-case.

RonquilloAeon commented 2 years ago

I was able to resolve this issue by setting platform: linux/amd64 in my docker-compose.yml.

Found it on this page: https://til.simonwillison.net/macos/running-docker-on-remote-m1

nenaddzambasevic commented 2 years ago

@patrickod any timeline when will you have Linux aarch64 native Ruby gem?

patrickod commented 2 years ago

@nenaddzambasevic unfortunately I don't have an updated timeline to offer on Linux aarch64 support but I have noted it in our work tracker. Thanks for your patience on this.

adilnaimi commented 1 year ago

@patrickod, any update on this? I saw that v0.26.2 supports arm64, but on a local Macbook M1, pip install fails:

❯ docker run --rm -it python:3.9 bash
root@2136ca298f4c:/# uname -m
aarch64
root@2136ca298f4c:/# pip install oso
ERROR: Could not find a version that satisfies the requirement oso (from versions: none)
ERROR: No matching distribution found for oso
WARNING: You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
root@2136ca298f4c:/#
fmatzy commented 1 year ago

I too have been experimenting with oso's golang library and have noticed that it fails to build with GOOS=linux GOARCH=arm64. I would be glad if oso's Linux aarch64 support would be provided. Any update on the roadmap?

gj commented 1 year ago

Hi @adilnaimi and @fmatzy, unfortunately no update yet, but your interest is registered. Thank you!

amiran-gorgazjan commented 1 year ago

I am getting the same issue. Running on a MacBook Pro with an Apple M1 Max chip.

omusil24 commented 1 year ago

@gj @patrickod would you accept a PR adding Linux arm64 support for Go builds (in the https://github.com/osohq/oso/blob/main/.github/workflows/release.yml)?

gj commented 1 year ago

@omusil24 happily!

omusil24 commented 1 year ago

@gj made a PR here: https://github.com/osohq/oso/pull/1678

andrewkoltsov commented 1 year ago

is it possible to make a new release with this minor change only?

gj commented 1 year ago

Hey @andrewkoltsov, #1678 was released as part of 0.27.0

andrewkoltsov commented 1 year ago

@gj at this moment with out platform specification I'm getting ERROR: Could not find a version that satisfies the requirement oso==0.27.0 (from versions: none) on arm mac, but with platform: linux/amd64 all good

omusil24 commented 1 year ago

@andrewkoltsov what version of golang are you using? And do you have CGO_ENABLED=1 set when building?

kevinvalk commented 1 year ago

As far as I can see the "only" thing required now is to release wheels for aarch64 on PyPi (when we are talking about the Python bindings).

I hit this issue, because I can install oso without any issues on an M1 MacBook. But when running it under docker (which is Linux aarch64 containers) it failed.

pcorpet commented 11 months ago

Any update on that, does someone know who can do a release wheels for aarch64 please?

dacevedo12 commented 10 months ago

Interested in using oso python but can't install it for this same reason :(

bazylhorsey commented 10 months ago

Our team would be willing to do this if we have instructions on what we need to do for the PR. I don't use mac, but I'm a little surprised Oso hasn't solved this in over a year.

pcorpet commented 10 months ago

As far as I can see the "only" thing required now is to release wheels for aarch64 on PyPi (when we are talking about the Python bindings).

The goal is to get a wheel for linux/arm64 in https://pypi.org/project/oso/#files

This probably happens in the release process where the platform linux/arm64 should be added.

gj commented 8 months ago

Hi @nenaddzambasevic and @Ataraxic, Linux AArch64 support for Ruby landed in 0.27.3 thanks to @jdeff.

adilnaimi commented 8 months ago

I can't install Python 0.27.3 on aarch64:

docker run --rm -it public.ecr.aws/docker/library/python:3.12 bash
root@2a8ca20a5cb3:/# uname -m
aarch64
root@2a8ca20a5cb3:/# pip install oso
ERROR: Could not find a version that satisfies the requirement oso (from versions: none)
ERROR: No matching distribution found for oso

root@2a8ca20a5cb3:/# pip install oso==0.27.3
ERROR: Could not find a version that satisfies the requirement oso==0.27.3 (from versions: none)
ERROR: No matching distribution found for oso==0.27.3

root@2a8ca20a5cb3:/#
andrewkoltsov commented 8 months ago

@andrewkoltsov what version of golang are you using? And do you have CGO_ENABLED=1 set when building?

to be honest i don't know, I'm installing it from pypi (oso = "~=0.27.0")

tpetr commented 7 months ago

For Python linux aarch64 wheels, it could be as simple as ~adding CIBW_ARCHS_LINUX: "auto aarch64" to the cibuildwheel step (and maybe installing qemu if missing).~ adding a separate aarch64 wheel cibuildwheel step that copies the polar library and then runs cibuildwheel for aarch64. Do any oso folks have a minute to test this out?

kevinxu12 commented 2 weeks ago

Following here!