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

Implement support for MinIO #103

Open
6 tasks
carlspring opened this issue Nov 8, 2020 · 3 comments
Open
6 tasks

Implement support for MinIO #103

carlspring opened this issue Nov 8, 2020 · 3 comments
Labels
help wanted Extra attention is needed on hold

Comments

@carlspring
Copy link
Owner

carlspring commented Nov 8, 2020

Task Description

We need to investigate what would be required in order to add support for MinIO.

Tasks

The following tasks will need to be carried out:

  • Investigate what will need to be done.
  • Implement the necessary changes.
  • Create a MinIOITTestSuite based on the AmazonS3ITSuite one. (check Use tags instead of suites to separate tests #183)
    • Implement a JUnit extension that starts the MinIO docker image using testcontainers before all tests in the suite (and then stops it at the end). (check Set up testcontainers #60)
  • Add test cases.
  • Illustrate how to use this in the documentation.

Task Relationships

This task:

Useful Links

Help

@carlspring carlspring added the help wanted Extra attention is needed label Nov 8, 2020
@BjoernAkAManf
Copy link
Contributor

Hi,

i investigated today and it seems there is no need for any significant changes in the codebase.
I was able to configure MinIO without any problems as a drop in replacement.

I used the following Test to verify the behavior:

        final String accessKey = "AKIAIOSFODNN7EXAMPLE";
        final String secretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY";
        final URI server = URI.create("s3://localhost:9000");
        final Map<String, String> env = new HashMap<>();
        env.put(S3Factory.ACCESS_KEY, accessKey);
        env.put(S3Factory.SECRET_KEY, secretKey);
        env.put(S3Factory.PROTOCOL, "http");
        try (final FileSystem fs = FileSystems.newFileSystem(server, env, Thread.currentThread().getContextClassLoader())) {
            final Path path = fs.getPath("/meow/XYZ.txt");
            System.out.println(path);
            Files.write(path, "Hello World\nLine 1\n\nline 2\n".getBytes(StandardCharsets.UTF_8));
            System.out.println(Files.readAllLines(path));
        }

While running the MinIO Container with the following docker command (taken from here https://docs.min.io/docs/minio-docker-quickstart-guide )

docker run -p 9000:9000 \
  -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
  -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
  minio/minio server /data

I'll go work on the Test Container issue now and add some tests for this Issue as well.

@carlspring
Copy link
Owner Author

Awesome! Thanks for these great findings! :)

@rashmimaharana
Copy link

Hi,

i investigated today and it seems there is no need for any significant changes in the codebase. I was able to configure MinIO without any problems as a drop in replacement.

I used the following Test to verify the behavior:

        final String accessKey = "AKIAIOSFODNN7EXAMPLE";
        final String secretKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY";
        final URI server = URI.create("s3://localhost:9000");
        final Map<String, String> env = new HashMap<>();
        env.put(S3Factory.ACCESS_KEY, accessKey);
        env.put(S3Factory.SECRET_KEY, secretKey);
        env.put(S3Factory.PROTOCOL, "http");
        try (final FileSystem fs = FileSystems.newFileSystem(server, env, Thread.currentThread().getContextClassLoader())) {
            final Path path = fs.getPath("/meow/XYZ.txt");
            System.out.println(path);
            Files.write(path, "Hello World\nLine 1\n\nline 2\n".getBytes(StandardCharsets.UTF_8));
            System.out.println(Files.readAllLines(path));
        }

While running the MinIO Container with the following docker command (taken from here https://docs.min.io/docs/minio-docker-quickstart-guide )

docker run -p 9000:9000 \
  -e "MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE" \
  -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" \
  minio/minio server /data

I'll go work on the Test Container issue now and add some tests for this Issue as well.

Hi @BjoernAkAManf @carlspring

I tried with the above setup same code but its giving me below error. How can i handle the authorization mechanism. I am using 'org.carlspring.cloud.aws:s3fs-nio:2.0.0'

Caused by: software.amazon.awssdk.services.s3.model.S3Exception: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. (Service: S3, Status Code: 400, Request ID: 181B33ABC2438F6C, Extended Request ID: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8)

I am running minio in my local with below details.

Version:
.\minio.exe --version
minio.exe version RELEASE.2024-12-18T13-15-44Z (commit-id=16f8cf1c52f0a77eeb8f7565aaf7f7df12454583)
Runtime: go1.23.4 windows/amd64
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Copyright: 2015-2024 MinIO, Inc.

Run Command:
minio.exe server Data --console-address ":9001" --compat
MinIO Object Storage Server
Copyright: 2015-2025 MinIO, Inc.
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Version: RELEASE.2024-12-18T13-15-44Z (go1.23.4 windows/amd64)

API: http://192.168.29.131:9000 http://10.20.77.66:9000 http://127.0.0.1:9000
RootUser: admin
RootPass: password

WebUI: http://192.168.29.131:9001 http://10.20.77.66:9001 http://127.0.0.1:9001
RootUser: admin
RootPass: password

CLI: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc alias set 'myminio' 'http://192.168.29.131:9000' 'admin' 'password'

Docs: https://docs.min.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed on hold
Projects
None yet
Development

No branches or pull requests

4 participants