Skip to content
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

Use boto3 for tile store #334

Merged
merged 4 commits into from
May 4, 2018
Merged

Conversation

zerebubuth
Copy link
Member

This changes the tile store implementation to use boto3 rather than boto version 2. It also has a few random fixes, and extra configuration parameters.

  • There's more verbose error logging for S3 errors. It now prints out the bucket and key, which should make tracking permissions errors down a bit easier.
  • Use the region from the environment for Batch, if it's available. This means we're not hard-coded to us-east-1 any more.
  • Configurable object ACL. We use, public-read in Nextzen and this will be the default, but others may want private.

@@ -1979,7 +1979,8 @@ def tilequeue_batch_enqueue(cfg, args):
logger = make_logger(cfg, 'batch_enqueue')

import boto3
client = boto3.client('batch', region_name='us-east-1')
region_name = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')
client = boto3.client('batch', region_name=region_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that boto3 would automatically check the environment variable for us, but this certainly doesn't hurt.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too. This was my attempt to keep the default the same as before, as I think that not setting the environment variable would otherwise be an error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yea, good point. It does error out if there is no default region set.

👍

@zerebubuth zerebubuth merged commit 5703b81 into master May 4, 2018
@zerebubuth zerebubuth deleted the zerebubuth/use-boto3-for-store branch May 4, 2018 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants