diff --git a/docs/e2e.md b/docs/e2e.md index f3d0c9409..83d8ae4e7 100644 --- a/docs/e2e.md +++ b/docs/e2e.md @@ -130,3 +130,4 @@ Currently the SDK doesn't support tolerations, so e2e tests can't be executed on AWS_STORAGE_BUCKET= AWS_STORAGE_BUCKET_MNIST_DIR= ``` + 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. diff --git a/tests/e2e/mnist.py b/tests/e2e/mnist.py index 4c382f67b..143a6b6c9 100644 --- a/tests/e2e/mnist.py +++ b/tests/e2e/mnist.py @@ -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):