spotty-cloud / spotty

Training deep learning models on AWS and GCP instances
https://spotty.cloud
MIT License
493 stars 43 forks source link

boto3 CreateBucket fails if region is "us-east-1" #43

Closed vadimkantorov closed 5 years ago

vadimkantorov commented 5 years ago

If us-east-1 is used as region, spotty start fails with:

Error:
------
An error occurred (InvalidLocationConstraint) when calling the CreateBucket operation: The specified location-constraint is not valid

The solution is to fix https://github.com/apls777/spotty/blob/master/spotty/providers/aws/deployment/project_resources/bucket.py#L31-L32 as

if self._region != 'us-east-1':
  self._s3.create_bucket(ACL='private', Bucket=bucket_name,
                                       CreateBucketConfiguration={'LocationConstraint': self._region})
else:
  self._s3.create_bucket(ACL='private', Bucket=bucket_name)

The boto3 issue is decribed in https://github.com/boto/boto3/issues/125

Also, thanks for the great project ^^

apls777 commented 5 years ago

Thank you for this bug report! I'll fix it with the next release.

apls777 commented 5 years ago

Fix released.