bricolage 6.0.0beta4 → 6.0.0beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/README.md +3 -0
- data/RELEASE.md +22 -0
- data/Rakefile +11 -1
- data/bricolage.gemspec +1 -0
- data/config/test/datasource.yml +9 -0
- data/jobclass/streaming_load.rb +1 -1
- data/lib/bricolage/configloader.rb +1 -1
- data/lib/bricolage/dao/jobnet.rb +1 -1
- data/lib/bricolage/filedatasource.rb +1 -1
- data/lib/bricolage/genericdatasource.rb +1 -2
- data/lib/bricolage/job.rb +2 -0
- data/lib/bricolage/logger.rb +1 -1
- data/lib/bricolage/psqldatasource.rb +35 -16
- data/lib/bricolage/rubyjobclass.rb +1 -2
- data/lib/bricolage/vacuumlock.rb +2 -2
- data/lib/bricolage/version.rb +1 -1
- data/schema/Dockerfile +10 -7
- data/schema/Gemfile +1 -0
- data/schema/Gemfile.lock +18 -17
- metadata +22 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c5b2453966ea1464172b34c23e7ba3e6f44c715d745f17f07ebbddf361c437
|
4
|
+
data.tar.gz: 6044bb40e6dabedd831dc90dd4f61e8fc6614bd4b0885233ba2362b1e1c051b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 421dd79e8da48871f3a6694f4ca8bc490280acd4dfad11f10c3165854e7c6a33b76b374a5939805304d2b53307c40c048c28c266f57b54514bf9d81226c21304
|
7
|
+
data.tar.gz: 95c5f97fdf7851d6def0e87713acf3eaae136ba8d2e5971b85b10cbd7b04b95f41e28925eac4912f63d2359e818e94d09c3fa905c8947e9b38747c2c71417f08
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0
|
data/README.md
CHANGED
data/RELEASE.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Bricolage Release Note
|
2
2
|
|
3
|
+
## version 6.0.0 beta 5
|
4
|
+
|
5
|
+
- [new] Supports Ruby 3.0.
|
6
|
+
|
7
|
+
## version 6.0.0 beta 4
|
8
|
+
|
9
|
+
- [fix] rebuild-rename did not work with ALTER RENAME syntax error.
|
10
|
+
|
11
|
+
## version 6.0.0 beta 3
|
12
|
+
|
13
|
+
- [new] Upgrades pg from 0.18 to 1.2.
|
14
|
+
|
15
|
+
## version 6.0.0 beta 2
|
16
|
+
|
17
|
+
- [fix] Always transmit error messages from jobs in the jobnet.
|
18
|
+
|
19
|
+
## version 6.0.0 beta 1
|
20
|
+
|
21
|
+
- [new] Introduces database queue. Database queue saves job states in the PostgreSQL instance, we now can run bricolage on container environment.
|
22
|
+
- [new] Default log level is DEBUG on development environment, INFO on production environment.
|
23
|
+
- [new] Only updating query is logged as INFO level. Read-only queries are logged in DEBUG level.
|
24
|
+
|
3
25
|
## version 5.30.0
|
4
26
|
|
5
27
|
- [new] streaming_load: new option --ctl-ds to change S3 data source for metadata files.
|
data/Rakefile
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
require 'rake/testtask'
|
2
|
+
|
1
3
|
task :test do
|
2
|
-
|
4
|
+
desc 'Run tests'
|
5
|
+
Rake::TestTask.new do |t|
|
6
|
+
# To run test cases of specific file(s), Use:
|
7
|
+
# % rake test TEST=test/test_specified_path.rb
|
8
|
+
t.libs << "test"
|
9
|
+
t.test_files = Dir["test/**/test_*.rb"]
|
10
|
+
t.verbose = true
|
11
|
+
t.warning = true
|
12
|
+
end
|
3
13
|
end
|
data/bricolage.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_dependency 'pg', '~> 1.2.3'
|
21
21
|
s.add_dependency 'aws-sdk-s3', '~> 1.64'
|
22
22
|
s.add_dependency 'aws-sdk-sns', '~> 1.23'
|
23
|
+
s.add_dependency 'nokogiri' # aws-sdk-core requires this
|
23
24
|
s.add_development_dependency 'test-unit', '~> 3.3'
|
24
25
|
s.add_development_dependency 'rake', '~> 13.0'
|
25
26
|
s.add_development_dependency 'mocha', '~> 1.11'
|
data/jobclass/streaming_load.rb
CHANGED
@@ -144,7 +144,7 @@ class StreamingLoadJobClass < RubyJobClass
|
|
144
144
|
@ds.open {|conn|
|
145
145
|
execute_update conn, "delete #{log_table_wk};"
|
146
146
|
execute_update conn, load_log_copy_stmt(log_table_wk, log_url, @src.credential_string)
|
147
|
-
loaded,
|
147
|
+
loaded, _not_loaded = partition_loaded_objects(conn, objects, log_table_wk)
|
148
148
|
loaded.each do |obj|
|
149
149
|
obj.dequeue(force: true, noop: @noop)
|
150
150
|
end
|
data/lib/bricolage/dao/jobnet.rb
CHANGED
data/lib/bricolage/job.rb
CHANGED
data/lib/bricolage/logger.rb
CHANGED
@@ -117,21 +117,28 @@ module Bricolage
|
|
117
117
|
raise ParameterError, "could not read password: #{path}, #{user}"
|
118
118
|
end
|
119
119
|
|
120
|
-
def open
|
120
|
+
def open
|
121
121
|
retries = (ENV['BRICOLAGE_OPEN_RETRY_LIMIT'] || DEFAULT_RETRY_LIMIT).to_i
|
122
122
|
begin
|
123
123
|
conn = PostgresConnection.open_data_source(self)
|
124
|
-
conn.execute_query('select 1'){}
|
124
|
+
conn.execute_query('select 1') {}
|
125
125
|
rescue PG::ConnectionBad, PG::UnableToSend => ex
|
126
|
+
conn.close rescue nil
|
126
127
|
retries -= 1
|
127
128
|
if retries >= 0
|
128
|
-
logger.warn "
|
129
|
+
logger.warn "Could not open postgres connection; retry: #{ex.message}"
|
129
130
|
sleep 1
|
130
131
|
retry
|
132
|
+
else
|
133
|
+
raise
|
131
134
|
end
|
132
135
|
end
|
133
136
|
if block_given?
|
134
|
-
|
137
|
+
begin
|
138
|
+
yield conn
|
139
|
+
ensure
|
140
|
+
conn.close
|
141
|
+
end
|
135
142
|
else
|
136
143
|
return conn
|
137
144
|
end
|
@@ -140,23 +147,35 @@ module Bricolage
|
|
140
147
|
def open_shared_connection
|
141
148
|
raise ParameterError, 'open_shared_connection require block' unless block_given?
|
142
149
|
conn = nil
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
150
|
+
until conn
|
151
|
+
if conn_tmp = @connection_pool.shift
|
152
|
+
begin
|
153
|
+
conn_tmp.query('select 1') {}
|
154
|
+
rescue PG::ConnectionBad, PG::UnableToSend
|
155
|
+
# retry
|
156
|
+
else
|
157
|
+
# no exception occured
|
158
|
+
conn = conn_tmp
|
159
|
+
conn_tmp = nil
|
160
|
+
ensure
|
161
|
+
if conn_tmp
|
162
|
+
conn_tmp.close
|
163
|
+
conn_tmp = nil
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else
|
167
|
+
# Get a fresh connection instead of pooled connections.
|
151
168
|
conn = open
|
152
169
|
end
|
153
170
|
end
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
171
|
+
begin
|
172
|
+
yield conn
|
173
|
+
ensure
|
174
|
+
@connection_pool.push(conn)
|
175
|
+
end
|
158
176
|
end
|
159
177
|
|
178
|
+
# not MT-safe
|
160
179
|
def clear_connection_pool
|
161
180
|
@connection_pool.map(&:close)
|
162
181
|
@connection_pool = []
|
data/lib/bricolage/vacuumlock.rb
CHANGED
@@ -32,7 +32,7 @@ module Bricolage
|
|
32
32
|
|
33
33
|
def psql_serialize_vacuum_end
|
34
34
|
if enable_vacuum_lock?
|
35
|
-
path,
|
35
|
+
path, _timeout = vacuum_lock_parameters
|
36
36
|
"\\! rm -f #{path}"
|
37
37
|
else
|
38
38
|
';'
|
@@ -88,7 +88,7 @@ module Bricolage
|
|
88
88
|
|
89
89
|
def VacuumLock.cleanup_vacuum_lock
|
90
90
|
return unless enable_vacuum_lock?
|
91
|
-
path,
|
91
|
+
path, _timeout = vacuum_lock_parameters
|
92
92
|
if locking?(path)
|
93
93
|
$stderr.puts "remove VACUUM lock by #{Process.pid}"
|
94
94
|
FileUtils.rm_f path
|
data/lib/bricolage/version.rb
CHANGED
data/schema/Dockerfile
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
FROM ruby:
|
1
|
+
FROM ruby:3.0-slim
|
2
2
|
|
3
3
|
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev libpq5 postgresql-client
|
4
4
|
|
5
|
-
COPY ./Gemfile /tmp/Gemfile
|
6
|
-
COPY ./Gemfile.lock /tmp/Gemfile.lock
|
7
|
-
RUN cd /tmp && bundle install -j4 --deployment --without 'development test'
|
8
|
-
|
9
5
|
WORKDIR /app
|
10
|
-
|
11
|
-
|
6
|
+
|
7
|
+
COPY ./Gemfile .
|
8
|
+
COPY ./Gemfile.lock .
|
9
|
+
RUN gem install bundler:2.2.15 && \
|
10
|
+
bundle config set --local deployment true && \
|
11
|
+
bundle config set --local without 'development test' && \
|
12
|
+
bundle install -j4
|
13
|
+
|
14
|
+
COPY . .
|
12
15
|
|
13
16
|
CMD ["bundle", "exec", "ridgepole", "-f", "Schemafile", "-c", "database.yml", "--merge", "--dry-run"]
|
data/schema/Gemfile
CHANGED
data/schema/Gemfile.lock
CHANGED
@@ -1,37 +1,38 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activemodel (
|
5
|
-
activesupport (=
|
6
|
-
activerecord (
|
7
|
-
activemodel (=
|
8
|
-
activesupport (=
|
9
|
-
|
10
|
-
activesupport (5.2.4.3)
|
4
|
+
activemodel (6.0.3.6)
|
5
|
+
activesupport (= 6.0.3.6)
|
6
|
+
activerecord (6.0.3.6)
|
7
|
+
activemodel (= 6.0.3.6)
|
8
|
+
activesupport (= 6.0.3.6)
|
9
|
+
activesupport (6.0.3.6)
|
11
10
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
11
|
i18n (>= 0.7, < 2)
|
13
12
|
minitest (~> 5.1)
|
14
13
|
tzinfo (~> 1.1)
|
15
|
-
|
16
|
-
concurrent-ruby (1.1.
|
17
|
-
diffy (3.
|
18
|
-
i18n (1.8.
|
14
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
15
|
+
concurrent-ruby (1.1.8)
|
16
|
+
diffy (3.4.0)
|
17
|
+
i18n (1.8.10)
|
19
18
|
concurrent-ruby (~> 1.0)
|
20
|
-
minitest (5.14.
|
21
|
-
pg (1.
|
22
|
-
ridgepole (0.
|
23
|
-
activerecord (>= 5.
|
19
|
+
minitest (5.14.4)
|
20
|
+
pg (1.2.3)
|
21
|
+
ridgepole (0.9.2)
|
22
|
+
activerecord (>= 5.1, < 6.2)
|
24
23
|
diffy
|
25
24
|
thread_safe (0.3.6)
|
26
|
-
tzinfo (1.2.
|
25
|
+
tzinfo (1.2.9)
|
27
26
|
thread_safe (~> 0.1)
|
27
|
+
zeitwerk (2.4.2)
|
28
28
|
|
29
29
|
PLATFORMS
|
30
30
|
ruby
|
31
31
|
|
32
32
|
DEPENDENCIES
|
33
|
+
activerecord (~> 6.0.0)
|
33
34
|
pg
|
34
35
|
ridgepole
|
35
36
|
|
36
37
|
BUNDLED WITH
|
37
|
-
|
38
|
+
2.2.15
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bricolage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.0beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.23'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: test-unit
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,6 +131,7 @@ extensions: []
|
|
117
131
|
extra_rdoc_files: []
|
118
132
|
files:
|
119
133
|
- ".gitignore"
|
134
|
+
- ".ruby-version"
|
120
135
|
- Gemfile
|
121
136
|
- LICENSES
|
122
137
|
- README.md
|
@@ -125,6 +140,7 @@ files:
|
|
125
140
|
- bin/bricolage
|
126
141
|
- bin/bricolage-jobnet
|
127
142
|
- bricolage.gemspec
|
143
|
+
- config/test/datasource.yml
|
128
144
|
- jobclass/adhoc.rb
|
129
145
|
- jobclass/create.rb
|
130
146
|
- jobclass/createview.rb
|
@@ -194,7 +210,7 @@ homepage: https://github.com/bricolages/bricolage
|
|
194
210
|
licenses:
|
195
211
|
- MIT
|
196
212
|
metadata: {}
|
197
|
-
post_install_message:
|
213
|
+
post_install_message:
|
198
214
|
rdoc_options: []
|
199
215
|
require_paths:
|
200
216
|
- lib
|
@@ -209,8 +225,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
225
|
- !ruby/object:Gem::Version
|
210
226
|
version: 1.3.1
|
211
227
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
213
|
-
signing_key:
|
228
|
+
rubygems_version: 3.2.3
|
229
|
+
signing_key:
|
214
230
|
specification_version: 4
|
215
231
|
summary: SQL Batch Framework
|
216
232
|
test_files: []
|