Skip to content

[Core] Ray Python 3.10 image has outdated boto3 version  #34752

Closed

Description

@smit-kiri

What happened + What you expected to happen

Ray's python 3.10 docker image rayproject/ray:2.3.1-py310 has an outdated boto3 version, which results in ImportError: cannot import name 'Mapping' from 'collections' (/home/ray/anaconda3/lib/python3.10/collections/__init__.py) when trying to import boto3.session.

This is not a huge deal at this point since it does not seem to break anything in ray specifically, but in general it is not good to have python 3.10 incompatible packages installed in the python 3.10 image.

Versions / Dependencies

Verified on rayproject/ray:2.3.1-py310 but likely impacts all images

Reproduction script

Dockerfile

FROM rayproject/ray:2.3.1-py310 as common
RUN python -c "import boto3; print(boto3.client('sts').get_caller_identity())"

And run

docker build -f Dockerfile .

It should result in the following output:

 => ERROR [common 2/4] RUN python -c "import boto3; print(boto3.client('sts').get_caller_identity())"                                                                                                                         0.3s
------
 > [common 2/4] RUN python -c "import boto3; print(boto3.client('sts').get_caller_identity())":
#5 0.294 Traceback (most recent call last):
#5 0.294   File "<string>", line 1, in <module>
#5 0.295   File "/home/ray/anaconda3/lib/python3.10/site-packages/boto3/__init__.py", line 16, in <module>
#5 0.295     from boto3.session import Session
#5 0.295   File "/home/ray/anaconda3/lib/python3.10/site-packages/boto3/session.py", line 17, in <module>
#5 0.295     import botocore.session
#5 0.295   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/session.py", line 25, in <module>
#5 0.295     import botocore.configloader
#5 0.295   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/configloader.py", line 19, in <module>
#5 0.296     from botocore.compat import six
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/compat.py", line 25, in <module>
#5 0.296     from botocore.exceptions import MD5UnavailableError
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/exceptions.py", line 15, in <module>
#5 0.296     from botocore.vendored.requests.exceptions import ConnectionError
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/__init__.py", line 58, in <module>
#5 0.296     from . import utils
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/utils.py", line 26, in <module>
#5 0.296     from .compat import parse_http_list as _parse_list_header
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/compat.py", line 7, in <module>
#5 0.296     from .packages import chardet
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/packages/__init__.py", line 3, in <module>
#5 0.296     from . import urllib3
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/packages/urllib3/__init__.py", line 10, in <module>
#5 0.296     from .connectionpool import (
#5 0.296   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/packages/urllib3/connectionpool.py", line 38, in <module>
#5 0.297     from .response import HTTPResponse
#5 0.297   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/packages/urllib3/response.py", line 9, in <module>
#5 0.297     from ._collections import HTTPHeaderDict
#5 0.297   File "/home/ray/anaconda3/lib/python3.10/site-packages/botocore/vendored/requests/packages/urllib3/_collections.py", line 1, in <module>
#5 0.297     from collections import Mapping, MutableMapping
#5 0.297 ImportError: cannot import name 'Mapping' from 'collections' (/home/ray/anaconda3/lib/python3.10/collections/__init__.py)
------
executor failed running [/bin/sh -c python -c "import boto3; print(boto3.client('sts').get_caller_identity())"]: exit code: 1

Issue Severity

Low: It annoys or frustrates me.

Activity

  1. added
    bug
    triage
    on Apr 25, 2023
  2. added
    core
    P1
    and removed
    triage
    on Apr 25, 2023
  3. rkooo567 commented on Apr 25, 2023

    @rkooo567
    Contributor

    @architkulkarni I assigned this to you since you have PR to close it

  4. added a commit that references this issue on May 9, 2023
    13056e9
  5. added a commit that references this issue on May 16, 2023
    116da4c
  6. added a commit that references this issue on May 24, 2023
    0f8d02b
  7. added a commit that references this issue on Aug 31, 2023
    2a0bb09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1bugcore

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions