minio 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +87 -0
- data/Rakefile +10 -0
- data/exe/minio +13 -0
- data/lib/minio/commands.rb +77 -0
- data/lib/minio/upstream.rb +14 -0
- data/lib/minio/version.rb +5 -0
- data/lib/minio.rb +6 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7bf7fda470b3c01d217e58cf5f2d1db51c25eb51bb03548282fbd0c2cd1bbc02
|
4
|
+
data.tar.gz: a731ae6bc25f4948631cb6c66bf0c0148553ecc4572babeef6bf9eb5c56f7d1b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e1f4586ef78728b1fd1b469227dbcd2279c955790fa02cac88e57d88bab4d5dacf26607258f24e25229d4ffeadfcf51a22d78d7b1d5c586ed93cb2ac8ec40f6a
|
7
|
+
data.tar.gz: 3979b487abc47005f10177ede08b957c2305a59738b33ba55cc721310f296e9f41537d0b7650f847e0ff462015dd61d815eec64a6d1b6a2aa8decb6248cc6bfe
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Stephen Margheim
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# minio-ruby
|
2
|
+
|
3
|
+
[MinIO](https://min.io) is an open-source S3-compatible object store. This gem provides a Ruby interface to MinIO.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
8
|
+
|
9
|
+
```sh
|
10
|
+
bundle add minio
|
11
|
+
```
|
12
|
+
|
13
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
gem install minio
|
17
|
+
```
|
18
|
+
|
19
|
+
Supported platforms are:
|
20
|
+
|
21
|
+
* arm64-darwin (darwin-arm64)
|
22
|
+
* arm64-linux (linux-arm64)
|
23
|
+
* x86_64-darwin (darwin-amd64)
|
24
|
+
* x86_64-linux (linux-amd64)
|
25
|
+
* x86_64-windows (windows-amd64)
|
26
|
+
|
27
|
+
### Using a local installation of `minio`
|
28
|
+
|
29
|
+
If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a local installation of the `minio` executable by setting an environment variable named `MINIO_INSTALL_DIR` to the directory containing the executable.
|
30
|
+
|
31
|
+
For example, if you've installed `minio` so that the executable is found at `/usr/local/bin/minio`, then you should set your environment variable like so:
|
32
|
+
|
33
|
+
``` sh
|
34
|
+
MINIO_INSTALL_DIR=/usr/local/bin
|
35
|
+
```
|
36
|
+
|
37
|
+
This also works with relative paths. If you've installed into your app's directory at `./.bin/minio`:
|
38
|
+
|
39
|
+
``` sh
|
40
|
+
MINIO_INSTALL_DIR=.bin
|
41
|
+
```
|
42
|
+
|
43
|
+
## Usage
|
44
|
+
|
45
|
+
```shell
|
46
|
+
$ minio --help
|
47
|
+
NAME:
|
48
|
+
minio - High Performance Object Storage
|
49
|
+
|
50
|
+
DESCRIPTION:
|
51
|
+
Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO
|
52
|
+
|
53
|
+
USAGE:
|
54
|
+
minio [FLAGS] COMMAND [ARGS...]
|
55
|
+
|
56
|
+
COMMANDS:
|
57
|
+
server start object storage server
|
58
|
+
|
59
|
+
FLAGS:
|
60
|
+
--certs-dir value, -S value path to certs directory
|
61
|
+
--quiet disable startup and info messages
|
62
|
+
--anonymous hide sensitive information from logging
|
63
|
+
--json output logs in JSON format
|
64
|
+
--help, -h show help
|
65
|
+
--version, -v print the version
|
66
|
+
|
67
|
+
VERSION:
|
68
|
+
RELEASE.2024-04-18T19-09-19Z
|
69
|
+
```
|
70
|
+
|
71
|
+
## Development
|
72
|
+
|
73
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
74
|
+
|
75
|
+
To install this gem onto your local machine, run `bundle exec rake install`. For maintainers, to release a new version, run `bin/release $VERSION`, which will create a git tag for the version, push git commits and tags, and push all of the platform-specific `.gem` files to [rubygems.org](https://rubygems.org).
|
76
|
+
|
77
|
+
## Contributing
|
78
|
+
|
79
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/fractaledmind/minio-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/fractaledmind/minio-ruby/blob/main/CODE_OF_CONDUCT.md).
|
80
|
+
|
81
|
+
## License
|
82
|
+
|
83
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
84
|
+
|
85
|
+
## Code of Conduct
|
86
|
+
|
87
|
+
Everyone interacting in the Sqlpkg::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fractaledmind/minio-ruby/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/exe/minio
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# because rubygems shims assume a gem's executables are Ruby
|
3
|
+
|
4
|
+
require "minio/commands"
|
5
|
+
|
6
|
+
begin
|
7
|
+
command = [MinIO::Commands.executable, *ARGV]
|
8
|
+
|
9
|
+
exec(*command)
|
10
|
+
rescue MinIO::Commands::UnsupportedPlatformException, MinIO::Commands::ExecutableNotFoundException => e
|
11
|
+
warn("ERROR: " + e.message)
|
12
|
+
exit 1
|
13
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require_relative "upstream"
|
2
|
+
|
3
|
+
module MinIO
|
4
|
+
module Commands
|
5
|
+
DEFAULT_DIR = File.expand_path(File.join(__dir__, "..", "..", "exe"))
|
6
|
+
GEM_NAME = "minio"
|
7
|
+
|
8
|
+
# raised when the host platform is not supported by upstream minio's binary releases
|
9
|
+
class UnsupportedPlatformException < StandardError
|
10
|
+
end
|
11
|
+
|
12
|
+
# raised when the minio executable could not be found where we expected it to be
|
13
|
+
class ExecutableNotFoundException < StandardError
|
14
|
+
end
|
15
|
+
|
16
|
+
# raised when MINIO_INSTALL_DIR does not exist
|
17
|
+
class DirectoryNotFoundException < StandardError
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.platform
|
21
|
+
[:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.executable(exe_path: DEFAULT_DIR)
|
25
|
+
minio_install_dir = ENV["MINIO_INSTALL_DIR"]
|
26
|
+
if minio_install_dir
|
27
|
+
if File.directory?(minio_install_dir)
|
28
|
+
warn "NOTE: using MINIO_INSTALL_DIR to find minio executable: #{minio_install_dir}"
|
29
|
+
exe_path = minio_install_dir
|
30
|
+
exe_file = File.expand_path(File.join(minio_install_dir, "minio"))
|
31
|
+
else
|
32
|
+
raise DirectoryNotFoundException, <<~MESSAGE
|
33
|
+
MINIO_INSTALL_DIR is set to #{minio_install_dir}, but that directory does not exist.
|
34
|
+
MESSAGE
|
35
|
+
end
|
36
|
+
else
|
37
|
+
if Minio::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
|
38
|
+
raise UnsupportedPlatformException, <<~MESSAGE
|
39
|
+
minio-ruby does not support the #{platform} platform
|
40
|
+
Please install minio following instructions at https://min.io/download?license=agpl
|
41
|
+
MESSAGE
|
42
|
+
end
|
43
|
+
|
44
|
+
exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "minio"))).find do |f|
|
45
|
+
Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if exe_file.nil? || !File.exist?(exe_file)
|
50
|
+
raise ExecutableNotFoundException, <<~MESSAGE
|
51
|
+
Cannot find the minio executable for #{platform} in #{exe_path}
|
52
|
+
|
53
|
+
If you're using bundler, please make sure you're on the latest bundler version:
|
54
|
+
|
55
|
+
gem install bundler
|
56
|
+
bundle update --bundler
|
57
|
+
|
58
|
+
Then make sure your lock file includes this platform by running:
|
59
|
+
|
60
|
+
bundle lock --add-platform #{platform}
|
61
|
+
bundle install
|
62
|
+
|
63
|
+
See `bundle lock --help` output for details.
|
64
|
+
|
65
|
+
If you're still seeing this message after taking those steps, try running
|
66
|
+
`bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
|
67
|
+
https://github.com/fractaledmind/minio-ruby#check-bundle_force_ruby_platform
|
68
|
+
for more details.
|
69
|
+
MESSAGE
|
70
|
+
end
|
71
|
+
|
72
|
+
exe_file
|
73
|
+
end
|
74
|
+
|
75
|
+
"MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=password ./minio server /mnt/data --console-address ":9001""
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module MinIO
|
2
|
+
module Upstream
|
3
|
+
VERSION = "RELEASE.2024-04-18T19-09-19Z"
|
4
|
+
|
5
|
+
# rubygems platform name => upstream release filename
|
6
|
+
NATIVE_PLATFORMS = {
|
7
|
+
"arm64-darwin" => "darwin-arm64/minio.#{VERSION}",
|
8
|
+
"arm64-linux" => "linux-arm64/minio.#{VERSION}",
|
9
|
+
"x86_64-darwin" => "darwin-amd64/minio.#{VERSION}",
|
10
|
+
"x86_64-linux" => "linux-amd64/minio.#{VERSION}",
|
11
|
+
"x86_64-windows" => "windows-amd64/minio.#{VERSION}"
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
data/lib/minio.rb
ADDED
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stephen Margheim
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubyzip
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
28
|
+
email:
|
29
|
+
- stephen.margheim@gmail.com
|
30
|
+
executables:
|
31
|
+
- minio
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- exe/minio
|
39
|
+
- lib/minio.rb
|
40
|
+
- lib/minio/commands.rb
|
41
|
+
- lib/minio/upstream.rb
|
42
|
+
- lib/minio/version.rb
|
43
|
+
homepage: https://github.com/fractaledmind/minio-ruby
|
44
|
+
licenses:
|
45
|
+
- MIT
|
46
|
+
metadata:
|
47
|
+
homepage_uri: https://github.com/fractaledmind/minio-ruby
|
48
|
+
rubygems_mfa_required: 'true'
|
49
|
+
source_code_uri: https://github.com/fractaledmind/minio-ruby
|
50
|
+
changelog_uri: https://github.com/fractaledmind/minio-ruby/CHANGELOG.md
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 3.0.0
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubygems_version: 3.5.1
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Integrate minio with the RubyGems infrastructure.
|
70
|
+
test_files: []
|