chainguard-images / images

Public Chainguard Images
https://chainguard.dev/chainguard-images
Apache License 2.0
547 stars 153 forks source link

kubeflow-pipelines-metadata-writer python mismatch #2921

Open shanedell opened 3 weeks ago

shanedell commented 3 weeks ago

Which image/versions are related to this issue/feature request?

cgr.dev/chainguard/kubeflow-pipelines-metadata-writer:latest

Issue/Feature description

The issue is that when trying to use image in a deployment an error about Python mismatch happens. Below is the exact error:

Error importing: Python version mismatch: module was compiled for Python 3.10, but the interpreter version is incompatible: 3.12.7 (tags/v3.12.7-0-g0b05ead-dirty:0b05ead, Oct  1 2024, 15:39:44) [GCC 14.2.0].Traceback (most recent call last):
  File "/kfp/metadata_writer/metadata_writer.py", line 25, in <module>
    from metadata_helpers import *
  File "/usr/lib/python3.12/site-packages/metadata_helpers.py", line 21, in <module>
    from ml_metadata.metadata_store import metadata_store
  File "/usr/lib/python3.12/site-packages/ml_metadata/metadata_store/__init__.py", line 15, in <module>
    from ml_metadata.metadata_store.metadata_store import downgrade_schema
  File "/usr/lib/python3.12/site-packages/ml_metadata/metadata_store/metadata_store.py", line 31, in <module>
    from ml_metadata.metadata_store.pywrap.metadata_store_extension import metadata_store as metadata_store_serialized
ImportError: Python version mismatch: module was compiled for Python 3.10, but the interpreter version is incompatible: 3.12.7 (tags/v3.12.7-0-g0b05ead-dirty:0b05ead, Oct  1 2024, 15:39:44) [GCC 14.2.0].
shanedell commented 3 weeks ago

Using apko and this apko file:

contents:
  keyring:
    - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
  repositories:
    - https://packages.wolfi.dev/os
  packages:
    - python-3.10-base
    - py3.10-pyasn1
    - py3.10-pyasn1-modules
    - py3.10-ipaddress
    - py3.10-oauthlib
    - py3.10-certifi
    - py3.10-urllib3
    - py3.10-charset-normalizer
    - py3.10-idna
    - py3.10-requests
    - py3.10-requests-oauthlib
    - py3.10-websocket-client
    - py3.10-websocket-client-bin
    - py3.10-frozenlist
    - py3.10-durationpy
    - py3.10-pyyaml
    - py3.10-six
    - py3.10-python-dateutil
    - py3.10-cachetools
    - py3.10-rsa
    - py3.10-google-auth
    - python-3.10
    - py3.10-lru-dict
    - py3.10-absl-py
    - py3.10-rsa-bin
    - py3.10-typing-extensions
    - py3.10-zipp
    - py3.10-importlib-metadata
    - py3.10-attrs
    - py3.10-ml-metadata
    - py3.10-charset-normalizer-bin
    - py3.10-grpcio-1.67
    - py3.10-protobuf
    - kubeflow-pipelines-metadata-writer-compat

accounts:
  groups:
    - groupname: nonroot
      gid: 65532
  users:
    - username: nonroot
      uid: 65532
      gid: 65532
  run-as: 65532

entrypoint:
  command: python3.10 -u /kfp/metadata_writer/metadata_writer.py

archs:
  - x86_64
  - aarch64

I was able to build a new image that worked in the deployment. A better change option would be being able to change the default version of python and the py packages that are being installed. All the packages in the file are installed but are installed for 3.12 instead of 3.10 by default. I am not sure if this possible or not.