cranium 0.8 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env +3 -1
- data/.gitignore +1 -0
- data/Dockerfile +22 -0
- data/bin/run_tests.sh +4 -0
- data/codeship-services.yml +24 -0
- data/codeship-steps.yml +3 -0
- data/cranium.gemspec +4 -4
- data/docker/create_databases.sql +8 -0
- data/docker/initialize_greenplum.sh +9 -0
- data/docker-compose.yml +10 -9
- data/features/restore_database_connection.feature +1 -1
- data/features/support/env.rb +2 -2
- data/repo-info.json +7 -0
- metadata +19 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4715c818c4f8f98f7d1a489979c3cf5ac1a2b50114052c6d619526fc8d0a4ca0
|
4
|
+
data.tar.gz: 6c619a8f8570cae9ef6c51002db8cf2ea6785983b70e0ace6e28b14f37e72330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e12f463f677b70d7765120658c0efcb00da40c92ef9dd321eb4e6804106cf22f1da85505dfcfd1c5baf8fb46f67f5aa3784cccd4bc7214c6ab767f4d46cd5fa9
|
7
|
+
data.tar.gz: '080472dd1a1c70907496fdf0978231b82f6b6c8da0baf6c6b0e8488398387ef75a2b2ce95731818dd2c712eff316823ac168fc4063202ad887d662304f4a30a2'
|
data/.env
CHANGED
data/.gitignore
CHANGED
data/Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
FROM ruby:2.7.3-slim
|
2
|
+
|
3
|
+
RUN apt-get update \
|
4
|
+
&& apt-get install -y --no-install-recommends \
|
5
|
+
build-essential \
|
6
|
+
libpq-dev \
|
7
|
+
postgresql-client \
|
8
|
+
git-core
|
9
|
+
|
10
|
+
RUN mkdir /app
|
11
|
+
WORKDIR /app
|
12
|
+
|
13
|
+
RUN gem install bundler
|
14
|
+
|
15
|
+
COPY Gemfile .
|
16
|
+
COPY cranium.gemspec .
|
17
|
+
|
18
|
+
ARG https_proxy
|
19
|
+
ARG http_proxy
|
20
|
+
RUN bundle install -j 5
|
21
|
+
COPY . .
|
22
|
+
RUN mkdir /tmp/custdata/
|
data/bin/run_tests.sh
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
cranium:
|
2
|
+
build:
|
3
|
+
image: cranium
|
4
|
+
dockerfile: Dockerfile
|
5
|
+
cached: true
|
6
|
+
|
7
|
+
greenplum:
|
8
|
+
image: kevinmtrowbridge/gpdb-docker
|
9
|
+
cached: true
|
10
|
+
volumes:
|
11
|
+
- gpfdist-init:/home/gpadmin/gpfdist-data
|
12
|
+
- ./docker/:/docker-entrypoint-initdb.d
|
13
|
+
- ./db:/db
|
14
|
+
command: sh /docker-entrypoint-initdb.d/initialize_greenplum.sh
|
15
|
+
|
16
|
+
build-app:
|
17
|
+
image: cranium
|
18
|
+
depends_on:
|
19
|
+
- greenplum
|
20
|
+
environment:
|
21
|
+
GREENPLUM_HOST: "greenplum"
|
22
|
+
GPFDIST_HOST: "127.0.0.1"
|
23
|
+
volumes:
|
24
|
+
- gpfdist-init:/app/tmp/custdata
|
data/codeship-steps.yml
ADDED
data/cranium.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'cranium'
|
3
|
-
spec.version = '0.8'
|
3
|
+
spec.version = '0.8.1'
|
4
4
|
spec.authors = ['Emarsys Technologies']
|
5
5
|
spec.email = ['smart-insight-dev@emarsys.com']
|
6
6
|
spec.description = %q{Provides Extract, Transform and Load functionality for loading data from CSV files to a Greenplum database.}
|
@@ -13,13 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
14
14
|
spec.require_paths = ['lib']
|
15
15
|
|
16
|
-
spec.add_runtime_dependency 'pg', '
|
16
|
+
spec.add_runtime_dependency 'pg', '>= 0'
|
17
17
|
spec.add_runtime_dependency 'progressbar', '~> 0'
|
18
18
|
spec.add_runtime_dependency 'sequel', '>= 4', '< 6'
|
19
19
|
spec.add_runtime_dependency 'slop', '~> 3'
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler'
|
22
|
-
spec.add_development_dependency 'rake', '~>
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
|
+
spec.add_development_dependency 'rake', '~> 13'
|
23
23
|
spec.add_development_dependency 'rspec', '~> 3'
|
24
24
|
spec.add_development_dependency 'ruby-prof', '~> 0'
|
25
25
|
spec.add_development_dependency 'cucumber', '~> 1'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
CREATE RESOURCE QUEUE smart_insight WITH (ACTIVE_STATEMENTS=10, PRIORITY=MEDIUM);
|
2
|
+
|
3
|
+
CREATE ROLE cranium WITH RESOURCE QUEUE smart_insight CREATEEXTTABLE LOGIN PASSWORD 'cranium';
|
4
|
+
COMMENT ON ROLE cranium IS 'Cranium test user';
|
5
|
+
|
6
|
+
CREATE DATABASE cranium WITH OWNER=cranium;
|
7
|
+
|
8
|
+
CREATE ROLE database_administrator WITH SUPERUSER LOGIN PASSWORD 'emarsys';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
echo "127.0.0.1 $(cat ~/orig_hostname)" >> /etc/hosts
|
4
|
+
|
5
|
+
service sshd start
|
6
|
+
|
7
|
+
su - gpadmin -c /usr/local/bin/run.sh
|
8
|
+
su - gpadmin -c 'cat /docker-entrypoint-initdb.d/create_databases.sql | psql -e'
|
9
|
+
su - gpadmin -c 'gpfdist -d /home/gpadmin/gpfdist-data -p 8123'
|
data/docker-compose.yml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
services:
|
2
|
+
greenplum:
|
3
|
+
image: kevinmtrowbridge/gpdb-docker
|
4
|
+
ports:
|
5
|
+
- 5432:5432
|
6
|
+
- 8123:8123
|
7
|
+
volumes:
|
8
|
+
- ./tmp/custdata:/home/gpadmin/gpfdist-data
|
9
|
+
- ./db:/db
|
10
|
+
command: sh /db/start.sh
|
@@ -16,7 +16,7 @@ Feature: Sequel database connections are fault tolerant
|
|
16
16
|
require 'sequel'
|
17
17
|
|
18
18
|
def terminate_connections
|
19
|
-
connection = Sequel.connect "postgres://database_administrator:emarsys@#{ENV['
|
19
|
+
connection = Sequel.connect "postgres://database_administrator:emarsys@#{ENV['GREENPLUM_HOST'] || '192.168.56.43'}:5432/cranium", loggers: Cranium.configuration.loggers
|
20
20
|
connection.run("SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE procpid <> pg_backend_pid() AND datname = 'cranium'")
|
21
21
|
end
|
22
22
|
|
data/features/support/env.rb
CHANGED
@@ -5,8 +5,8 @@ require_relative "../../lib/cranium"
|
|
5
5
|
FileUtils.mkdir_p("log") unless Dir.exists?("log")
|
6
6
|
|
7
7
|
Cranium.configure do |config|
|
8
|
-
config.greenplum_connection_string = "postgres://cranium:cranium@#{ENV['
|
9
|
-
config.gpfdist_url = "#{ENV['
|
8
|
+
config.greenplum_connection_string = "postgres://cranium:cranium@#{ENV['GREENPLUM_HOST'] || '192.168.56.43'}:5432/cranium"
|
9
|
+
config.gpfdist_url = "#{ ENV['GPFDIST_HOST'] || '192.168.56.43'}:8123"
|
10
10
|
config.gpfdist_home_directory = "tmp/custdata"
|
11
11
|
config.upload_directory = "cranium_build"
|
12
12
|
config.loggers << Logger.new("log/cucumber.log")
|
data/repo-info.json
ADDED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cranium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emarsys Technologies
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -76,30 +76,30 @@ dependencies:
|
|
76
76
|
name: bundler
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - "
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rake
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '13'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '13'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rspec
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,23 +162,30 @@ email:
|
|
162
162
|
- smart-insight-dev@emarsys.com
|
163
163
|
executables:
|
164
164
|
- cranium
|
165
|
+
- run_tests.sh
|
165
166
|
extensions: []
|
166
167
|
extra_rdoc_files: []
|
167
168
|
files:
|
168
169
|
- ".env"
|
169
170
|
- ".gitignore"
|
170
171
|
- ".rspec"
|
172
|
+
- Dockerfile
|
171
173
|
- Gemfile
|
172
174
|
- LICENSE.txt
|
173
175
|
- README.md
|
174
176
|
- Rakefile
|
175
177
|
- Vagrantfile
|
176
178
|
- bin/cranium
|
179
|
+
- bin/run_tests.sh
|
180
|
+
- codeship-services.yml
|
181
|
+
- codeship-steps.yml
|
177
182
|
- config/cucumber.yml
|
178
183
|
- cranium.gemspec
|
179
184
|
- db/setup.sql
|
180
185
|
- db/start.sh
|
181
186
|
- docker-compose.yml
|
187
|
+
- docker/create_databases.sql
|
188
|
+
- docker/initialize_greenplum.sh
|
182
189
|
- examples/config.rb
|
183
190
|
- examples/deduplication.rb
|
184
191
|
- examples/import_csv_with_field_lookup_inserting_new_dimension_keys.rb
|
@@ -272,6 +279,7 @@ files:
|
|
272
279
|
- lib/cranium/transformation/sequence.rb
|
273
280
|
- lib/cranium/transformation_record.rb
|
274
281
|
- rake/test.rake
|
282
|
+
- repo-info.json
|
275
283
|
- spec/cranium/application_spec.rb
|
276
284
|
- spec/cranium/archiver_spec.rb
|
277
285
|
- spec/cranium/command_line_options_spec.rb
|
@@ -319,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
327
|
- !ruby/object:Gem::Version
|
320
328
|
version: '0'
|
321
329
|
requirements: []
|
322
|
-
rubygems_version: 3.
|
330
|
+
rubygems_version: 3.2.27
|
323
331
|
signing_key:
|
324
332
|
specification_version: 4
|
325
333
|
summary: Pure Ruby ETL framework
|