hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
400 stars 498 forks source link

Multi-architecture image builds failing #2124

Open WadeBarnes opened 1 year ago

WadeBarnes commented 1 year ago

As a result of the fix in https://github.com/hyperledger/aries-cloudagent-python/pull/2123, for https://github.com/hyperledger/aries-cloudagent-python/issues/2121, the extras, [askar,bbs], are now being installed and this is causing the multi-architecture image builds to fail, specifically the ones for linux/arm64 and linux/386.

The failures arise due to the fact that the visions of the askar and bbs packages defined in the requirements files do not have wheel packages published for the linux/arm64 and linux/386 architectures and they do not have source packages published that would allow for the packages to be built and installed from source. In the case of the askar dependencies, compatible wheel packages have been published for other versions, just not the ones defined currently.

Steps to reproduce locally:

Example Results:

The error messages change depending on the order pip tries to resolve the bbs and askar dependencies.

docker buildx build --no-cache --progress plain -t main --platform linux/arm64 -f docker/Dockerfile -t aca-py-test-build .

...
#17 [main  9/10] RUN aries_cloudagent_package=$(find ./ -name "aries_cloudagent*.whl" | head -n 1) &&     echo "Installing ${aries_cloudagent_package} ..." &&     pip install --no-cache-dir --find-links=. ${aries_cloudagent_package}[askar,bbs] &&     rm aries_cloudagent*.whl
#17 0.516 Installing ./aries_cloudagent-0.8.0rc0-py3-none-any.whl ...
#17 13.60 Looking in links: .
#17 13.66 Processing ./aries_cloudagent-0.8.0rc0-py3-none-any.whl
...
#17 58.73 ERROR: Could not find a version that satisfies the requirement ursa-bbs-signatures~=1.0.1; extra == "bbs" (from aries-cloudagent[askar,bbs]) (from versions: none)
#17 58.73 ERROR: No matching distribution found for ursa-bbs-signatures~=1.0.1; extra == "bbs"
...

docker buildx build --no-cache --progress plain -t main --platform linux/386 -f docker/Dockerfile -t aca-py-test-build .

...
#17 [main  9/10] RUN aries_cloudagent_package=$(find ./ -name "aries_cloudagent*.whl" | head -n 1) &&     echo "Installing ${aries_cloudagent_package} ..." &&     pip install --no-cache-dir --find-links=. ${aries_cloudagent_package}[askar,bbs] &&     rm aries_cloudagent*.whl
#17 0.477 Installing ./aries_cloudagent-0.8.0rc0-py3-none-any.whl ...
#17 1.884 Looking in links: .
...
#17 19.30 ERROR: Could not find a version that satisfies the requirement indy-credx~=0.3; extra == "askar" (from aries-cloudagent[askar,bbs]) (from versions: 0.2.1, 0.2.3)
#17 19.30 ERROR: No matching distribution found for indy-credx~=0.3; extra == "askar"...
WadeBarnes commented 1 year ago

cc @andrewwhitehead, @dbluhm, @swcurran

WadeBarnes commented 1 year ago

The obvious fix is to update the publishing for the affected askar and bbs requirements and update the requirements.bbs.txt, and requirements.askar.txt files. However I'm not familiar with the work or effort needed.

WadeBarnes commented 1 year ago

For the short term I'm going to submit a PR to the associated workflows so they only produce the linux/amd64 layer so we can publish some working images for testing.

swcurran commented 1 year ago

I believe the solution will be to bump the versions — the new builds for the libraries I think support multiple platforms. We need to get the versions that support that officially released. Is that correct @andrewwhitehead ?

WadeBarnes commented 1 year ago

ursa-bbs-signatures (https://github.com/mattrglobal/ffi-bbs-signatures) does not publish supporting packages.

swcurran commented 1 year ago

That’s not good. Can we remove BBS+ from ACA-Py unless explicitly added? E.g. separate it out the way indy-idk and Askar are included?

WadeBarnes commented 1 year ago

I should qualify my last statement. They publish packages that are compatible with the linux/amd64 builds, but none to support the linux/arm64 and linux/386 builds.

WadeBarnes commented 1 year ago

Summary of work that needs to be done to support multiarchitecture aca-py images:

swcurran commented 1 year ago

To be a bit more precise, given the current state of where we want to go -- indy-credx needs to be replaced by anoncreds-rs, and the version of anoncreds-rs used needs to have support for the different architectures.

Sigh...

vitorestevamia commented 1 year ago

Any news on it? The multi-arch images are still disabled?

WadeBarnes commented 1 year ago

Yes, they are still disabled. We're waiting on the multi-arch support to be added to the dependencies as listed above.

esune commented 10 months ago

Is this something we could tackle next, based on the anoncreds-rs work and having non-indy images now? @swcurran @WadeBarnes @andrewwhitehead

swcurran commented 10 months ago

The issue is with the BBS Signatures dependency. The work needed to do that is (at a high level) documented in this issue — https://github.com/hyperledger/aries-bbssignatures-rs/issues/8. I was going to see if @amanji could do that one prior to his next big assignment.

esune commented 10 months ago

The issue is with the BBS Signatures dependency. The work needed to do that is (at a high level) documented in this issue — hyperledger/aries-bbssignatures-rs#8. I was going to see if @amanji could do that one prior to his next big assignment.

Thanks for the clarification. Yes, this would be a good "filler" if capacity allows for it, I will let @amanji decide on that.

amanji commented 10 months ago

As we're still waiting on items for the next assignment, I've spoken with Andrew and will make a move on this today.

biagioboi commented 9 months ago

Just for completeness. I have tried to install aires-cloudagent-python on Raspberry Pi 4 (ARM Cortex-A53 processor) by manually building libraries for aries-askar indy-credx and indy-vdr. For indy-vdr and aries-askar I do not faced any problem. For indy-credx the compilation is successful

Screenshot 2023-09-16 alle 10 21 22

But when I try to release new credentials or a new scheme I receive an error from the bindings.py wrapper script

Screenshot 2023-09-16 alle 10 22 47

I have tried with indy-credx==1.0.0, please let me know if a workaround exists for solving this problem or if you are working on it .. or if it can be a problem related to the version used (I do not tink so because it only appears on raspberry, while docker works perfectly!)

esune commented 2 months ago

Adding that this seems to also (obviously) affect devcontainers when running on an arm64 platform such as MacOS - they fail to build and start with ursa-bbs-signatures being the trigger of the error.

swcurran commented 2 months ago

That’s not good — the dependency on ursa-bbs-signatures should have been removed and replaced with aries-bbs-signatures. That change won't solve the arm64 issue, but I thought that change had been made a year ago or so.

@andrewwhitehead — can you please list the steps needed to move the BBS Signatures such that it would be up to date and support arm64 platforms? What work should be done to get there?

Thanks!

andrewwhitehead commented 2 months ago

aries-bbssignatures-rs actually just replaces the bbs crate which ursa-bbs-signatures (aka ffi-bbs-signatures) has as a dependency. There were a few changes made in the process, but it looks like switching the wrapper crate over to use aries-bbssignatures should be straightforward (it's compiling locally for me).

The other steps are listed in the linked issue but aries-bbssignatures needs to be published, first, and then the release workflow for ffs-bbs-signatures updated to publish arm64 packages.

swcurran commented 5 days ago

From the ACA-Pug calls, here are the range of options for solving this by removing BBS Signatures from the primary path.

Comments from chat: