fluent-plugin-s3 1.7.2 → 1.8.0

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: 8c72b8fcce805d79141dededa99e19fe802a27b169f4f39b6f842dfc2829daab
4
+ data.tar.gz: eb62e090ec39010bf6f2598c827d875ae0032dccc14b71607dcd92fa80082d0e
5
5
  SHA512:
6
- metadata.gz: f0428c1da0ef734a65d86aec878374636cf4bfd10ed2ab06578d3d8a9cc8ee607e62b4a85c05144599dec2167995dbd836b70cb7cfb66f38fc38d5e82dc1073a
7
- data.tar.gz: bb4d7820ff8fa7fa3e58092b69fc78bb4804d92854206fb61c4efa21b415519eff682cf64763a9ec237f30f8997ab20b0b395bb8f1f17a8c88a9c63b3381b02b
6
+ metadata.gz: 53e0911c336861aa4dddb73e9f0f5f58fa78d8d8434a217e55f2532fbb264c7ec7e894cc9f1cfd1abc0452f065954099658420bf435dd5bfe7a8a402ecab0e25
7
+ data.tar.gz: 3916876756d629413c80a6a24f428ff6a453e284a235d0805853b4b01b7bfb6f7866426342c5a598d00a53fe3ee2daf46ac90f4ba04577f762bc3fbabfef1e7f
@@ -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,7 @@
1
+ Release 1.8.0 - 2024/11/06
2
+
3
+ * out_s3: Add zstd compression support
4
+
1
5
  Release 1.7.2 - 2022/10/19
2
6
 
3
7
  * in_s3: Add `event_bridge_mode` parameter
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.2
1
+ 1.8.0
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
 
@@ -19,6 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.add_dependency "fluentd", [">= 0.14.22", "< 2"]
20
20
  gem.add_dependency "aws-sdk-s3", "~> 1.60"
21
21
  gem.add_dependency "aws-sdk-sqs", "~> 1.23"
22
+ gem.add_dependency 'zstd-ruby'
22
23
  gem.add_development_dependency "rake", ">= 0.9.2"
23
24
  gem.add_development_dependency "test-unit", ">= 3.0.8"
24
25
  gem.add_development_dependency "test-unit-rr", ">= 1.0.3"
@@ -0,0 +1,30 @@
1
+ require 'zstd-ruby'
2
+
3
+ module Fluent::Plugin
4
+ class S3Output
5
+ class ZstdCompressor < Compressor
6
+ S3Output.register_compressor('zstd', self)
7
+
8
+ config_section :compress, param_name: :compress_config, init: true, multi: false do
9
+ desc "Compression level for zstd (1-22)"
10
+ config_param :level, :integer, default: 3
11
+ end
12
+
13
+ def ext
14
+ 'zst'.freeze
15
+ end
16
+
17
+ def content_type
18
+ 'application/x-zst'.freeze
19
+ end
20
+
21
+ def compress(chunk, tmp)
22
+ compressed = Zstd.compress(chunk.read, level: @compress_config.level)
23
+ tmp.write(compressed)
24
+ rescue => e
25
+ log.warn "zstd compression failed: #{e.message}"
26
+ raise
27
+ end
28
+ end
29
+ end
30
+ 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.0
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-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -59,6 +59,20 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.23'
62
+ - !ruby/object:Gem::Dependency
63
+ name: zstd-ruby
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: rake
64
78
  requirement: !ruby/object:Gem::Requirement
@@ -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: []