pipely 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/pipely/definition.rb +0 -1
- data/lib/pipely/deploy/client.rb +21 -5
- data/lib/pipely/tasks/definition.rb +9 -1
- data/lib/pipely/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f340152a018c85f0b7528a12066e818836094117
|
4
|
+
data.tar.gz: f403ae809e469fefbd919ddcc796ac4a0e6cff0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a521348af1f0f35214b78b980e65fe88f058be2ef958730d90fb8fe0326801d2f9039703ea7586281cf6210dce9f70342f06cb003ad2f379c2db6a919b53f9a
|
7
|
+
data.tar.gz: d15ae4ae65db5d61c169b7563370ebe5474b549a9d281c52f94ea8d22560ff430f115a06f04d058de146d48ffe9edf6f3e798381493c116677f87a9d8fce484b
|
data/README.md
CHANGED
@@ -33,6 +33,9 @@ Coming soon.
|
|
33
33
|
rake graph # Graphs the full pipeline definition using Graphviz
|
34
34
|
rake upload_steps # Upload Data Pipeline steps to S3
|
35
35
|
|
36
|
+
In order to run these tasks, you must have an aws-sdk credentials file.
|
37
|
+
This can be created by running `aws cli configure`, as described [in the aws-sdk docs](http://docs.aws.amazon.com/AWSSdkDocsRuby/latest/DeveloperGuide/ruby-dg-setup.html#set-up-creds).
|
38
|
+
|
36
39
|
### Command-line Interface
|
37
40
|
|
38
41
|
(If you used the Gemfile install, prefix the below commands with `bundle exec`.)
|
data/lib/pipely/definition.rb
CHANGED
data/lib/pipely/deploy/client.rb
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
+
# Note: We are in the process of migrating from Fog to aws-sdk for communicating
|
2
|
+
# with the Data Pipeline API. aws-sdk offers several benefits, such as:
|
3
|
+
#
|
4
|
+
# * Built-in automated exponential back-off, to avoid hitting rate limits.
|
5
|
+
# * Working pagination of ListPipelines responses.
|
6
|
+
# * Authentication using IAM resource roles.
|
7
|
+
# * Faster installation.
|
8
|
+
#
|
9
|
+
# On the downside, aws-sdk does not yet support tagging of pipelines. We can
|
10
|
+
# not yet port pipely entirely away from Fog until this is resolved, so we will
|
11
|
+
# temporarily require both libraries.
|
12
|
+
|
1
13
|
require 'fog'
|
14
|
+
require 'aws-sdk'
|
2
15
|
require 'logger'
|
3
16
|
require 'tempfile'
|
4
17
|
require 'uuidtools'
|
@@ -16,6 +29,7 @@ module Pipely
|
|
16
29
|
def initialize(log=nil)
|
17
30
|
@log = log || Logger.new(STDOUT)
|
18
31
|
@data_pipelines = Fog::AWS::DataPipeline.new
|
32
|
+
@aws = AWS::DataPipeline.new.client
|
19
33
|
end
|
20
34
|
|
21
35
|
def deploy_pipeline(pipeline_basename, definition)
|
@@ -51,15 +65,17 @@ module Pipely
|
|
51
65
|
|
52
66
|
def existing_pipelines(pipeline_name)
|
53
67
|
ids = []
|
68
|
+
marker = nil
|
54
69
|
|
55
70
|
begin
|
56
|
-
|
71
|
+
options = marker ? { marker: marker } : {}
|
72
|
+
result = @aws.list_pipelines(options)
|
57
73
|
|
58
|
-
ids += result[
|
59
|
-
select { |p| p[
|
60
|
-
map { |p| p[
|
74
|
+
ids += result[:pipeline_id_list].
|
75
|
+
select { |p| p[:name] == pipeline_name }.
|
76
|
+
map { |p| p[:id] }
|
61
77
|
|
62
|
-
end while (result[
|
78
|
+
end while (result[:has_more_results] && marker = result[:marker])
|
63
79
|
|
64
80
|
ids
|
65
81
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/tasklib'
|
3
3
|
require 'pipely'
|
4
|
+
require 'json'
|
5
|
+
require 'fileutils'
|
4
6
|
|
5
7
|
module Pipely
|
6
8
|
module Tasks
|
@@ -55,8 +57,14 @@ module Pipely
|
|
55
57
|
def run_task(verbose)
|
56
58
|
puts "Generating #{target_filename}" if verbose
|
57
59
|
|
60
|
+
json = definition.to_json
|
61
|
+
|
62
|
+
unless ENV['UGLY']
|
63
|
+
json = JSON.pretty_generate(JSON.parse(json))
|
64
|
+
end
|
65
|
+
|
58
66
|
File.open(target_filename, 'w') do |file|
|
59
|
-
file.write(
|
67
|
+
file.write(json)
|
60
68
|
end
|
61
69
|
end
|
62
70
|
|
data/lib/pipely/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Gillooly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-graphviz
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.23.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aws-sdk
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.48'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.48'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: unf
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|