funktor 0.7.5 → 0.7.8
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/Gemfile.lock +3 -3
- data/funktor-testapp/Dockerfile +63 -0
- data/funktor-testapp/app/services/job_flood.rb +1 -1
- data/funktor-testapp/funktor_config/boot.rb +3 -0
- data/funktor-testapp/funktor_config/environment.yml +10 -1
- data/funktor-testapp/funktor_config/function_definitions/default_queue_handler.yml +5 -1
- data/funktor-testapp/funktor_config/function_definitions/incoming_job_handler.yml +5 -1
- data/funktor-testapp/funktor_config/function_definitions/job_activator.yml +5 -1
- data/funktor-testapp/funktor_config/function_definitions/low_concurrency_queue_handler.yml +5 -1
- data/funktor-testapp/funktor_config/package.yml +6 -6
- data/funktor-testapp/funktor_config/resources/cloudwatch_dashboard.yml +645 -37
- data/funktor-testapp/funktor_config/ruby_layer.yml +1 -1
- data/funktor-testapp/serverless.yml +13 -3
- data/lib/funktor/activity_tracker.rb +1 -2
- data/lib/funktor/cli/init.rb +4 -0
- data/lib/funktor/cli/templates/Dockerfile +63 -0
- data/lib/funktor/cli/templates/funktor_config/environment.yml +10 -1
- data/lib/funktor/cli/templates/funktor_config/function_definitions/incoming_job_handler.yml +5 -1
- data/lib/funktor/cli/templates/funktor_config/function_definitions/job_activator.yml +5 -1
- data/lib/funktor/cli/templates/funktor_config/function_definitions/work_queue_handler.yml +5 -1
- data/lib/funktor/cli/templates/funktor_config/package.yml +6 -6
- data/lib/funktor/cli/templates/funktor_config/resources/cloudwatch_dashboard.yml +161 -0
- data/lib/funktor/cli/templates/funktor_config/ruby_layer.yml +1 -1
- data/lib/funktor/cli/templates/serverless.yml +13 -3
- data/lib/funktor/incoming_job_handler.rb +9 -7
- data/lib/funktor/job_activator.rb +33 -17
- data/lib/funktor/job_pusher.rb +1 -1
- data/lib/funktor/version.rb +1 -1
- data/lib/funktor/web/application.rb +1 -1
- data/lib/funktor/work_queue_handler.rb +21 -6
- data/lib/funktor.rb +20 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55a26178c2cc3afd27da38d8322aba99cb8b05b707a0c69651531ec44471bf79
|
4
|
+
data.tar.gz: 8d96412765a0711319b73137b295fdf2c2e90da61e6c2f38caa11aa0c91774f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e31ed84ec9c743a74c7f77db2859dfbadcbb6d1553c5e945185e60afaf2b0657274d4e18502bb1f7794ea9585fa5f90d91a550da29524ae5e9cd92a8f4c4533
|
7
|
+
data.tar.gz: 9b61c9c412003860d61c22f4626f9c91c6193e95aaa3e6fe45951905da80b90699f3c08e9dbb6ae3e84c1b32fa77b9850ca19c499905cbd6cd0e42b8287d2f70
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
funktor (0.7.
|
4
|
+
funktor (0.7.8)
|
5
5
|
activesupport
|
6
6
|
aws-sdk-dynamodb (~> 1.62)
|
7
7
|
aws-sdk-sqs (~> 1.37)
|
@@ -22,8 +22,8 @@ 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.
|
26
|
-
aws-sdk-core (3.
|
25
|
+
aws-partitions (1.587.0)
|
26
|
+
aws-sdk-core (3.131.0)
|
27
27
|
aws-eventstream (~> 1, >= 1.0.2)
|
28
28
|
aws-partitions (~> 1, >= 1.525.0)
|
29
29
|
aws-sigv4 (~> 1.1)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
FROM public.ecr.aws/lambda/ruby:2.7 AS build_image
|
2
|
+
|
3
|
+
# Uncomment this as a cache buster
|
4
|
+
#RUN echo date
|
5
|
+
|
6
|
+
# If you supplied buildArgs to the ecr image you can access them here using ARG & ENV
|
7
|
+
#ARG BUNDLE_GEM__FURY__IO
|
8
|
+
#ENV BUNDLE_GEM__FURY__IO=${BUNDLE_GEM__FURY__IO}
|
9
|
+
|
10
|
+
# First we install some stuff that we need for gems that have to compile native extensions
|
11
|
+
#RUN yum groupinstall "Development Tools" -y
|
12
|
+
#RUN yum install -y amazon-linux-extras
|
13
|
+
#RUN amazon-linux-extras enable postgresql11
|
14
|
+
#RUN yum install -y postgresql-devel
|
15
|
+
|
16
|
+
# Now we copy the Gemfile and Gemfile.lock into the build image so we can install our gems
|
17
|
+
COPY Gemfile Gemfile.lock .
|
18
|
+
|
19
|
+
# Set a few bundle configuration options
|
20
|
+
RUN bundle lock --add-platform x86_64-linux
|
21
|
+
#RUN bundle config --local deployment true
|
22
|
+
#RUN bundle config --local plugins false
|
23
|
+
#RUN bundle config --local frozen true
|
24
|
+
#RUN bundle config --local without 'development test'
|
25
|
+
RUN bundle config --local path './vendor/bundle'
|
26
|
+
|
27
|
+
# Now install our gems
|
28
|
+
RUN bundle install --quiet --jobs 4
|
29
|
+
|
30
|
+
# Now we start a second stage in the build that is a clean image without build tools
|
31
|
+
FROM public.ecr.aws/lambda/ruby:2.7 AS deploy_image
|
32
|
+
|
33
|
+
#ENV RAILS_ENV=production
|
34
|
+
#ENV RACK_ENV=production
|
35
|
+
|
36
|
+
# Install node so that asset related gems have a JS runtime.
|
37
|
+
# We ship the node executeable to production to make it easier to get an app deployed.
|
38
|
+
# TODO: Document steps that could be taken to remove this dependency.
|
39
|
+
#RUN curl --silent --location https://rpm.nodesource.com/setup_14.x | bash -
|
40
|
+
#RUN yum install -y nodejs
|
41
|
+
|
42
|
+
# Then copy some postgres related files
|
43
|
+
#COPY --from=build_image /usr/lib64/libpq.so.5 /usr/lib64/
|
44
|
+
#COPY --from=build_image /usr/lib64/libldap_r-2.4.so.2 /usr/lib64/
|
45
|
+
#COPY --from=build_image /usr/lib64/liblber-2.4.so.2 /usr/lib64/
|
46
|
+
#COPY --from=build_image /usr/lib64/libsasl2.so.3 /usr/lib64/
|
47
|
+
#COPY --from=build_image /usr/lib64/libssl3.so /usr/lib64/
|
48
|
+
#COPY --from=build_image /usr/lib64/libsmime3.so /usr/lib64/
|
49
|
+
#COPY --from=build_image /usr/lib64/libnss3.so /usr/lib64/
|
50
|
+
|
51
|
+
|
52
|
+
# Next we copy the app from our local directory and we copy
|
53
|
+
# the bundled gems from the build image.
|
54
|
+
# We do this after copying dependencies becuase the app will
|
55
|
+
# change more frequently, and we can used caching up to here.
|
56
|
+
|
57
|
+
COPY --from=build_image /var/task .
|
58
|
+
COPY . .
|
59
|
+
|
60
|
+
# And finally we have the CMD for the deployed container
|
61
|
+
# You can overwrite command in `serverless.yml` template
|
62
|
+
CMD [ "app.LambdaFunction::Handler.process" ]
|
63
|
+
|
@@ -23,7 +23,7 @@ class JobFlood
|
|
23
23
|
job_target_time = Time.now + (minute * 60) + rand(60)
|
24
24
|
job_sleep = rand(0.0..max_job_length_in_seconds.to_f)
|
25
25
|
puts job_target_time
|
26
|
-
[AuditWorker, AuditWorker, SingleThreadAuditWorker].sample.perform_at(job_target_time, {
|
26
|
+
[AuditWorker, AuditWorker, SingleThreadAuditWorker, HelloWorker, GreetingsWorker].sample.perform_at(job_target_time, {
|
27
27
|
mode: 'later',
|
28
28
|
message: 'msg: from random JobFlood - ' + SecureRandom.hex,
|
29
29
|
target_time: job_target_time,
|
@@ -1,7 +1,16 @@
|
|
1
|
-
BUNDLE_WITHOUT: development:test
|
1
|
+
BUNDLE_WITHOUT: development:test
|
2
2
|
BUNDLE_PLUGINS: false
|
3
3
|
BUNDLE_FROZEN: true
|
4
|
+
BUNDLE_DEPLOYMENT: true
|
4
5
|
SERVERLESS_STAGE: ${self:custom.stage}
|
6
|
+
|
7
|
+
FUNKTOR_LOG_LEVEL: INFO
|
8
|
+
|
9
|
+
RAILS_LOG_TO_STDOUT: true
|
10
|
+
RAILS_ENV: production
|
11
|
+
RACK_ENV: production
|
12
|
+
RAILS_MAX_THREADS: 1
|
13
|
+
|
5
14
|
FUNKTOR_APP_NAME: funktor-testapp
|
6
15
|
FUNKTOR_INCOMING_JOB_QUEUE:
|
7
16
|
Ref: IncomingJobQueue
|
@@ -1,8 +1,12 @@
|
|
1
|
-
handler: lambda_event_handlers/default_queue_handler.call
|
1
|
+
#handler: lambda_event_handlers/default_queue_handler.call
|
2
2
|
timeout: ${self:custom.funktor.DefaultQueueHandler.functionTimeout, 900}
|
3
3
|
reservedConcurrency: ${self:custom.funktor.DefaultQueueHandler.reservedConcurrency, null}
|
4
4
|
provisionedConcurrency: ${self:custom.funktor.DefaultQueueHandler.provisionedConcurrency, null}
|
5
5
|
memorySize: ${self:custom.funktor.DefaultQueueHandler.memorySize, 256}
|
6
|
+
image:
|
7
|
+
name: funktorimage
|
8
|
+
command:
|
9
|
+
- lambda_event_handlers/default_queue_handler.call
|
6
10
|
events:
|
7
11
|
- sqs:
|
8
12
|
batchSize: ${self:custom.funktor.DefaultQueueHandler.batchSize, 1}
|
@@ -1,8 +1,12 @@
|
|
1
|
-
handler: lambda_event_handlers/incoming_job_handler.call
|
1
|
+
#handler: lambda_event_handlers/incoming_job_handler.call
|
2
2
|
timeout: ${self:custom.funktor.IncomingJobHandler.functionTimeout, 30}
|
3
3
|
reservedConcurrency: ${self:custom.funktor.IncomingJobHandler.reservedConcurrency, null}
|
4
4
|
provisionedConcurrency: ${self:custom.funktor.IncomingJobHandler.provisionedConcurrency, null}
|
5
5
|
memorySize: ${self:custom.funktor.IncomingJobHandler.memorySize, 256}
|
6
|
+
image:
|
7
|
+
name: funktorimage
|
8
|
+
command:
|
9
|
+
- lambda_event_handlers/incoming_job_handler.call
|
6
10
|
events:
|
7
11
|
- sqs:
|
8
12
|
batchSize: ${self:custom.funktor.IncomingJobHandler.batchSize, 1}
|
@@ -1,7 +1,11 @@
|
|
1
|
-
handler: lambda_event_handlers/job_activator.call
|
1
|
+
#handler: lambda_event_handlers/job_activator.call
|
2
2
|
timeout: ${self:custom.funktor.JobActivator.functionTimeout, 30}
|
3
3
|
reservedConcurrency: ${self:custom.funktor.JobActivator.reservedConcurrency, null}
|
4
4
|
provisionedConcurrency: ${self:custom.funktor.JobActivator.provisionedConcurrency, null}
|
5
5
|
memorySize: ${self:custom.funktor.JobActivator.memorySize, 256}
|
6
|
+
image:
|
7
|
+
name: funktorimage
|
8
|
+
command:
|
9
|
+
- lambda_event_handlers/job_activator.call
|
6
10
|
events:
|
7
11
|
- schedule: rate(1 minute)
|
@@ -1,8 +1,12 @@
|
|
1
|
-
handler: lambda_event_handlers/low_concurrency_queue_handler.call
|
1
|
+
#handler: lambda_event_handlers/low_concurrency_queue_handler.call
|
2
2
|
timeout: ${self:custom.funktor.LowConcurrencyQueueHandler.functionTimeout, 900}
|
3
3
|
reservedConcurrency: ${self:custom.funktor.LowConcurrencyQueueHandler.reservedConcurrency, null}
|
4
4
|
provisionedConcurrency: ${self:custom.funktor.LowConcurrencyQueueHandler.provisionedConcurrency, null}
|
5
5
|
memorySize: ${self:custom.funktor.LowConcurrencyQueueHandler.memorySize, 256}
|
6
|
+
image:
|
7
|
+
name: funktorimage
|
8
|
+
command:
|
9
|
+
- lambda_event_handlers/low_concurrency_queue_handler.call
|
6
10
|
events:
|
7
11
|
- sqs:
|
8
12
|
batchSize: ${self:custom.funktor.LowConcurrencyQueueHandler.batchSize, 1}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# TODO - Figure out how to allow individual packaging to work out of the box.
|
2
|
-
individually: false
|
3
|
-
include:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
#individually: false
|
3
|
+
#include:
|
4
|
+
#- Gemfile
|
5
|
+
#- Gemfile.lock
|
6
|
+
#- funktor_config/boot.rb
|
7
|
+
#- app/**
|
8
8
|
# Evertyting is excluded by default with serverless-ruby-layer, but you could use
|
9
9
|
# the lines below to exlude files that are inside an include path.
|
10
10
|
#exclude:
|