funktor 0.7.24 → 0.7.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fdcd3e939904ca9cd77b31c29842e3a43c5cbf53113180c8fbb32fc3fe7c5e2
4
- data.tar.gz: 3ed291a899ad41382275e2f0a1cb4da28d688a5b262831a4eed96e5487024200
3
+ metadata.gz: 4efb77bf5008c8b7045610883ea0f0229a8ebaa89d1b5f3dd4846c3e0bc7ddd4
4
+ data.tar.gz: ad9b24108efdc8747d863bc9afbf0b47fe9508c6804f48ca80eba314e681a474
5
5
  SHA512:
6
- metadata.gz: 6c2c23526960146d1d7d0e895484dba8c1403bc1dafbbe88d1fa4309765c8176294c126447b5ca4806f59f74d03ae504a710121d97301a1759234b133e6a15ce
7
- data.tar.gz: 15ad50995710277c1bf8105d53b38c6f3746ae1139613dd2f4e4630c5539204452d8675f815d50bdb53046ccae13452e939909ff081d481f435eac67318b97f5
6
+ metadata.gz: a1d9c1547d1195bab096469043bef6bd63d4183b005a1ee6e08d60ad5f894fe79d0bdeaa33a446966566904a99a088045c66348f0eb9ca5aca1543b75adf9595
7
+ data.tar.gz: ead715f1b9673487067fea8206e0bb9a0fb74bcc2a79e43bf3e07703df9a5d3f0fc3361bcde55357ef223078ed7dc1e215d325354614f379138142cc33e07bc3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funktor (0.7.24)
4
+ funktor (0.7.25)
5
5
  activesupport
6
6
  aws-sdk-dynamodb (~> 1.62)
7
7
  aws-sdk-sqs (~> 1.37)
@@ -22,7 +22,7 @@ GEM
22
22
  addressable (2.8.0)
23
23
  public_suffix (>= 2.0.2, < 5.0)
24
24
  aws-eventstream (1.2.0)
25
- aws-partitions (1.595.0)
25
+ aws-partitions (1.596.0)
26
26
  aws-sdk-core (3.131.1)
27
27
  aws-eventstream (~> 1, >= 1.0.2)
28
28
  aws-partitions (~> 1, >= 1.525.0)
@@ -8,7 +8,7 @@ FROM public.ecr.aws/lambda/ruby:2.7 AS build_image
8
8
  #ENV BUNDLE_GEM__FURY__IO=${BUNDLE_GEM__FURY__IO}
9
9
 
10
10
  # First we install some stuff that we need for gems that have to compile native extensions
11
- #RUN yum groupinstall "Development Tools" -y
11
+ RUN yum groupinstall "Development Tools" -y
12
12
  #RUN yum install -y amazon-linux-extras
13
13
  #RUN amazon-linux-extras enable postgresql11
14
14
  #RUN yum install -y postgresql-devel
@@ -57,6 +57,12 @@ FROM public.ecr.aws/lambda/ruby:2.7 AS deploy_image
57
57
  COPY --from=build_image /var/task .
58
58
  COPY . .
59
59
 
60
+ # Now we prime the bootsnap cache to minimize cold start times.
61
+
62
+ ENV BOOTSNAP_CACHE_DIR=/var/task/tmp/cache
63
+ RUN bundle exec bootsnap precompile --gemfile . \
64
+ && SKIP_ENV=true bundle exec ruby lambda_event_handlers/incoming_job_handler.rb
65
+
60
66
  # And finally we have the CMD for the deployed container
61
67
  # You can overwrite command in `serverless.yml` template
62
68
  CMD [ "app.LambdaFunction::Handler.process" ]
@@ -23,3 +23,5 @@ gem 'aws-sdk-dynamodb', '~> 1.62'
23
23
  gem "activesupport"
24
24
  gem "thor" # Thor drives the CLI TODO - Maybe we don't need it here?
25
25
 
26
+ # This helps make cold starts faster
27
+ gem 'bootsnap', require: false
@@ -22,11 +22,14 @@ GEM
22
22
  aws-sigv4 (~> 1.1)
23
23
  aws-sigv4 (1.2.4)
24
24
  aws-eventstream (~> 1, >= 1.0.2)
25
+ bootsnap (1.12.0)
26
+ msgpack (~> 1.2)
25
27
  concurrent-ruby (1.1.9)
26
28
  i18n (1.8.10)
27
29
  concurrent-ruby (~> 1.0)
28
30
  jmespath (1.4.0)
29
31
  minitest (5.14.4)
32
+ msgpack (1.5.2)
30
33
  require_all (1.5.0)
31
34
  thor (1.1.0)
32
35
  tzinfo (2.0.4)
@@ -41,6 +44,7 @@ DEPENDENCIES
41
44
  activesupport
42
45
  aws-sdk-dynamodb (~> 1.62)
43
46
  aws-sdk-sqs (~> 1.37)
47
+ bootsnap
44
48
  require_all (~> 1.0)
45
49
  thor
46
50
 
@@ -5,6 +5,9 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
5
  require "rubygems"
6
6
  require 'bundler/setup'
7
7
 
8
+ # load bootsnap for faster cold starts
9
+ require 'bootsnap/setup'
10
+
8
11
  # Set up gems listed in the Gemfile.
9
12
  Bundler.require(:default, :production)
10
13
 
@@ -52,9 +52,6 @@ custom:
52
52
  # commands. Or fallsback to what we have set in the provider section.
53
53
  stage: ${self:provider.stage, 'dev'}
54
54
  funktor: ${file(funktor_config/funktor.yml)}
55
- #rubyLayer: ${file(funktor_config/ruby_layer.yml)}
56
-
57
- #package: ${file(funktor_config/package.yml)}
58
55
 
59
56
  functions:
60
57
  IncomingJobHandler: ${file(funktor_config/function_definitions/incoming_job_handler.yml)}
@@ -72,4 +69,3 @@ resources:
72
69
  - ${file(funktor_config/resources/jobs_table.yml)}
73
70
 
74
71
  plugins:
75
- #- serverless-ruby-layer
@@ -33,27 +33,13 @@ module Funktor
33
33
  def funktor_config_yml
34
34
  #template "funktor_config.yml", File.join("funktor_config.yml")
35
35
  template File.join("funktor_config", "funktor.yml"), File.join("funktor_config", "funktor.yml")
36
- template File.join("funktor_config", "ruby_layer.yml"), File.join("funktor_config", "ruby_layer.yml")
37
- template File.join("funktor_config", "package.yml"), File.join("funktor_config", "package.yml")
38
36
  template File.join("funktor_config", "environment.yml"), File.join("funktor_config", "environment.yml")
39
37
  template File.join("funktor_config", "boot.rb"), File.join("funktor_config", "boot.rb")
40
38
  end
41
39
 
42
40
  def package_json
43
41
  if File.exist?("package.json")
44
- package_data = File.open("package.json").read
45
- if package_data =~ /serverless-ruby-layer/
46
- say "serverless-ruby-layer is already installed in package.json"
47
- else
48
- if File.exist?("package-lock.json")
49
- run "npm install serverless-ruby-layer@1.4.0 --save-dev"
50
- # TODO - Add handers for yarn and what not
51
- elsif File.exist?("yarn.lock")
52
- run "yarn add --dev serverless-ruby-layer@1.4.0"
53
- else
54
- say "You should install serverless-ruby-layer version 1.4.0 using yor package manager of choice."
55
- end
56
- end
42
+ say "package.json already exists"
57
43
  else
58
44
  template "package.json", File.join("package.json")
59
45
  end
@@ -8,7 +8,7 @@ FROM public.ecr.aws/lambda/ruby:2.7 AS build_image
8
8
  #ENV BUNDLE_GEM__FURY__IO=${BUNDLE_GEM__FURY__IO}
9
9
 
10
10
  # First we install some stuff that we need for gems that have to compile native extensions
11
- #RUN yum groupinstall "Development Tools" -y
11
+ RUN yum groupinstall "Development Tools" -y
12
12
  #RUN yum install -y amazon-linux-extras
13
13
  #RUN amazon-linux-extras enable postgresql11
14
14
  #RUN yum install -y postgresql-devel
@@ -57,6 +57,12 @@ FROM public.ecr.aws/lambda/ruby:2.7 AS deploy_image
57
57
  COPY --from=build_image /var/task .
58
58
  COPY . .
59
59
 
60
+ # Now we prime the bootsnap cache to minimize cold start times.
61
+
62
+ ENV BOOTSNAP_CACHE_DIR=/var/task/tmp/cache
63
+ RUN bundle exec bootsnap precompile --gemfile . \
64
+ && SKIP_ENV=true bundle exec ruby lambda_event_handlers/incoming_job_handler.rb
65
+
60
66
  # And finally we have the CMD for the deployed container
61
67
  # You can overwrite command in `serverless.yml` template
62
68
  CMD [ "app.LambdaFunction::Handler.process" ]
@@ -4,4 +4,4 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
4
4
  ruby '~> 2.7'
5
5
 
6
6
  gem 'funktor'
7
-
7
+ gem 'bootsnap', require: false
@@ -5,6 +5,9 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
5
  require "rubygems"
6
6
  require 'bundler/setup'
7
7
 
8
+ # load bootsnap for faster cold starts
9
+ require 'bootsnap/setup'
10
+
8
11
  # Set up gems listed in the Gemfile.
9
12
  Bundler.require(:default, :production)
10
13
 
@@ -38,12 +38,12 @@ handlerDefaults:
38
38
  # Visibility timeout should only come into play in the case of Funktor errors.
39
39
  # Application level errors should be handled by Funktor retry mechanisms.
40
40
  # The visibility timeout should be at least as long as the function timeout, and up to 6 times larger.
41
- visibilityTimeout: 1800
41
+ visibilityTimeout: 300
42
42
 
43
43
  # Max recieve count affects how many times a job will retry that has been throttled at the SQS -> Lambda boundary.
44
44
  # Amazon recommend this be at least 5, but I've found that higher numbers are better to avoid legit jobs ending
45
45
  # up in the dead letter queue
46
- maxReceiveCount: 20
46
+ maxReceiveCount: 120
47
47
 
48
48
  # Incoming Job Handler
49
49
  incomingJobHandler:
@@ -3,6 +3,5 @@
3
3
  "description": "",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "serverless-ruby-layer": "^1.4.0"
7
6
  }
8
7
  }
@@ -49,9 +49,6 @@ custom:
49
49
  # commands. Or fallsback to what we have set in the provider section.
50
50
  stage: ${self:provider.stage, 'dev'}
51
51
  funktor: ${file(funktor_config/funktor.yml)}
52
- #rubyLayer: ${file(funktor_config/ruby_layer.yml)}
53
-
54
- #package: ${file(funktor_config/package.yml)}
55
52
 
56
53
  functions:
57
54
  <%- all_function_definitions.each do |function_definition| -%>
@@ -64,4 +61,3 @@ resources:
64
61
  <%- end -%>
65
62
 
66
63
  plugins:
67
- #- serverless-ruby-layer
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.7.24"
2
+ VERSION = "0.7.25"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.24
4
+ version: 0.7.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-03 00:00:00.000000000 Z
11
+ date: 2022-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
@@ -199,14 +199,12 @@ files:
199
199
  - funktor-testapp/funktor_config/iam_permissions/jobs_table_secondary_index.yml
200
200
  - funktor-testapp/funktor_config/iam_permissions/low_concurrency_queue.yml
201
201
  - funktor-testapp/funktor_config/iam_permissions/ssm.yml
202
- - funktor-testapp/funktor_config/package.yml
203
202
  - funktor-testapp/funktor_config/resources/cloudwatch_dashboard.yml
204
203
  - funktor-testapp/funktor_config/resources/default_queue.yml
205
204
  - funktor-testapp/funktor_config/resources/incoming_job_queue.yml
206
205
  - funktor-testapp/funktor_config/resources/incoming_job_queue_user.yml
207
206
  - funktor-testapp/funktor_config/resources/jobs_table.yml
208
207
  - funktor-testapp/funktor_config/resources/low_concurrency_queue.yml
209
- - funktor-testapp/funktor_config/ruby_layer.yml
210
208
  - funktor-testapp/funktor_init.yml
211
209
  - funktor-testapp/lambda_event_handlers/default_queue_handler.rb
212
210
  - funktor-testapp/lambda_event_handlers/incoming_job_handler.rb
@@ -242,13 +240,11 @@ files:
242
240
  - lib/funktor/cli/templates/funktor_config/iam_permissions/jobs_table_secondary_index.yml
243
241
  - lib/funktor/cli/templates/funktor_config/iam_permissions/ssm.yml
244
242
  - lib/funktor/cli/templates/funktor_config/iam_permissions/work_queue.yml
245
- - lib/funktor/cli/templates/funktor_config/package.yml
246
243
  - lib/funktor/cli/templates/funktor_config/resources/cloudwatch_dashboard.yml
247
244
  - lib/funktor/cli/templates/funktor_config/resources/incoming_job_queue.yml
248
245
  - lib/funktor/cli/templates/funktor_config/resources/incoming_job_queue_user.yml
249
246
  - lib/funktor/cli/templates/funktor_config/resources/jobs_table.yml
250
247
  - lib/funktor/cli/templates/funktor_config/resources/work_queue.yml
251
- - lib/funktor/cli/templates/funktor_config/ruby_layer.yml
252
248
  - lib/funktor/cli/templates/funktor_init.yml.tt
253
249
  - lib/funktor/cli/templates/gitignore
254
250
  - lib/funktor/cli/templates/lambda_event_handlers/incoming_job_handler.rb
@@ -1,11 +0,0 @@
1
- # TODO - Figure out how to allow individual packaging to work out of the box.
2
- #individually: false
3
- #include:
4
- #- Gemfile
5
- #- Gemfile.lock
6
- #- funktor_config/boot.rb
7
- #- app/**
8
- # Evertyting is excluded by default with serverless-ruby-layer, but you could use
9
- # the lines below to exlude files that are inside an include path.
10
- #exclude:
11
- # - workers/excluded_worker.rb
@@ -1,11 +0,0 @@
1
- #use_docker: false
2
- #docker_yums:
3
- #- postgresql-devel
4
- #native_libs:
5
- #- /usr/lib64/libpq.so.5
6
- #- /usr/lib64/libldap_r-2.4.so.2
7
- #- /usr/lib64/liblber-2.4.so.2
8
- #- /usr/lib64/libsasl2.so.3
9
- #- /usr/lib64/libssl3.so
10
- #- /usr/lib64/libsmime3.so
11
- #- /usr/lib64/libnss3.so
@@ -1,11 +0,0 @@
1
- # TODO - Figure out how to allow individual packaging to work out of the box.
2
- #individually: false
3
- #include:
4
- #- Gemfile
5
- #- Gemfile.lock
6
- #- funktor_config/boot.rb
7
- #- app/**
8
- # Evertyting is excluded by default with serverless-ruby-layer, but you could use
9
- # the lines below to exlude files that are inside an include path.
10
- #exclude:
11
- # - workers/excluded_worker.rb
@@ -1,11 +0,0 @@
1
- #use_docker: false
2
- #docker_yums:
3
- #- postgresql-devel
4
- #native_libs:
5
- #- /usr/lib64/libpq.so.5
6
- #- /usr/lib64/libldap_r-2.4.so.2
7
- #- /usr/lib64/liblber-2.4.so.2
8
- #- /usr/lib64/libsasl2.so.3
9
- #- /usr/lib64/libssl3.so
10
- #- /usr/lib64/libsmime3.so
11
- #- /usr/lib64/libnss3.so