bricolage-streamingload 0.15.1 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -24
- data/RELEASE.md +23 -0
- data/bin/send-data-event +1 -1
- data/bricolage-streamingload.gemspec +2 -1
- data/lib/bricolage/streamingload/dispatcher.rb +9 -1
- data/lib/bricolage/streamingload/job.rb +14 -3
- data/lib/bricolage/streamingload/taskhandler.rb +8 -2
- data/lib/bricolage/streamingload/version.rb +1 -1
- data/testschema/testlog.json.gz +0 -0
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7c6fd20043035518ecd176cbc35686794fb150dbc61ea8c1be40b7828fb8b7
|
4
|
+
data.tar.gz: 0bebfa811896f72308cabe2d27dafad5b2a07d31c6669c1bdc7a9499f634d1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b98c1709b7da75b91406b0ba670cdb78326635ab4d029bc01a737db6a2bd01004f27509fa1c92f6fac6d5ab93402155674e3bf3b66862970de20eeba4a053ccb
|
7
|
+
data.tar.gz: cc2b3659c714c711a1174872d9dfe09c3ee99f1806d262181e7949c47e65be9893a35f57ebd22436299cb5ff2cafe14116f4a4a50750422a240e630d8d9c6288
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,51 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bricolage-streamingload (0.
|
4
|
+
bricolage-streamingload (0.16.1)
|
5
5
|
aws-sdk-s3 (~> 1.8)
|
6
6
|
aws-sdk-sqs (~> 1.3)
|
7
|
-
bricolage (
|
7
|
+
bricolage (~> 5.30)
|
8
8
|
pg (~> 0.18.0)
|
9
|
+
sentry-raven (~> 3.0)
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://rubygems.org/
|
12
13
|
specs:
|
13
|
-
aws-eventstream (1.0
|
14
|
-
aws-partitions (1.
|
15
|
-
aws-sdk-core (3.
|
16
|
-
aws-eventstream (~> 1.0)
|
17
|
-
aws-partitions (~> 1.0)
|
18
|
-
aws-sigv4 (~> 1.
|
14
|
+
aws-eventstream (1.1.0)
|
15
|
+
aws-partitions (1.351.0)
|
16
|
+
aws-sdk-core (3.104.3)
|
17
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
18
|
+
aws-partitions (~> 1, >= 1.239.0)
|
19
|
+
aws-sigv4 (~> 1.1)
|
19
20
|
jmespath (~> 1.0)
|
20
|
-
aws-sdk-kms (1.
|
21
|
-
aws-sdk-core (~> 3)
|
22
|
-
aws-sigv4 (~> 1.
|
23
|
-
aws-sdk-s3 (1.
|
24
|
-
aws-sdk-core (~> 3, >= 3.
|
21
|
+
aws-sdk-kms (1.36.0)
|
22
|
+
aws-sdk-core (~> 3, >= 3.99.0)
|
23
|
+
aws-sigv4 (~> 1.1)
|
24
|
+
aws-sdk-s3 (1.75.0)
|
25
|
+
aws-sdk-core (~> 3, >= 3.104.1)
|
25
26
|
aws-sdk-kms (~> 1)
|
26
|
-
aws-sigv4 (~> 1.
|
27
|
-
aws-sdk-sns (1.
|
28
|
-
aws-sdk-core (~> 3)
|
29
|
-
aws-sigv4 (~> 1.
|
30
|
-
aws-sdk-sqs (1.
|
31
|
-
aws-sdk-core (~> 3)
|
32
|
-
aws-sigv4 (~> 1.
|
33
|
-
aws-sigv4 (1.
|
34
|
-
|
27
|
+
aws-sigv4 (~> 1.1)
|
28
|
+
aws-sdk-sns (1.28.0)
|
29
|
+
aws-sdk-core (~> 3, >= 3.99.0)
|
30
|
+
aws-sigv4 (~> 1.1)
|
31
|
+
aws-sdk-sqs (1.30.0)
|
32
|
+
aws-sdk-core (~> 3, >= 3.99.0)
|
33
|
+
aws-sigv4 (~> 1.1)
|
34
|
+
aws-sigv4 (1.2.1)
|
35
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
36
|
+
bricolage (5.30.0)
|
35
37
|
aws-sdk-s3 (~> 1)
|
36
38
|
aws-sdk-sns (~> 1)
|
37
39
|
pg (~> 0.18.0)
|
40
|
+
faraday (1.0.1)
|
41
|
+
multipart-post (>= 1.2, < 3)
|
38
42
|
jmespath (1.4.0)
|
43
|
+
multipart-post (2.1.1)
|
39
44
|
pg (0.18.4)
|
40
45
|
power_assert (1.1.3)
|
41
|
-
rake (12.3.
|
46
|
+
rake (12.3.3)
|
47
|
+
sentry-raven (3.0.0)
|
48
|
+
faraday (>= 1.0)
|
42
49
|
test-unit (3.2.8)
|
43
50
|
power_assert
|
44
51
|
|
@@ -51,4 +58,4 @@ DEPENDENCIES
|
|
51
58
|
test-unit
|
52
59
|
|
53
60
|
BUNDLED WITH
|
54
|
-
1.
|
61
|
+
1.17.2
|
data/RELEASE.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Bricolage Streaming Load Release Note
|
2
2
|
|
3
|
+
## version 0.17.1
|
4
|
+
|
5
|
+
- [new][tmp] Sends a message to Sentry on start-up.
|
6
|
+
|
7
|
+
## version 0.17.0
|
8
|
+
|
9
|
+
- [new] Introduces Sentry error reporting. Define SENTRY_DSN environment variable to enable it.
|
10
|
+
|
11
|
+
## version 0.16.1
|
12
|
+
|
13
|
+
- [fix] Stop retrying after 2 times retried (total 3 trial).
|
14
|
+
|
15
|
+
## version 0.16.0
|
16
|
+
|
17
|
+
- [new] Retry for also error tasks, not only failure tasks.
|
18
|
+
Error tasks are assumed as "non-retriable" e.g. DB login error, but some of them are really able to be resolved
|
19
|
+
by retrying on ECS environment. Retrying is not expensive (and human operation is relatively expensive),
|
20
|
+
we'll retry on all failures and errors.
|
21
|
+
|
22
|
+
## version 0.15.2
|
23
|
+
|
24
|
+
- [fix] send-data-event: Send objectSize=0 to indicate this message is fake.
|
25
|
+
|
3
26
|
## version 0.15.1
|
4
27
|
|
5
28
|
- [new] Use the schema name in the parameters table by default (no more "no such variable: XXXX_schema" error).
|
data/bin/send-data-event
CHANGED
@@ -17,10 +17,11 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_path = 'lib'
|
18
18
|
|
19
19
|
s.required_ruby_version = '>= 2.3.0'
|
20
|
-
s.add_dependency 'bricolage', '
|
20
|
+
s.add_dependency 'bricolage', '~> 5.30'
|
21
21
|
s.add_dependency 'pg', '~> 0.18.0'
|
22
22
|
s.add_dependency 'aws-sdk-s3', '~> 1.8'
|
23
23
|
s.add_dependency 'aws-sdk-sqs', '~> 1.3'
|
24
|
+
s.add_dependency 'sentry-raven', '~> 3.0'
|
24
25
|
s.add_development_dependency 'rake'
|
25
26
|
s.add_development_dependency 'test-unit'
|
26
27
|
end
|
@@ -10,8 +10,9 @@ require 'bricolage/streamingload/chunkbuffer'
|
|
10
10
|
require 'bricolage/streamingload/loadtasklogger'
|
11
11
|
require 'bricolage/streamingload/alertinglogger'
|
12
12
|
require 'yaml'
|
13
|
-
require 'optparse'
|
14
13
|
require 'fileutils'
|
14
|
+
require 'raven'
|
15
|
+
require 'optparse'
|
15
16
|
|
16
17
|
module Bricolage
|
17
18
|
|
@@ -20,6 +21,13 @@ module Bricolage
|
|
20
21
|
class Dispatcher < SQSDataSource::MessageHandler
|
21
22
|
|
22
23
|
def Dispatcher.main
|
24
|
+
Raven.capture_message("dispatcher start")
|
25
|
+
Raven.capture {
|
26
|
+
_main
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def Dispatcher._main
|
23
31
|
opts = DispatcherOptions.new(ARGV)
|
24
32
|
opts.parse
|
25
33
|
unless opts.rest_arguments.size == 1
|
@@ -3,6 +3,7 @@ require 'bricolage/streamingload/manifest'
|
|
3
3
|
require 'bricolage/sqlutils'
|
4
4
|
require 'socket'
|
5
5
|
require 'json'
|
6
|
+
require 'raven'
|
6
7
|
|
7
8
|
module Bricolage
|
8
9
|
|
@@ -44,7 +45,8 @@ module Bricolage
|
|
44
45
|
def execute(fail_fast: false)
|
45
46
|
execute_task
|
46
47
|
return true
|
47
|
-
rescue JobCancelled
|
48
|
+
rescue JobCancelled => ex
|
49
|
+
Raven.capture_exception(ex)
|
48
50
|
return true
|
49
51
|
rescue JobDuplicated
|
50
52
|
return true
|
@@ -52,20 +54,25 @@ module Bricolage
|
|
52
54
|
return false
|
53
55
|
rescue ControlConnectionFailed => ex
|
54
56
|
@logger.error ex.message
|
57
|
+
Raven.capture_exception(ex)
|
55
58
|
wait_for_connection('ctl', @ctl_ds) unless fail_fast
|
56
59
|
return false
|
57
60
|
rescue DataConnectionFailed => ex
|
58
61
|
@logger.error ex.message
|
62
|
+
Raven.capture_exception(ex)
|
59
63
|
wait_for_connection('data', @data_ds) unless fail_fast
|
60
64
|
return false
|
61
65
|
rescue JobFailure => ex
|
62
66
|
@logger.error ex.message
|
67
|
+
Raven.capture_exception(ex)
|
63
68
|
return false
|
64
69
|
rescue JobError => ex
|
65
70
|
@logger.error ex.message
|
66
|
-
|
71
|
+
Raven.capture_exception(ex)
|
72
|
+
return false
|
67
73
|
rescue Exception => ex
|
68
74
|
@logger.exception ex
|
75
|
+
Raven.capture_exception(ex)
|
69
76
|
return true
|
70
77
|
end
|
71
78
|
|
@@ -126,7 +133,11 @@ module Bricolage
|
|
126
133
|
raise
|
127
134
|
rescue JobError => ex
|
128
135
|
ctl.open {
|
129
|
-
|
136
|
+
fail_count = @task.failure_count
|
137
|
+
final_retry = (fail_count >= MAX_RETRY)
|
138
|
+
retry_msg = (fail_count > 0) ? "(retry\##{fail_count}#{final_retry ? ' FINAL' : ''}) " : ''
|
139
|
+
ctl.abort_job job_id, 'error', retry_msg + ex.message.lines.first.strip
|
140
|
+
raise JobCancelled, "retry count exceeds limit: task_id=#{@task_id}" if final_retry
|
130
141
|
}
|
131
142
|
raise
|
132
143
|
rescue Exception => ex
|
@@ -7,6 +7,7 @@ require 'bricolage/logger'
|
|
7
7
|
require 'bricolage/exception'
|
8
8
|
require 'bricolage/version'
|
9
9
|
require 'yaml'
|
10
|
+
require 'raven'
|
10
11
|
require 'optparse'
|
11
12
|
|
12
13
|
module Bricolage
|
@@ -16,6 +17,8 @@ module Bricolage
|
|
16
17
|
class TaskHandler < SQSDataSource::MessageHandler
|
17
18
|
|
18
19
|
def TaskHandler.main
|
20
|
+
Raven.capture_message("loader start")
|
21
|
+
|
19
22
|
opts = TaskHandlerOptions.new(ARGV)
|
20
23
|
opts.parse
|
21
24
|
unless opts.rest_arguments.size <= 1
|
@@ -149,12 +152,15 @@ module Bricolage
|
|
149
152
|
|
150
153
|
class NoopJob
|
151
154
|
|
152
|
-
def initialize(context:, ctl_ds:, task_id:, force: false, logger:)
|
155
|
+
def initialize(context:, ctl_ds:, data_ds:, log_table:, task_id:, force: false, logger:)
|
153
156
|
@ctx = context
|
154
157
|
@ctl_ds = ctl_ds
|
158
|
+
@data_ds = data_ds
|
159
|
+
@log_table = log_table
|
155
160
|
@task_id = task_id
|
156
161
|
@force = force
|
157
162
|
@logger = logger
|
163
|
+
@working_dir = Dir.getwd
|
158
164
|
end
|
159
165
|
|
160
166
|
def execute(fail_fast: false)
|
@@ -164,7 +170,7 @@ module Bricolage
|
|
164
170
|
end
|
165
171
|
|
166
172
|
def execute_task
|
167
|
-
@logger.info "execute_task: task_id=#{@task_id} force=#{@force} ctx=#{@ctx.home_path} ctl_ds=#{@ctl_ds.name} dir=#{@working_dir}"
|
173
|
+
@logger.info "execute_task: task_id=#{@task_id} force=#{@force} ctx=#{@ctx.home_path} ctl_ds=#{@ctl_ds.name} data_ds=#{@data_ds.name} dir=#{@working_dir}"
|
168
174
|
end
|
169
175
|
|
170
176
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bricolage-streamingload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bricolage
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 5.
|
20
|
+
version: '5.30'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 5.
|
27
|
+
version: '5.30'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: pg
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,6 +67,20 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '1.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: sentry-raven
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3.0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.0'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: rake
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,6 +165,7 @@ files:
|
|
151
165
|
- sample/sqs-result.txt
|
152
166
|
- strload_load_logs.ct
|
153
167
|
- testschema/strload_test.ct
|
168
|
+
- testschema/testlog.json.gz
|
154
169
|
- testschema/with_work_table.job
|
155
170
|
- testschema/with_work_table.sql
|
156
171
|
- utils/init_strload_tables.sql
|
@@ -174,8 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
189
|
- !ruby/object:Gem::Version
|
175
190
|
version: '0'
|
176
191
|
requirements: []
|
177
|
-
|
178
|
-
rubygems_version: 2.7.6
|
192
|
+
rubygems_version: 3.1.2
|
179
193
|
signing_key:
|
180
194
|
specification_version: 4
|
181
195
|
summary: Bricolage Streaming Load Daemon
|