fix: support tensorboard in us-east-1
@@ -17,6 +17,10 @@ def set_s3_region(bucket: str) -> None:
region = bucketLocation["LocationConstraint"]
+ if region is not None:
+ # We have observed that in US-EAST-1 the region comes back as None
+ # and if AWS_REGION is set to None, tensorboard fails to pull events.
+ print(f"Setting AWS_REGION environment variable to {region}.")
os.environ["AWS_REGION"] = str(region)
