Skip to content

Commit de2bd73

Browse files
Update s3 bucket endpoint url to remove https prefix (#643)
* Update s3 bucket endpoint url to remove https prefix * Update e2e-readme wrt secure parameter used for minio client
1 parent 6f58a8b commit de2bd73

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/e2e.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ Currently the SDK doesn't support tolerations, so e2e tests can't be executed on
130130
AWS_STORAGE_BUCKET=<storage-bucket-name>
131131
AWS_STORAGE_BUCKET_MNIST_DIR=<storage-bucket-MNIST-datasets-directory>
132132
```
133+
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.

tests/e2e/mnist.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,20 @@ def prepare_data(self):
154154
secret_key = os.environ.get("AWS_SECRET_ACCESS_KEY")
155155
bucket_name = os.environ.get("AWS_STORAGE_BUCKET")
156156

157+
# remove prefix if specified in storage bucket endpoint url
158+
secure = True
159+
if endpoint.startswith("https://"):
160+
endpoint = endpoint[len("https://") :]
161+
elif endpoint.startswith("http://"):
162+
endpoint = endpoint[len("http://") :]
163+
secure = False
164+
157165
client = Minio(
158166
endpoint,
159167
access_key=access_key,
160168
secret_key=secret_key,
161169
cert_check=False,
170+
secure=secure,
162171
)
163172

164173
if not os.path.exists(dataset_dir):

0 commit comments

Comments
 (0)