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

Base Image Build problem mongodb and centos Stream 9 with podman on a non-Intel / Apple Silicon M1 / M2 / M3 Mac #56

Open
shalberd opened this issue Aug 8, 2024 · 1 comment

Comments

@shalberd
Copy link

shalberd commented Aug 8, 2024

$ pwd
/workbench-images/base
$ make all RELEASE=2024c DATE=20240808

Podman Terminal output, running this on Mac OS X ... should not matter though because yum runs inside centos stream 9, quay.io/sclorg/python-311-c9s:c9s correct?

[1/2] STEP 14/23: RUN yum install -y mongocli
MongoDB Repository                               98 kB/s |  60 kB 
00:00
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' 
to use not only best candidate packages)
Error:
  Problem: cannot install the best candidate for the job
   - package mongocli-2.0.1-1.x86_64 from mongodb-org-6.0 does not have a compatible architecture
Error: building at STEP "RUN yum install -y mongocli": while running
runtime: exit status 1
@shalberd
Copy link
Author

shalberd commented Aug 8, 2024

Solved the issue building with podman on a non-Intel / Apple Silicon M1 / M2 / M3 Mac with hints from here:

https://medium.com/rahasak/switching-from-docker-desktop-to-podman-on-macos-m1-m2-arm64-cpu-7752c02453ec

https://docs.podman.io/en/latest/markdown/podman-build.1.html

Quoting:

When building an image with Podman, you can specify the --arch flag to select the desired CPU architecture for the image. By default, Podman uses the CPU architecture of the machine it is running on. This allows you to build multi-architecture images using Podman, which can be useful for running the same application across different CPU architectures.

Solution:

explicitely set --arch=amd64 in podman build and podman run lines at

https://github.com/opendatahub-io-contrib/workbench-images/blob/main/base/Makefile#L26

https://github.com/opendatahub-io-contrib/workbench-images/blob/main/base/Makefile#L33

Also applies to podman run in the Makefile inspect section:

https://github.com/opendatahub-io-contrib/workbench-images/blob/main/base/Makefile#L57

On previous Intel Mac with homebrew installed Podman, this issue never happened.

Result:

Successful resolve of the architecture, in this case amd64, with the help of yum inside the build container.


$Dependencies resolved.
================================================================================
 Package          Architecture   Version          Repository               Size
================================================================================
Installing:
 mongocli         x86_64         2.0.1-1          mongodb-org-6.0         5.6 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 5.6 M
Installed size: 15 M
Downloading Packages:
mongodb-cli-2.0.1.x86_64.rpm                    5.1 MB/s | 5.6 MB     00:01    
--------------------------------------------------------------------------------
Total                                           5.0 MB/s | 5.6 MB     00:01     
MongoDB Repository                              1.6 kB/s | 1.7 kB     00:01    
Importing GPG key 0x64C3C388:
 Userid     : "MongoDB 6.0 Release Signing Key [<[email protected]>](mailto:[email protected])"
 Fingerprint: 39BD 841E 4BE5 FB19 5A65 400E 6A26 B1AE 64C3 C388
 From       : https://www.mongodb.org/static/pgp/server-6.0.asc
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : mongocli-2.0.1-1.x86_64                                1/1 
  Verifying        : mongocli-2.0.1-1.x86_64                                1/1 

Installed:
  mongocli-2.0.1-1.x86_64                                                       

Complete!

...

Validating container image workbench-images:base-c9s-py311_2024a_20240513
-----------------------------------------------------------
=> Loading container image ...
=> Checking container image workbench-images:base-c9s-py311_2024a_20240513 for curl...
=> Checking container image workbench-images:base-c9s-py311_2024a_20240513 for python...
=> Checking Python version...
=> Checking container image workbench-images:base-c9s-py311_2024a_20240513 for oc...
-----------------------------------------------------------
=> Container image workbench-images:base-c9s-py311_2024a_20240513 validated

@shalberd shalberd changed the title Base Image Build problem mongodb and centos Stream 9 Base Image Build problem mongodb and centos Stream 9 with podman on a non-Intel / Apple Silicon M1 / M2 / M3 Mac Aug 8, 2024
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

1 participant