minio 0.1.0-arm64-linux → 0.2.1-arm64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +110 -27
- data/exe/minio +1 -1
- data/lib/minio/commands.rb +66 -42
- data/lib/minio/railtie.rb +12 -0
- data/lib/minio/upstream.rb +3 -1
- data/lib/minio/version.rb +1 -3
- data/lib/minio.rb +18 -0
- data/lib/tasks/minio_tasks.rake +28 -0
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7c346a1a16e8c280c25b1364e5e42066ac3ee7b7e9f37ac9783d902fef1d03c
|
4
|
+
data.tar.gz: 041dafd4d7686308bafcb6ceb078fde90ea7f60c3fe70bcc92890ba98460c1e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f44b16d03576775dc3f094614b9574bf36eece97ac3a8abbeb5ec3cd58586a0d9c89bce7c15d8ac8567227aaab6271766de1d22b5d7c2060ba4708506be99981
|
7
|
+
data.tar.gz: e24930b28a5381db21abfd090d093278fc500c2d55cac72ebc48377990378dc9f8aff145041bce8c9b7dcdc6f9c653516a4a1cfff332dfb6d065bbb6df96466b
|
data/README.md
CHANGED
@@ -2,6 +2,30 @@
|
|
2
2
|
|
3
3
|
[MinIO](https://min.io) is an open-source S3-compatible object store. This gem provides a Ruby interface to MinIO.
|
4
4
|
|
5
|
+
<p>
|
6
|
+
<a href="https://rubygems.org/gems/minio">
|
7
|
+
<img alt="GEM Version" src="https://img.shields.io/gem/v/minio?color=168AFE&include_prereleases&logo=ruby&logoColor=FE1616">
|
8
|
+
</a>
|
9
|
+
<a href="https://rubygems.org/gems/minio">
|
10
|
+
<img alt="GEM Downloads" src="https://img.shields.io/gem/dt/minio?color=168AFE&logo=ruby&logoColor=FE1616">
|
11
|
+
</a>
|
12
|
+
<a href="https://github.com/testdouble/standard">
|
13
|
+
<img alt="Ruby Style" src="https://img.shields.io/badge/style-standard-168AFE?logo=ruby&logoColor=FE1616" />
|
14
|
+
</a>
|
15
|
+
<a href="https://github.com/fractaledmind/minio-ruby/actions/workflows/main.yml">
|
16
|
+
<img alt="Tests" src="https://github.com/fractaledmind/minio-ruby/actions/workflows/main.yml/badge.svg" />
|
17
|
+
</a>
|
18
|
+
<a href="https://github.com/sponsors/fractaledmind">
|
19
|
+
<img alt="Sponsors" src="https://img.shields.io/github/sponsors/fractaledmind?color=eb4aaa&logo=GitHub%20Sponsors" />
|
20
|
+
</a>
|
21
|
+
<a href="https://ruby.social/@fractaledmind">
|
22
|
+
<img alt="Ruby.Social Follow" src="https://img.shields.io/mastodon/follow/109291299520066427?domain=https%3A%2F%2Fruby.social&label=%40fractaledmind&style=social">
|
23
|
+
</a>
|
24
|
+
<a href="https://twitter.com/fractaledmind">
|
25
|
+
<img alt="Twitter Follow" src="https://img.shields.io/twitter/url?label=%40fractaledmind&style=social&url=https%3A%2F%2Ftwitter.com%2Ffractaledmind">
|
26
|
+
</a>
|
27
|
+
</p>
|
28
|
+
|
5
29
|
## Installation
|
6
30
|
|
7
31
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -16,14 +40,6 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
16
40
|
gem install minio
|
17
41
|
```
|
18
42
|
|
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
43
|
### Using a local installation of `minio`
|
28
44
|
|
29
45
|
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.
|
@@ -42,32 +58,99 @@ MINIO_INSTALL_DIR=.bin
|
|
42
58
|
|
43
59
|
## Usage
|
44
60
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
61
|
+
### Configuration
|
62
|
+
|
63
|
+
You can configure (if needed, this is optional) the `username` and `password` to secure the MinIO web dashboard. This Ruby interface permits you to use any method of storing secrets that you prefer. For example, you could store these secrets in Rails' encrypted credentials:
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
# config/initializers/minio.rb
|
67
|
+
minio_credentials = Rails.application.credentials.minio
|
68
|
+
Litestream.configure do |config|
|
69
|
+
config.username = minio_credentials.username
|
70
|
+
config.password = minio_credentials.password
|
71
|
+
end
|
72
|
+
```
|
73
|
+
|
74
|
+
The default credentials that MinIO uses are `minioadmin` for both the username and password. If you are using the default credentials, you do not need to configure the `username` and `password` in the initializer, but you should absolutely change the default credentials in a production environment.
|
49
75
|
|
50
|
-
|
51
|
-
Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO
|
76
|
+
If you want, you can also configure the username and password via environment variables:
|
52
77
|
|
53
|
-
|
54
|
-
|
78
|
+
```sh
|
79
|
+
export MINIO_ROOT_USER=frodo
|
80
|
+
export MINIO_ROOT_PASSWORD=ikeptmysecrets
|
81
|
+
```
|
82
|
+
|
83
|
+
### Running the server
|
84
|
+
|
85
|
+
You can start the MinIO server via the gem's rake task:
|
86
|
+
|
87
|
+
```sh
|
88
|
+
bin/rails minio:server
|
89
|
+
# or
|
90
|
+
bundle exec rake minio:server
|
91
|
+
```
|
92
|
+
|
93
|
+
If you need to pass arguments through the rake task to the underlying `minio` command, that can be done with argument forwarding:
|
94
|
+
|
95
|
+
```sh
|
96
|
+
bin/rails minio:server -- --directory /mnt/data
|
97
|
+
```
|
55
98
|
|
56
|
-
|
57
|
-
server start object storage server
|
99
|
+
This example shows the special `--directory` option available on [the `server` command](https://min.io/docs/minio/linux/reference/minio-server/minio-server.html), which allows you to specify the directory where MinIO will store its data. By default, the gem will use the `storage/minio` directory in your Rails app.
|
58
100
|
|
59
|
-
|
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
|
101
|
+
The MinIO `server` command supports various additional options, which can be passed through the rake task:
|
66
102
|
|
67
|
-
|
68
|
-
|
103
|
+
```sh
|
104
|
+
--config value specify server configuration via YAML configuration [$MINIO_CONFIG]
|
105
|
+
--address value bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname (default: ":9000") [$MINIO_ADDRESS]
|
106
|
+
--console-address value bind to a specific ADDRESS:PORT for embedded Console UI, ADDRESS can be an IP or hostname [$MINIO_CONSOLE_ADDRESS]
|
107
|
+
--ftp value enable and configure an FTP(Secure) server
|
108
|
+
--sftp value enable and configure an SFTP server
|
109
|
+
--certs-dir value, -S value path to certs directory (default: "~/.minio/certs")
|
110
|
+
--quiet disable startup and info messages
|
111
|
+
--anonymous hide sensitive information from logging
|
112
|
+
--json output logs in JSON format
|
113
|
+
--help, -h show help
|
69
114
|
```
|
70
115
|
|
116
|
+
## Troubleshooting
|
117
|
+
|
118
|
+
Some common problems experienced by users ...
|
119
|
+
|
120
|
+
### `ERROR: Cannot find the minio executable` for supported platform
|
121
|
+
|
122
|
+
Some users are reporting this error even when running on one of the supported native platforms:
|
123
|
+
|
124
|
+
* arm64-darwin (darwin-arm64)
|
125
|
+
* arm64-linux (linux-arm64)
|
126
|
+
* x86_64-darwin (darwin-amd64)
|
127
|
+
* x86_64-linux (linux-amd64)
|
128
|
+
* x86_64-windows (windows-amd64)
|
129
|
+
|
130
|
+
#### Check Bundler PLATFORMS
|
131
|
+
|
132
|
+
A possible cause of this is that Bundler has not been told to include native gems for your current platform. Please check your `Gemfile.lock` file to see whether your native platform is included in the `PLATFORMS` section. If necessary, run:
|
133
|
+
|
134
|
+
``` sh
|
135
|
+
bundle lock --add-platform <platform-name>
|
136
|
+
```
|
137
|
+
|
138
|
+
and re-bundle.
|
139
|
+
|
140
|
+
#### Check BUNDLE_FORCE_RUBY_PLATFORM
|
141
|
+
|
142
|
+
Another common cause of this is that Bundler is configured to always use the "ruby" platform via the `BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:
|
143
|
+
|
144
|
+
``` sh
|
145
|
+
bundle config unset force_ruby_platform
|
146
|
+
# or
|
147
|
+
bundle config set --local force_ruby_platform false
|
148
|
+
```
|
149
|
+
|
150
|
+
and re-bundle.
|
151
|
+
|
152
|
+
See https://bundler.io/man/bundle-config.1.html for more information.
|
153
|
+
|
71
154
|
## Development
|
72
155
|
|
73
156
|
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.
|
data/exe/minio
CHANGED
data/lib/minio/commands.rb
CHANGED
@@ -17,61 +17,85 @@ module MinIO
|
|
17
17
|
class DirectoryNotFoundException < StandardError
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
class << self
|
21
|
+
def platform
|
22
|
+
[:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
def executable(exe_path: DEFAULT_DIR)
|
26
|
+
minio_install_dir = ENV["MINIO_INSTALL_DIR"]
|
27
|
+
if minio_install_dir
|
28
|
+
if File.directory?(minio_install_dir)
|
29
|
+
warn "NOTE: using MINIO_INSTALL_DIR to find minio executable: #{minio_install_dir}"
|
30
|
+
exe_path = minio_install_dir
|
31
|
+
exe_file = File.expand_path(File.join(minio_install_dir, "minio"))
|
32
|
+
else
|
33
|
+
raise DirectoryNotFoundException, <<~MESSAGE
|
34
|
+
MINIO_INSTALL_DIR is set to #{minio_install_dir}, but that directory does not exist.
|
35
|
+
MESSAGE
|
36
|
+
end
|
31
37
|
else
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
if MinIO::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
|
39
|
+
raise UnsupportedPlatformException, <<~MESSAGE
|
40
|
+
minio-ruby does not support the #{platform} platform
|
41
|
+
Please install minio following instructions at https://min.io/download?license=agpl
|
42
|
+
MESSAGE
|
43
|
+
end
|
44
|
+
|
45
|
+
exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "minio"))).find do |f|
|
46
|
+
Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
|
47
|
+
end
|
42
48
|
end
|
43
49
|
|
44
|
-
exe_file
|
45
|
-
|
46
|
-
|
47
|
-
end
|
50
|
+
if exe_file.nil? || !File.exist?(exe_file)
|
51
|
+
raise ExecutableNotFoundException, <<~MESSAGE
|
52
|
+
Cannot find the minio executable for #{platform} in #{exe_path}
|
48
53
|
|
49
|
-
|
50
|
-
raise ExecutableNotFoundException, <<~MESSAGE
|
51
|
-
Cannot find the minio executable for #{platform} in #{exe_path}
|
54
|
+
If you're using bundler, please make sure you're on the latest bundler version:
|
52
55
|
|
53
|
-
|
56
|
+
gem install bundler
|
57
|
+
bundle update --bundler
|
54
58
|
|
55
|
-
|
56
|
-
bundle update --bundler
|
59
|
+
Then make sure your lock file includes this platform by running:
|
57
60
|
|
58
|
-
|
61
|
+
bundle lock --add-platform #{platform}
|
62
|
+
bundle install
|
59
63
|
|
60
|
-
|
61
|
-
bundle install
|
64
|
+
See `bundle lock --help` output for details.
|
62
65
|
|
63
|
-
|
66
|
+
If you're still seeing this message after taking those steps, try running
|
67
|
+
`bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
|
68
|
+
https://github.com/fractaledmind/minio-ruby#check-bundle_force_ruby_platform
|
69
|
+
for more details.
|
70
|
+
MESSAGE
|
71
|
+
end
|
64
72
|
|
65
|
-
|
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
|
73
|
+
exe_file
|
70
74
|
end
|
71
75
|
|
72
|
-
|
73
|
-
|
76
|
+
def server(directory, async: false, **argv)
|
77
|
+
if MinIO.configuration
|
78
|
+
ENV["MINIO_ROOT_USER"] ||= MinIO.configuration.username
|
79
|
+
ENV["MINIO_ROOT_PASSWORD"] ||= MinIO.configuration.password
|
80
|
+
end
|
81
|
+
|
82
|
+
cmd = [executable, "server", *argv, directory].flatten.compact
|
83
|
+
puts cmd.inspect if ENV["DEBUG"]
|
84
|
+
|
85
|
+
run(cmd, async: async)
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
74
89
|
|
75
|
-
|
90
|
+
def run(cmd, async: false)
|
91
|
+
if async
|
92
|
+
# To release the resources of the Ruby process, just fork and exit.
|
93
|
+
# The forked process executes litestream and replaces itself.
|
94
|
+
exec(*cmd) if fork.nil?
|
95
|
+
else
|
96
|
+
`#{cmd.join(" ")}`
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
76
100
|
end
|
77
101
|
end
|
data/lib/minio/upstream.rb
CHANGED
@@ -6,9 +6,11 @@ module MinIO
|
|
6
6
|
NATIVE_PLATFORMS = {
|
7
7
|
"arm64-darwin" => "darwin-arm64/minio.#{VERSION}",
|
8
8
|
"arm64-linux" => "linux-arm64/minio.#{VERSION}",
|
9
|
+
"aarch64-linux" => "linux-arm64/minio.#{VERSION}",
|
9
10
|
"x86_64-darwin" => "darwin-amd64/minio.#{VERSION}",
|
10
11
|
"x86_64-linux" => "linux-amd64/minio.#{VERSION}",
|
11
|
-
"
|
12
|
+
"x64-mingw32" => "windows-amd64/minio.#{VERSION}",
|
13
|
+
"x64-mingw-ucrt" => "windows-amd64/minio.#{VERSION}"
|
12
14
|
}
|
13
15
|
end
|
14
16
|
end
|
data/lib/minio/version.rb
CHANGED
data/lib/minio.rb
CHANGED
@@ -1,6 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "minio/version"
|
4
|
+
require_relative "minio/commands"
|
5
|
+
require_relative "minio/upstream"
|
6
|
+
require_relative "minio/railtie" if defined?(::Rails::Railtie)
|
4
7
|
|
5
8
|
module MinIO
|
9
|
+
class << self
|
10
|
+
attr_accessor :configuration
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.configure
|
14
|
+
self.configuration ||= Configuration.new
|
15
|
+
yield(configuration)
|
16
|
+
end
|
17
|
+
|
18
|
+
class Configuration
|
19
|
+
attr_accessor :username, :password
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
end
|
23
|
+
end
|
6
24
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
namespace :minio do
|
2
|
+
desc "Print the ENV variables set for the MinIO commands, if any"
|
3
|
+
task env: :environment do
|
4
|
+
if MinIO.configuration.nil?
|
5
|
+
warn "You have not configured the MinIO gem with any values to generate ENV variables"
|
6
|
+
next
|
7
|
+
end
|
8
|
+
|
9
|
+
puts "MINIO_ROOT_USER=#{MinIO.configuration.username}"
|
10
|
+
puts "MINIO_ROOT_PASSWORD=#{MinIO.configuration.password}"
|
11
|
+
|
12
|
+
true
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Start the MinIO object storage server, e.g. rake minio:server -- --directory=storage/minio"
|
16
|
+
task server: :environment do
|
17
|
+
options = {}
|
18
|
+
if (separator_index = ARGV.index("--"))
|
19
|
+
ARGV.slice(separator_index + 1, ARGV.length)
|
20
|
+
.map { |pair| pair.split("=") }
|
21
|
+
.each { |opt| options[opt[0]] = opt[1] || nil }
|
22
|
+
end
|
23
|
+
directory = options.delete("--directory") || options.delete("-directory") || "storage/minio"
|
24
|
+
options.symbolize_keys!
|
25
|
+
|
26
|
+
MinIO::Commands.server(directory, async: true, **options)
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: arm64-linux
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description:
|
28
42
|
email:
|
29
43
|
- stephen.margheim@gmail.com
|
@@ -40,8 +54,10 @@ files:
|
|
40
54
|
- exe/minio
|
41
55
|
- lib/minio.rb
|
42
56
|
- lib/minio/commands.rb
|
57
|
+
- lib/minio/railtie.rb
|
43
58
|
- lib/minio/upstream.rb
|
44
59
|
- lib/minio/version.rb
|
60
|
+
- lib/tasks/minio_tasks.rake
|
45
61
|
homepage: https://github.com/fractaledmind/minio-ruby
|
46
62
|
licenses:
|
47
63
|
- MIT
|