-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
S3FeedStorage supports custom endpoint of object storage. #4998
Conversation
23c6390
to
2683e94
Compare
Codecov Report
@@ Coverage Diff @@
## master #4998 +/- ##
==========================================
- Coverage 88.19% 84.09% -4.11%
==========================================
Files 162 162
Lines 10497 10498 +1
Branches 1517 1517
==========================================
- Hits 9258 8828 -430
- Misses 965 1409 +444
+ Partials 274 261 -13
|
2683e94
to
e6b30cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hi @Gallaecio. Is something blocking the merge on this one? If so, perhaps I can address any issues in case @bkayranci is not available 😃 |
It looks good to me, and @wRAR ’s feedback has been addressed, so I think we can merge. |
The documentation lacks usage info... do I need only AWS_ENDPOINT_URL set to my s3-like url in the |
The documentation are available for access and secret keys. Please follow the documentation for access keys. I share with you an example usage for endpoint_url option. The changes of PR #4998 pass a variable to the function via kwargs. |
You can set in settings.py the AWS_ENDPOINT_URL variable. You can find how to set the url in documentation of your cloud provider. For example, DigitalOcean provides compatible api for s3. I set the ## settings.py
...
AWS_ENDPOINT_URL = 'https://nyc3.digitaloceanspaces.com'
... Now, you are able to use it for storage backend. docs |
@bkayranci Thanks for the response. My bad I deleted the old comment because I thought I had solved the issue. Anyway, I'm not able to post to the custom endpoint. I was able to trigger the action when I set the s3 uri in How do I trigger the post to my custom endpoint? Do I set the uri in |
I did not try the set endpoint in URI. My URI includes only bucket name and file path like "s3://mybucket/path/to/export.csv". Also, do you sure that your environment includes the changes of #4998 ? |
Do you mean if I'm up to date? I'm using v2.5.0...
Yes, that's what I mean. When I do this it triggers the post but it errors with an incorrect access key. I'll try to make a new bucket and use it's new keys instead. So far this is what I have and it works but it errors with the last error I just mentioned: config = configparser.ConfigParser()
config_file = os.path.join(os.path.dirname(__file__), 'env.conf')
config.read(config_file)
AWS_ACCESS_KEY_ID = config['credentials']['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = config['credentials']['AWS_SECRET_ACCESS_KEY']
AWS_ENDPOINT_URL = 'my-linode-bucket-test.us-southeast-1.linodeobjects.com'
AWS_USE_SSL = True
AWS_VERIFY = True
# HERE FOR DEBUGGIN PURPOSES
DEPTH_LIMIT = 1
FEEDS = {
# 'epidemiology-data.json': {
# 'format': 'json',
# 'encoding': 'utf-8',
# 'indent': 4,
# 'overwrite': True,
# },
's3://epidemiology/data.json': {
'format': 'json',
'encoding': 'utf-8',
'indent': 4,
'overwrite': True,
},
} |
Then it indeed doesn't. |
@wRAR how do I download the latest? I used |
@bkayranci I didn't ... I read them from a local file |
it means you could not pass to the function your endpoint. so, your requests sent to AWS. Now, AWS could be know your token. |
@bkayranci yes, ok so maybe this is just that Linode is not compatible? I read here
but it errors with |
That should work.
No, it was merged and so will be included in the next release. |
It works. I had to write in the credentials in the s3 uri like in the documentation like this This won't work AWS_ACCESS_KEY_ID = config['credentials']['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = config['credentials']['AWS_SECRET_ACCESS_KEY'] Any idea why? Or at least it could help telling me how to debug?? I use to have the aws cli installed in my computer. I deleted the EDIT: I tested my changes with scrapyd and it won't export the feed to the aws bucket. |
Scrapy documentation says that, scrapy supports other object storages via
AWS_ENDPOINT_URL
. Unfortunately, custom object storage endpoint does not support in feed exporter.Related Links