Closed jmbowman closed 1 year ago
edxapp
is using django-storage = 1.8
The legacy S3BotoStorage
backend was removed in version 1.9. This is the PR where it removed https://github.com/jschneier/django-storages/pull/825
We can move from s3boto
to s3boto3
using exiting django-storage = 1.8
.
One of the main thing is handling exceptions.
s3boto is using these exception = https://github.com/boto/boto/blob/2.39.0/boto/exception.pys 3boto3 using these exception = https://github.com/boto/botocore/blob/1.8.17/botocore/exceptions.py
Plan:
from storages.backends.s3boto import S3BotoStorage
with from storages.backends.s3boto3 import S3Boto3Storage
and update the exceptions also and handle both boto and botocore exceptions. ( merge and deploy this )django-storage
to 1.9
as per documentation.There are multiple (6+) pipelines to upgrade from the boto-based backend to the boto3-based backend. We can try to upgrade pipelines in an incremental approach, try merging 2 pipelines at once so we can verify with ease on stage before pushing our changes to prod.
We have successfully upgraded the django-storages to 1.9.1. Now only videos module left with boto import.
For further upgrade to 1.10.1
https://github.com/jschneier/django-storages/blob/master/CHANGELOG.rst#1101-2020-09-13
we need to change few settings variables and also sets the boto3 warning.
No usage found
Usage found in
These following three repos are interlinked and using python2.7. So not possible to update with boto3.
[ ] 1 edx-analytics-pipeline issue created https://github.com/openedx/edx-analytics-pipeline/issues/891
[ ] 2 edx-analytics-configuration issue created(https://github.com/openedx/edx-analytics-configuration/issues/114)
[ ] 3 https://github.com/edx/luigi ( can't create issue here due to permissions )
[ ] openedx/edx-analytics-data-api issue created here for owning team.
[ ] edx-platform ( videos module ) ( Its a small change from code but it needs domain knowledge so blocked on owning team )
[ ] Some packages and xblocks bringing boto. I have released new version so boto will disappear from requirements.
[ ] https://github.com/edx/api-manager/blob/master/requirements/base.txt#L8 ( here it is coming from google-compute-engine
It has no release since Jan 25, 2019 ( not possible to upgrade boto )
@jmbowman so far found usage here. I have created issues in these repos except luigi
.
There's a "boto usage" filter view in the Repo Health Dashboard spreadsheet that shows just repos with "boto==" in the dependencies.pypi_all.list
field; it currently includes 22 repos. Some of them bring it in due to pinning to a stale version of moto
, such as https://github.com/edx/video-encode-manager/blob/master/requirements/constraints.txt#L7-L8 .
Also, there seems to be a bug in the implementation of the requires.boto
check. It's meant to be an easier way to find these repos, but it incorrectly has False
for most of them.
Lots of entries are coming from xblock-sdk. I have already fixed that just need to merge and release version.
https://github.com/openedx/openedxstats/pull/209/files PR created for openedxstats https://github.com/openedx/openedxstats/pull/211 using moto for tests.
We have successfully upgraded the django-storages to 1.10.1. Now next target is 1.11.1
django-storages
upgrade to latest version in edx-platform
. I think we can close this PR now. Boto still in use in videos module. I have already informed owning team.
They have following ticket https://2u-internal.atlassian.net/browse/TNL-10698
edx-platform is still using versions of boto, boto3, and botocore that were originally pinned (by me) 4.5 years ago before the repo even had a constraints.txt file. boto isn't even supported anymore, and I recently stumbled into a performance problem that might just be fixed automatically by an upgrade. Please get us to reasonably current versions. Suggested sequence:
Finding the breaking changes may be difficult, as the boto3 and botocore changelogs are almost useless lists of daily API change notifications, and we don't really use boto3 in CI. But it looks like particular care may be needed for the upgrade to 1.9.0: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/upgrading.html . And I suspect we don't use the vast majority of services covered in the changelog, so we may be ok just looking for changes related to s3 and maybe 1-2 other AWS services. Writing a doc on how to decide if it's safe to upgrade to a given boto3 or botocore release is probably a good idea, if you figure that out from this task.