fluent-plugin-s3 1.7.2 → 1.8.1

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: 1450176cd690d79412b7522ce8e67163c2f3c9c1f87941e57d6b3f3410bdf330
4
- data.tar.gz: ee66229b8cd65ef2507feb5229d54322ed2f076e2daefb3f32e3b0e2ba47c634
3
+ metadata.gz: f4d7487f86806d6cf37414ff6e6654658bc42e93c4608029b5e10aba358558f0
4
+ data.tar.gz: b93f2ad6a077006a8185485a8d3239d9c9eafb68fcb1eb19bdcb95b94f3da7d0
5
5
  SHA512:
6
- metadata.gz: f0428c1da0ef734a65d86aec878374636cf4bfd10ed2ab06578d3d8a9cc8ee607e62b4a85c05144599dec2167995dbd836b70cb7cfb66f38fc38d5e82dc1073a
7
- data.tar.gz: bb4d7820ff8fa7fa3e58092b69fc78bb4804d92854206fb61c4efa21b415519eff682cf64763a9ec237f30f8997ab20b0b395bb8f1f17a8c88a9c63b3381b02b
6
+ metadata.gz: 1357ea41f8d7878ce4f71b40ef7bd8b53d8d57216264df2ffa5a433b46132628d48d5b8bbb7ffd52436d1f703a1072ec2e3e99d6a509ae6dd955c57934463534
7
+ data.tar.gz: ee4c93f4c3423e7e55962980ad8980b819fa3f206096e5ffd463a658946f3ab82079ad3650f7d88775d53471ebdc3b07bc1cc8a7c20123c04bcea5b0abdf0161
@@ -1,5 +1,6 @@
1
1
  name: Bug Report
2
2
  description: Create a report with a procedure for reproducing the bug
3
+ labels: "waiting-for-triage"
3
4
  body:
4
5
  - type: markdown
5
6
  attributes:
@@ -1,5 +1,6 @@
1
1
  name: Feature request
2
2
  description: Suggest an idea for this project
3
+ labels: "waiting-for-triage"
3
4
  body:
4
5
  - type: markdown
5
6
  attributes:
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'monthly'
@@ -10,12 +10,12 @@ jobs:
10
10
  strategy:
11
11
  fail-fast: false
12
12
  matrix:
13
- ruby: [ '3.1', '3.0', '2.7' ]
13
+ ruby: [ '3.2', '3.1', '3.0', '2.7' ]
14
14
  os:
15
15
  - ubuntu-latest
16
16
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
17
17
  steps:
18
- - uses: actions/checkout@v2
18
+ - uses: actions/checkout@v4
19
19
  - uses: ruby/setup-ruby@v1
20
20
  with:
21
21
  ruby-version: ${{ matrix.ruby }}
@@ -23,6 +23,6 @@ jobs:
23
23
  env:
24
24
  CI: true
25
25
  run: |
26
- gem install bundler rake
26
+ gem install rake
27
27
  bundle install --jobs 4 --retry 3
28
28
  bundle exec rake test
@@ -7,16 +7,18 @@ jobs:
7
7
  stale:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/stale@v3
10
+ - uses: actions/stale@v8
11
11
  with:
12
12
  repo-token: ${{ secrets.GITHUB_TOKEN }}
13
- days-before-stale: 90
14
- days-before-close: 30
15
- stale-issue-message: "This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days"
16
- stale-pr-message: "This PR has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this PR will be closed in 30 days"
17
- close-issue-message: "This issue was automatically closed because of stale in 30 days"
18
- close-pr-message: "This PR was automatically closed because of stale in 30 days"
13
+ days-before-stale: 30
14
+ days-before-close: 7
15
+ stale-issue-message: "This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days"
16
+ stale-pr-message: "This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days"
17
+ close-issue-message: "This issue was automatically closed because of stale in 7 days"
18
+ close-pr-message: "This PR was automatically closed because of stale in 7 days"
19
19
  stale-pr-label: "stale"
20
20
  stale-issue-label: "stale"
21
- exempt-issue-labels: "bug,help wanted,enhancement"
22
- exempt-pr-labels: "bug,help wanted,enhancement"
21
+ exempt-issue-labels: "waiting-for-triage,bug,help wanted,enhancement"
22
+ exempt-pr-labels: "waiting-for-triage,bug,help wanted,enhancement"
23
+ exempt-all-assignees: true
24
+ exempt-all-milestones: true
data/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ Release 1.8.1 - 2024/11/15
2
+
3
+ * dependency: Change zstd-ruby dependency optional. Install zstd-ruby manually if you want to enable Zstd compression feature.
4
+
5
+ Release 1.8.0 - 2024/11/06
6
+
7
+ * out_s3: Add zstd compression support
8
+
1
9
  Release 1.7.2 - 2022/10/19
2
10
 
3
11
  * in_s3: Add `event_bridge_mode` parameter
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.2
1
+ 1.8.1
data/docs/credentials.md CHANGED
@@ -126,7 +126,7 @@ See also:
126
126
 
127
127
  ### retries
128
128
 
129
- Number of times to retry when retrieving credentials. Default is 5.
129
+ Number of times to retry when retrieving credentials. Default is nil.
130
130
 
131
131
  ### ip_address
132
132
 
@@ -26,4 +26,5 @@ Gem::Specification.new do |gem|
26
26
  # aws-sdk-core requires one of ox, oga, libxml, nokogiri or rexml,
27
27
  # and rexml is no longer default gem as of Ruby 3.0.
28
28
  gem.add_development_dependency "rexml"
29
+ gem.add_development_dependency "zstd-ruby"
29
30
  end
@@ -0,0 +1,36 @@
1
+ module Fluent::Plugin
2
+ class S3Output
3
+ class ZstdCompressor < Compressor
4
+ S3Output.register_compressor('zstd', self)
5
+
6
+ config_section :compress, param_name: :compress_config, init: true, multi: false do
7
+ desc "Compression level for zstd (1-22)"
8
+ config_param :level, :integer, default: 3
9
+ end
10
+
11
+ def initialize(opts = {})
12
+ super
13
+ require 'zstd-ruby'
14
+ rescue LoadError => e
15
+ log.error "failed to load zstd-ruby gem. You need to manually install 'zstd-ruby' gem to use 'zstd'.", error: e.message
16
+ raise Fluent::ConfigError, "failed to load 'zstd-ruby' gem"
17
+ end
18
+
19
+ def ext
20
+ 'zst'.freeze
21
+ end
22
+
23
+ def content_type
24
+ 'application/x-zst'.freeze
25
+ end
26
+
27
+ def compress(chunk, tmp)
28
+ compressed = Zstd.compress(chunk.read, level: @compress_config.level)
29
+ tmp.write(compressed)
30
+ rescue => e
31
+ log.warn "zstd compression failed: #{e.message}"
32
+ raise
33
+ end
34
+ end
35
+ end
36
+ end
data/test/test_out_s3.rb CHANGED
@@ -109,6 +109,18 @@ class S3OutputTest < Test::Unit::TestCase
109
109
  assert(e.is_a?(Fluent::ConfigError))
110
110
  end
111
111
 
112
+ data('level default' => nil,
113
+ 'level 1' => 1)
114
+ def test_configure_with_mime_type_zstd(level)
115
+ conf = CONFIG.clone
116
+ conf << "\nstore_as zstd\n"
117
+ conf << "\n<compress>\nlevel #{level}\n</compress>\n" if level
118
+ d = create_driver(conf)
119
+ assert_equal 'zst', d.instance.instance_variable_get(:@compressor).ext
120
+ assert_equal 'application/x-zst', d.instance.instance_variable_get(:@compressor).content_type
121
+ assert_equal (level || 3), d.instance.instance_variable_get(:@compressor).instance_variable_get(:@compress_config).level
122
+ end
123
+
112
124
  def test_configure_with_path_style
113
125
  conf = CONFIG.clone
114
126
  conf << "\nforce_path_style true\n"
@@ -456,6 +468,33 @@ EOC
456
468
  FileUtils.rm_f(s3_local_file_path)
457
469
  end
458
470
 
471
+ def test_write_with_zstd
472
+ setup_mocks(true)
473
+ s3_local_file_path = "/tmp/s3-test.zst"
474
+
475
+ expected_s3path = "log/events/ts=20110102-13/events_0-#{Socket.gethostname}.zst"
476
+
477
+ setup_s3_object_mocks(s3_local_file_path: s3_local_file_path, s3path: expected_s3path)
478
+
479
+ config = CONFIG_TIME_SLICE + "\nstore_as zstd\n"
480
+ d = create_time_sliced_driver(config)
481
+
482
+ time = event_time("2011-01-02 13:14:15 UTC")
483
+ d.run(default_tag: "test") do
484
+ d.feed(time, { "a" => 1 })
485
+ d.feed(time, { "a" => 2 })
486
+ end
487
+
488
+ File.open(s3_local_file_path, 'rb') do |file|
489
+ compressed_data = file.read
490
+ uncompressed_data = Zstd.decompress(compressed_data)
491
+ expected_data = %[2011-01-02T13:14:15Z\ttest\t{"a":1}\n] +
492
+ %[2011-01-02T13:14:15Z\ttest\t{"a":2}\n]
493
+ assert_equal expected_data, uncompressed_data
494
+ end
495
+ FileUtils.rm_f(s3_local_file_path)
496
+ end
497
+
459
498
  class MockResponse
460
499
  attr_reader :data
461
500
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  - Masahiro Nakagawa
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-19 00:00:00.000000000 Z
12
+ date: 2024-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -129,6 +129,20 @@ dependencies:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
+ - !ruby/object:Gem::Dependency
133
+ name: zstd-ruby
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
132
146
  description: Amazon S3 output plugin for Fluentd event collector
133
147
  email: frsyuki@gmail.com
134
148
  executables: []
@@ -138,6 +152,7 @@ files:
138
152
  - ".github/ISSUE_TEMPLATE/bug_report.yaml"
139
153
  - ".github/ISSUE_TEMPLATE/config.yml"
140
154
  - ".github/ISSUE_TEMPLATE/feature_request.yaml"
155
+ - ".github/dependabot.yml"
141
156
  - ".github/workflows/linux.yml"
142
157
  - ".github/workflows/stale-actions.yml"
143
158
  - ".gitignore"
@@ -162,6 +177,7 @@ files:
162
177
  - lib/fluent/plugin/s3_compressor_lzma2.rb
163
178
  - lib/fluent/plugin/s3_compressor_lzo.rb
164
179
  - lib/fluent/plugin/s3_compressor_parquet.rb
180
+ - lib/fluent/plugin/s3_compressor_zstd.rb
165
181
  - lib/fluent/plugin/s3_extractor_gzip_command.rb
166
182
  - lib/fluent/plugin/s3_extractor_lzma2.rb
167
183
  - lib/fluent/plugin/s3_extractor_lzo.rb
@@ -171,7 +187,7 @@ homepage: https://github.com/fluent/fluent-plugin-s3
171
187
  licenses:
172
188
  - Apache-2.0
173
189
  metadata: {}
174
- post_install_message:
190
+ post_install_message:
175
191
  rdoc_options: []
176
192
  require_paths:
177
193
  - lib
@@ -186,8 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
202
  - !ruby/object:Gem::Version
187
203
  version: '0'
188
204
  requirements: []
189
- rubygems_version: 3.3.7
190
- signing_key:
205
+ rubygems_version: 3.5.22
206
+ signing_key:
191
207
  specification_version: 4
192
208
  summary: Amazon S3 output plugin for Fluentd event collector
193
209
  test_files: []