Skip to content

Commit

Permalink
Update s3 bucket endpoint url to remove https prefix (#643)
Browse files Browse the repository at this point in the history
* Update s3 bucket endpoint url to remove https prefix
* Update e2e-readme wrt secure parameter used for minio client
  • Loading branch information
abhijeet-dhumal committed Aug 19, 2024
1 parent 6f58a8b commit de2bd73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ Currently the SDK doesn't support tolerations, so e2e tests can't be executed on
AWS_STORAGE_BUCKET=<storage-bucket-name>
AWS_STORAGE_BUCKET_MNIST_DIR=<storage-bucket-MNIST-datasets-directory>
```
Note : When using the Python Minio client to connect to a minio storage bucket, the `AWS_DEFAULT_ENDPOINT` environment variable by default expects secure endpoint where user can use endpoint url with https/http prefix for autodetection of secure/insecure endpoint.
9 changes: 9 additions & 0 deletions tests/e2e/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,20 @@ def prepare_data(self):
secret_key = os.environ.get("AWS_SECRET_ACCESS_KEY")
bucket_name = os.environ.get("AWS_STORAGE_BUCKET")

# remove prefix if specified in storage bucket endpoint url
secure = True
if endpoint.startswith("https://"):
endpoint = endpoint[len("https://") :]
elif endpoint.startswith("http://"):
endpoint = endpoint[len("http://") :]
secure = False

client = Minio(
endpoint,
access_key=access_key,
secret_key=secret_key,
cert_check=False,
secure=secure,
)

if not os.path.exists(dataset_dir):
Expand Down

0 comments on commit de2bd73

Please sign in to comment.