Skip to content

Commit 8ada2ef

Browse files
committed
refine uc3-ssm inclusion
1 parent 9cdaf9e commit 8ada2ef

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

mysql-ruby-lambda/Dockerfile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@ RUN yum -y update && yum -y upgrade
1414
# UC3 ruby code pulls a common gem from github for use in Lambda code.
1515
RUN yum -y install mysql-devel gcc make git
1616

17-
RUN gem update bundler && \
18-
git clone https://github.com/cdluc3/uc3-ssm.git && \
19-
cd uc3-ssm && \
20-
# pull a particular branch in order to build it
21-
git checkout main && \
22-
gem build uc3-ssm.gemspec && \
23-
gem install uc3-ssm*.gem && \
24-
cd ..
17+
RUN gem update bundler
2518

2619
# Start with a Gemfile containing only MySQL
2720
COPY * ./
2821

2922
RUN bundle config --local build.mysql2 --with-mysql2-config=/usr/lib64/mysql/mysql_config && \
3023
bundle config --local silence_root_warning true && \
3124
bundle config set path 'vendor/bundle' && \
32-
bundle install && \
33-
gem install uc3-ssm/uc3-ssm*.gem --install-dir vendor/bundle/ruby/3.2.0
25+
bundle install
3426

3527
# This structure assumes the following:
3628
# lambda_function.rb contains a module name LambdaFunctions which contains a class Handler

mysql-ruby-lambda/lambda_function.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# frozen_string_literal: true
22

3+
# Docs say that the LambdaLayer gems are found mounted as /opt/ruby/gems but an inspection
4+
# of the $LOAD_PATH shows that only /opt/ruby/lib is available. So we add what we want here
5+
# and indicate exactly which folders contain the *.rb files
6+
my_gem_path = Dir['/var/task/vendor/bundle/ruby/**/bundler/gems/**/lib/']
7+
$LOAD_PATH.unshift(*my_gem_path)
8+
39
require 'json'
410
require 'uc3-ssm'
511
require 'mysql2'

src-admintool/test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# docker build -t x .
55
# docker run --rm -it --entrypoint 'bundle' -e SSM_ROOT_PATH=... x exec ruby test.rb
66

7+
# Docs say that the LambdaLayer gems are found mounted as /opt/ruby/gems but an inspection
8+
# of the $LOAD_PATH shows that only /opt/ruby/lib is available. So we add what we want here
9+
# and indicate exactly which folders contain the *.rb files
10+
my_gem_path = Dir['/var/task/vendor/bundle/ruby/3.2.0/bundler/gems/**/lib/']
11+
$LOAD_PATH.unshift(*my_gem_path)
12+
713
require 'json'
814
require 'yaml'
915
require 'uc3-ssm'

src-colladmin/config/ssm.registry.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ ui:
311311
description: Byte count file size limit for direct upload through the Merritt UI
312312
upload-limit-message:
313313
description: Human readable byte count file size limit for direct upload through the Merritt UI
314+
port:
315+
description: Microservice port
314316
integ-tests:
315317
skip: true
316318
for-stage: &inttest

src-common/lambda_base.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# frozen_string_literal: true
22

3+
# Docs say that the LambdaLayer gems are found mounted as /opt/ruby/gems but an inspection
4+
# of the $LOAD_PATH shows that only /opt/ruby/lib is available. So we add what we want here
5+
# and indicate exactly which folders contain the *.rb files
6+
my_gem_path = Dir['/var/task/vendor/bundle/ruby/**/bundler/gems/**/lib/']
7+
$LOAD_PATH.unshift(*my_gem_path)
8+
39
require 'time'
410
require 'json'
511
require 'yaml'

0 commit comments

Comments
 (0)