-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Allow AWS Lambda botocore versions in latest releases #862
Comments
#834 was closed - IMO that's a mistake |
I have a similar problem at the other end of the spectrum: I have a package that depends on a more recent version of botocore than 1.20.50. Some insight into why the tight coupling exists and whether or not PRs that either expand the requirements or create a separate release for newer (or older, for that matter) versions would be welcome. |
Same here, the restriction with |
Same. I have tried to use this package in two separate projects, but this package is unusable in both because it doesn't allow later patch versions like |
I have some complex down-stream dependencies that cannot get resolved when trying to include aiobotocore and various other libraries that also depend on boto3 or botocore. I think my only option now is to fork this repo (ugh) and relax the constraints to publish a new library to pypi (ugh). I hate to have to do this, but I have other concerns to address and this might be the fastest way to get what I need. I'll probably regret it. So, the adventure (or misadventure) begins with
Hopefully this adventure succeeds, but it would be even better if it could die an early death with an upstream solution here. The motivation for this is that poetry dependency resolution seems to never get solved in a project with a large number of dependencies. Using This might be a pointless exercise, because a lot of our projects use dask with s3fs and:
There's no escape 😱 PS. With |
if you need s3fs + boto3/awscli, you should use their extras: https://github.com/dask/s3fs/blob/main/setup.py#L37 |
The tight pinning of So I'm blocked on using this functionality of Pandas in my current prioject. |
Ah, so reading through this issue I see that these dependency constraints should be handled by pip's new resolver, but I'm using pip-tools, so it's still an issue until pip-tools gets the new pip resolver logic. @dazza-codes and @thehesiod, I'm also trying to use |
the only way to provide some sort of guarantee is to tie aiobotocore to the version of botocore it was adapted to, there are too many internal changes that can happen we can't account for. If you want to take the risk feel free to do on your own but this library should not put you in the path of potential unforeseen breakages. The other thing we could do is vendor botocore however then this library would become enormous because we'd not only have to vendor botocore, but all its deps, and fix the namespacing of said libraries to not conflict with the user's copies. Best for now is ensuring we keep aiobotocore up to date which isn't too big a deal. Here's a little bit of why the tight coupling: https://github.com/aio-libs/aiobotocore/blob/master/CONTRIBUTING.rst#background-and-implementation best solution is for botocore to support async natively. |
for whom might read this issue. The main issue with AWS Lambda is package size, and having two version of Looking at the aiobotocore version, Here is the dockerfile I'm using to create the package. ARG PYTHON_VERSION=3.9
FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION}
WORKDIR /tmp
# Install dependencies
# HACK: aiobotocore has a tight botocore dependency
# https://github.com/aio-libs/aiobotocore/issues/862
# and because we HAVE TO remove both boto3 and botocore to save space for the package
# we have to force using old package version that seems `almost` compatible with Lambda env botocore
# https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
RUN pip install "pydantic" "rasterio" "rioxarray" "xarray" "zarr" "fsspec" "aiobotocore==2.1.2" "s3fs==2022.01.0" "boto3==1.20.24" "fsspec==2022.01.0" -t /asset --no-binary pydantic
# Reduce package size and remove useless files
RUN rm -rdf /asset/numpy/doc/ /asset/bin /asset/boto3* /asset/botocore*
COPY handler.py handler.py
CMD ["echo", "hello world"] Note: This is a hack and you might experience edge effects, but I don't think the botocore API changed much between |
@vincentsarago yep in fact it did not change. If you see later versions of botocore/awscli/boto3 that are api compatible (no new codepaths and test_patches.py does not error please submit PR to extend version ranges |
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
boto3-1.16.31
andbotocore-1.19.31
But the latest aiobotocore is tightly pinned to
botocore>=1.20.49,<1.20.50
, which is not compatible with the builtin AWS Lambda libraries. Why is aiobotocore so tightly pinned to one specific patch version of botocore? As a library, general practice is to allow it to be installed with a reasonable range of versions for dependencies. Could thesetup.py
file relax the version dependency onbotocore
to allow>=1.19.0
?If
aiobotocore
is going to be so tightly coupled tobotocore
, it should have a release schedule that is also tightly coupled tobotocore
so that every single release ofbotocore
has a matching release foraiobotocore
and the latter might as well use the same release version asbotocore
. This would allow packaging systems to find anaiobotocore
that is compatible with any version ofbotocore
.The error motivating this issue is to minimize an AWS Lambda layer by using the AWS Lambda bundled libs for boto3/botocore and ensuring that the layer .zip file contains compatible versions of other libs with the bundled libs. But pip raises errors like:
The text was updated successfully, but these errors were encountered: