Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using MinIO #36

Open
isedwards opened this issue Oct 29, 2022 · 1 comment
Open

Switch to using MinIO #36

isedwards opened this issue Oct 29, 2022 · 1 comment
Assignees

Comments

@isedwards
Copy link
Member

Currently we're tied to AWS S3.

Investigate switching to MinIO to become cloud provider agnostic.

@faysal-ishtiaq
Copy link
Collaborator

I have written two simple scripts to test minio's compatibility. And it seems that minio works quite well.

boto3_list_buckets.py

import boto3

# Retrieve the list of existing buckets
s3 = boto3.client(
    's3', 
    aws_access_key_id="ACCESS_KEY",
    aws_secret_access_key="SECRET_KEY"
)
response = s3.list_buckets()

# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
    print(f'  {bucket["Name"]}')

Outputs:

$ python boto3_list_buckets.py 
Existing buckets:
  climsoft-paper-archive
  demo.opencdms.org

minio_list_buckets.py

import minio

# Retrieve the list of existing buckets
s3 = minio.Minio(
    's3.amazonaws.com', 
    access_key="ACCESS_KEY",
    secret_key="SECRET_KEY"
)

response = s3.list_buckets()

# Output the bucket names
print('Existing buckets:')
for bucket in response:
    print(f'  {bucket.name}')

Outputs:

$ python minio_list_buckets.py 
Existing buckets:
  climsoft-paper-archive
  demo.opencdms.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants