funktor 0.2.3 → 0.2.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 666c2af44a969a861936755046fdb067cd118f5c1c197673d3eaf9848a88a3a0
|
4
|
+
data.tar.gz: d3a6282e200730a25192d6030f3c28876d10cc6d2b8895797dcf51033605e2c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acfa560d423d17f40e94d6605e7915b4bb2c9f8f1e52530735cf8be887451fa4990f986f8f7a314c43ce38e9d03771c9e33c6d311270dc9a18201aa2ea1760f7
|
7
|
+
data.tar.gz: abfa953bfc26962c069839a152cb05616cabb5ac8035760210fd0b815bd2efed13f1ffb597f5f027eda71d95f4a4dcc82de3c618d5b2e059aacca1d8dcb433a7
|
data/Gemfile.lock
CHANGED
data/lib/funktor/cli/init.rb
CHANGED
@@ -30,9 +30,7 @@ module Funktor
|
|
30
30
|
name
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
template "serverless.yml", File.join("serverless.yml")
|
35
|
-
end
|
33
|
+
|
36
34
|
|
37
35
|
def funktor_config_yml
|
38
36
|
#template "funktor_config.yml", File.join("funktor_config.yml")
|
@@ -54,6 +52,10 @@ module Funktor
|
|
54
52
|
template "gitignore", File.join(".gitignore")
|
55
53
|
end
|
56
54
|
|
55
|
+
def workers
|
56
|
+
template File.join("app", "workers", "hello_worker.rb"), File.join("app", "workers", "hello_worker.rb")
|
57
|
+
end
|
58
|
+
|
57
59
|
def resources
|
58
60
|
template File.join("config", "resources", "incoming_job_queue.yml"), File.join("config", "resources", "incoming_job_queue.yml")
|
59
61
|
template File.join("config", "resources", "incoming_job_queue_user.yml"), File.join("config", "resources", "incoming_job_queue_user.yml")
|
@@ -94,11 +96,34 @@ module Funktor
|
|
94
96
|
end
|
95
97
|
end
|
96
98
|
|
97
|
-
def
|
98
|
-
template
|
99
|
+
def serverless_yml
|
100
|
+
template "serverless.yml", File.join("serverless.yml")
|
99
101
|
end
|
100
102
|
|
101
103
|
private
|
104
|
+
|
105
|
+
def app_worker_names
|
106
|
+
app_worker_files.map do |file|
|
107
|
+
File.basename(file, ".rb").camelize
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def app_worker_files
|
112
|
+
Dir.glob(File.join('app', 'workers', '**.rb'))
|
113
|
+
end
|
114
|
+
|
115
|
+
def all_iam_permissions
|
116
|
+
Dir.glob(File.join('config', 'iam_permissions', '**.yml'))
|
117
|
+
end
|
118
|
+
|
119
|
+
def all_function_definitions
|
120
|
+
Dir.glob(File.join('config', 'function_definitions', '**.yml'))
|
121
|
+
end
|
122
|
+
|
123
|
+
def all_resources
|
124
|
+
Dir.glob(File.join('config', 'resources', '**.yml'))
|
125
|
+
end
|
126
|
+
|
102
127
|
def funktor_config
|
103
128
|
@funktor_config ||= YAML.load_file options[:file]
|
104
129
|
end
|
@@ -107,6 +132,10 @@ module Funktor
|
|
107
132
|
funktor_config["appName"]
|
108
133
|
end
|
109
134
|
|
135
|
+
def app_name
|
136
|
+
funktor_config["appName"]
|
137
|
+
end
|
138
|
+
|
110
139
|
def runtime
|
111
140
|
funktor_config["runtime"]
|
112
141
|
end
|
@@ -308,10 +308,10 @@ Resources:
|
|
308
308
|
"type": "metric",
|
309
309
|
"properties": {
|
310
310
|
"metrics": [
|
311
|
-
|
312
|
-
[ "
|
313
|
-
[ "...", "
|
314
|
-
|
311
|
+
<%- app_worker_names.each do |worker_name| -%>
|
312
|
+
[ "<%= app_name %>", "Duration", "WorkerClassName", "<%= worker_name %>" ],
|
313
|
+
[ "...", { "stat": "p99" } ]<%= worker_name == app_worker_names.last ? "" : "," %>
|
314
|
+
<%- end -%>
|
315
315
|
],
|
316
316
|
"view": "timeSeries",
|
317
317
|
"stacked": false,
|
@@ -27,10 +27,8 @@ provider:
|
|
27
27
|
environment: ${file(config/environment.yml)}
|
28
28
|
versionFunctions: false # Reduces the amount of storage used since all Lambdas together are limited to 75GB
|
29
29
|
iamRoleStatements:
|
30
|
-
|
31
|
-
- ${file(
|
32
|
-
<%- queue_names.each do |queue_name| -%>
|
33
|
-
- ${file(config/iam_permissions/<%= queue_name.underscore %>_queue.yml)}
|
30
|
+
<%- all_iam_permissions.each do |iam_permission| -%>
|
31
|
+
- ${file(<%= iam_permission %>)}
|
34
32
|
<%- end -%>
|
35
33
|
|
36
34
|
|
@@ -44,17 +42,13 @@ custom:
|
|
44
42
|
package: ${file(config/package.yml)}
|
45
43
|
|
46
44
|
functions:
|
47
|
-
|
48
|
-
|
49
|
-
<%= queue_name.camelize %>QueueHandler: ${file(config/function_definitions/<%= queue_name.underscore %>_queue_handler.yml)}
|
45
|
+
<%- all_function_definitions.each do |function_definition| -%>
|
46
|
+
<%= File.basename(function_definition, ".yml").camelize %>: ${file(<%= function_definition %>)}
|
50
47
|
<%- end -%>
|
51
48
|
|
52
49
|
resources:
|
53
|
-
|
54
|
-
- ${file(
|
55
|
-
- ${file(config/resources/cloudwatch_dashboard.yml)}
|
56
|
-
<%- queue_names.each do |queue_name| -%>
|
57
|
-
- ${file(config/resources/<%= queue_name.underscore %>_queue.yml)}
|
50
|
+
<%- all_resources.each do |resource| -%>
|
51
|
+
- ${file(<%= resource %>)}
|
58
52
|
<%- end -%>
|
59
53
|
|
60
54
|
plugins:
|
data/lib/funktor/version.rb
CHANGED