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

Using S3 storage with alternative S3-compliant services (e.g. Minio) #2383

Closed
oleksandr opened this issue Apr 22, 2020 · 4 comments
Closed
Labels
feature A new feature

Comments

@oleksandr
Copy link

oleksandr commented Apr 22, 2020

Use Case

There're non-production and production setups, where instead of AWS S3 alternatives are used (e.g. Minio or S3 Gateway on Azure).

Current S3 storage relies on Boto3, which doesn't support environment variable to switch endpoints:
boto/boto3#2099

Solution

Extend S3 storage configuration arguments to allow overriding endpoint.

Alternatives

Less likely to happen fast enough, but is an alternative: wait until boto3 adds this feature and rely on its environment variable.

@oleksandr oleksandr added the feature A new feature label Apr 22, 2020
@joshmeek
Copy link

@oleksandr The S3 storage currently has a client_options kwarg for passing additional options to the boto3 client. Does that satisfy your use case?

- client_options (dict, optional): Additional options for the `boto3` client.

@oleksandr
Copy link
Author

@joshmeek thanks for the prompt response! checking now...

@oleksandr
Copy link
Author

@joshmeek that helped to register the flow (the flow appeared in the Minio server), although I've noticed execution failed (result handler couldn't PUT files to the custom server).

So the working solution requires specifying Storage and ResultHandler in an explicit way:

    flow.storage = S3(
        bucket="flows",
        aws_access_key_id="admin",
        aws_secret_access_key="password",
        client_options=dict(endpoint_url=os.getenv("AWS_S3_ENDPOINT")),
    )

    flow.result_handler = S3ResultHandler(
        "flows",
        boto3_kwargs=dict(endpoint_url=os.getenv("AWS_S3_ENDPOINT"))
    )

That solves my problem and I assume the issue can be closed...

Thanks for the hint!

zanieb added a commit that referenced this issue Jul 20, 2022
* Fix requirement for docker engine for test runs

Co-authored-by: Michael Adkins <[email protected]>
Co-authored-by: Chris Guidry <[email protected]>
@FeryET
Copy link

FeryET commented May 2, 2023

Is it possible to handle this by the ui in prefect UI? On premise Minio is used a lot in our pipelines.

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

No branches or pull requests

3 participants