minio 0.1.0-arm64-linux → 0.2.0-arm64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffd72abe9c07fc736966e04d34f5ae3737583ef9a1d03034e9cc488223885e46
4
- data.tar.gz: 5c3f3dc3dd8de0bdc60ba7db75155c26554fd2c91e108b58fc05463019a5a182
3
+ metadata.gz: 645a73e1b61d80c9f56598ebc3e9d893cc834774d05b5f7c19e45d27fb44869c
4
+ data.tar.gz: ed6f5fd691c1d49d1b0f5785655670492ca39c25561a7340591c610952cd8302
5
5
  SHA512:
6
- metadata.gz: c568211bea89bf18329d01066bb4c24fd9211f9fc949e21212e5b12dfa5b2c1de6fe381b8fc8d54b6bf00dbd5a51173bd65039e2817caf2b70255f3be233e0bc
7
- data.tar.gz: 5b442f63a3e7f725193fac466cd44fae40905e7a5b9f3ff7fdedeedec6fd853564923798ca917edeea11c668cf733c040d7de09dbb79726c7c58657a1f1558be
6
+ metadata.gz: f90387f6088ee84264c3b1afb11cb870332ba4efaefc8db7b4f7579a46ccd2e31ca835e08b1dc29ceb2f09f58908c8dd2c569cec0b6ee68932368a23a5de94e6
7
+ data.tar.gz: db699170e426711db3ddc80a86331ac331b04e8912dd078d92b7ac663e779c9715008b9ee1a9b7aed0fa6071b33e8c13996df94011cc9c4533f1ea3d8025451d
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
- ```shell
46
- $ minio --help
47
- NAME:
48
- minio - High Performance Object Storage
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
- DESCRIPTION:
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
- USAGE:
54
- minio [FLAGS] COMMAND [ARGS...]
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
- COMMANDS:
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
- 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
101
+ The MinIO `server` command supports various additional options, which can be passed through the rake task:
66
102
 
67
- VERSION:
68
- RELEASE.2024-04-18T19-09-19Z
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
@@ -10,4 +10,4 @@ begin
10
10
  rescue MinIO::Commands::UnsupportedPlatformException, MinIO::Commands::ExecutableNotFoundException => e
11
11
  warn("ERROR: " + e.message)
12
12
  exit 1
13
- end
13
+ end
@@ -17,61 +17,85 @@ module MinIO
17
17
  class DirectoryNotFoundException < StandardError
18
18
  end
19
19
 
20
- def self.platform
21
- [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
22
- end
20
+ class << self
21
+ def platform
22
+ [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
23
+ end
23
24
 
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"))
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
- 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
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 = 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
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
- if exe_file.nil? || !File.exist?(exe_file)
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
- If you're using bundler, please make sure you're on the latest bundler version:
56
+ gem install bundler
57
+ bundle update --bundler
54
58
 
55
- gem install bundler
56
- bundle update --bundler
59
+ Then make sure your lock file includes this platform by running:
57
60
 
58
- Then make sure your lock file includes this platform by running:
61
+ bundle lock --add-platform #{platform}
62
+ bundle install
59
63
 
60
- bundle lock --add-platform #{platform}
61
- bundle install
64
+ See `bundle lock --help` output for details.
62
65
 
63
- See `bundle lock --help` output for details.
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
- 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
73
+ exe_file
70
74
  end
71
75
 
72
- exe_file
73
- end
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
- "MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=password ./minio server /mnt/data --console-address ":9001""
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
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/railtie"
4
+
5
+ module MinIO
6
+ class Railtie < ::Rails::Railtie
7
+ # Load the `minio:*` Rake task into the host Rails app
8
+ rake_tasks do
9
+ load "tasks/minio_tasks.rake"
10
+ end
11
+ end
12
+ end
data/lib/minio/version.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module MinIO
4
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
5
3
  end
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.0
4
+ version: 0.2.0
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