how can I download data to jupyter notebook in kubeflow from minio?

Viewed 73

Hello I am triying to download a csv from a kubeflow's minio, I am using the following script inside the jupyter notebook

from minio import Minio
client = Minio(
    "minio:9000", #localhost:9000
    access_key="minio",
    secret_key="minio123",
    secure=False
)

obj = client.get_object(
    "bucket",
    "file.csv",
)

df = pd.read_csv(obj)

but I am getting the following error:

MaxRetryError: HTTPConnectionPool(host='minio', port=9000): Max retries exceeded with url: /courses?location= (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbb17778128>: Failed to establish a new connection: [Errno -2] Name or service not known',))

How can I get access to minio node, in order to download data?

Thanks

1 Answers

Finally you can use

from minio import Minio
client = Minio(
    "minio-service.kubeflow.svc.cluster.local:9000"
    access_key="minio",
    secret_key="minio123",
    secure=False
)

obj = client.get_object(
    "bucket",
    "file.csv",
)

df = pd.read_csv(obj)
Related