Skip to content

Add Minio hosting/client integration #691

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Harold-Morgan
Copy link

@Harold-Morgan Harold-Morgan commented May 18, 2025

**Closes #606 **

I've added maybe somewhat barebone (but working!) MiniO storage and client (based on the official https://github.com/minio/minio-dotnet library). It was a ton of fun.

I've added

SkipIfKeyedRegistrationIsNotSupported(useKey);

to ConformanceTests.cs/ConnectionInformationIsDelayValidated because this integration doesn't support keyed registrations untill minio/minio-dotnet#1147 is resolved. I hope this isn't too much, but maybe it should've been done in separate PR.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

@ctolkien
Copy link

Would love to see this get finished off.

IResourceBuilder<ParameterResource>? rootUser = null,
IResourceBuilder<ParameterResource>? rootPassword = null,
int minioPort = 9000,
int minioConsolePort = 9001)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove, this is usually fixed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This is usually fixed, and thinking too much about Minio Console should probably be out of scope for now.


namespace CommunityToolkit.Aspire.Hosting.Minio;

internal sealed class MinioHealthCheck : IHealthCheck
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to use the built in http health check instead of the custom one.

@davidfowl
Copy link
Contributor

This looks really good! Left a few comments.

@Harold-Morgan
Copy link
Author

I've added WithDataVolume/WithDataBindMount methods to this, because even a basic S3-compatible storage integration wihtout the way to permanently store data isn't up to my personal quality standarts

Also working on @davidfowl comments got me thinking that me "inventing" a connection string for MiniO looking like

"Endpoint=http://localhost:2000;AccessKey=minioadmin;SecretKey=p@ssw0rd1"

may not have been such a good idea (here's a link for further reference)

But currently I cannot think about any other convinient way of passing connection parameters to ApiServices in a DistributedApplication.

I'd be genuinely glad to hear any opinions on this

@davidfowl
Copy link
Contributor

may not have been such a good idea (here's a link for further reference)

It's a good idea. Just expose all of the parts of the connection string so the users can make their own connection strings, but having a default is good.

@@ -79,7 +79,7 @@ void Configure(DistributedApplicationOptions applicationOptions, HostApplication
var cfg = hostBuilderOptions.Configuration ??= new();
cfg.AddInMemoryCollection(new Dictionary<string, string?>
{
["DcpPublisher:RandomizePorts"] = "true",
["DcpPublisher:RandomizePorts"] = "false",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all tests?

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

Successfully merging this pull request may close these issues.

Add Minio/S3 hosting and client library
4 participants