diff --git a/.tool-versions b/.tool-versions index 2d76f1a75..dca91f501 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ terraform 1.5.6 -ruby 3.2.2 +ruby 3.3.1 golang 1.22.1 diff --git a/components/app/.tool-versions b/components/app/.tool-versions index f2a971aa7..51f617d22 100644 --- a/components/app/.tool-versions +++ b/components/app/.tool-versions @@ -1 +1 @@ -ruby 3.2.2 +ruby 3.3.1 diff --git a/components/app/Dockerfile b/components/app/Dockerfile index 1f68baa94..f84bef642 100644 --- a/components/app/Dockerfile +++ b/components/app/Dockerfile @@ -1,4 +1,5 @@ -FROM ruby:3.2-alpine AS build-env +ARG RUBY_VERSION=3.3 +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine AS build-image ARG APP_ROOT="/app" ENV BUNDLE_APP_CONFIG="/app/.bundle" @@ -23,7 +24,7 @@ RUN mkdir -p tmp/pids RUN rm -rf vendor/bundle/ruby/*/cache/ && find vendor/ -name "*.o" -delete && find vendor/ -name "*.c" -FROM ruby:3.2-alpine +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine ARG APP_ROOT="/app" ENV BUNDLE_APP_CONFIG="/app/.bundle" @@ -35,6 +36,8 @@ RUN apk update && \ apk add --update --no-cache build-base pcre-dev && \ gem install bundler -COPY --from=build-env $APP_ROOT $APP_ROOT +COPY --from=build-image $APP_ROOT $APP_ROOT + +ENV RUBY_YJIT_ENABLE=true CMD ["bundle", "exec", "ahn", "start", "--no-console"] diff --git a/components/app/Gemfile.lock b/components/app/Gemfile.lock index 6e9c41c93..2b9565bfa 100644 --- a/components/app/Gemfile.lock +++ b/components/app/Gemfile.lock @@ -74,7 +74,7 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -89,17 +89,17 @@ GEM adhearsion-loquacious (1.9.3) ast (2.4.2) aws-eventstream (1.3.0) - aws-partitions (1.925.0) - aws-sdk-core (3.194.2) + aws-partitions (1.940.0) + aws-sdk-core (3.197.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-lambda (1.119.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-lambda (1.121.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) - aws-sdk-polly (1.84.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-polly (1.86.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) @@ -108,7 +108,7 @@ GEM ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) base64 (0.2.0) - bigdecimal (3.1.7) + bigdecimal (3.1.8) celluloid (0.18.0) timers (~> 4) celluloid-fsm (0.20.5) @@ -124,7 +124,7 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) connection_pool (2.4.1) countdownlatch (1.0.0) crack (1.0.0) @@ -139,7 +139,7 @@ GEM drb (2.2.1) equalizer (0.0.11) eventmachine (1.2.7) - faraday (2.9.0) + faraday (2.9.1) faraday-net_http (>= 2.0, < 3.2) faraday-net_http (3.1.0) net-http @@ -160,7 +160,7 @@ GEM domain_name (~> 0.5) http-form_data (2.3.0) http_parser.rb (0.8.0) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) ice_nine (0.11.2) jmespath (1.6.2) @@ -175,8 +175,8 @@ GEM logging (2.3.1) little-plugger (~> 1.1) multi_json (~> 1.14) - method_source (1.0.0) - minitest (5.22.3) + method_source (1.1.0) + minitest (5.23.1) mock_redis (0.44.0) multi_json (1.15.0) mustermann (3.0.0) @@ -186,25 +186,25 @@ GEM uri niceogiri (1.1.2) nokogiri (~> 1.5) - nio4r (2.7.1) - nokogiri (1.16.4-arm-linux) + nio4r (2.7.3) + nokogiri (1.16.5-arm-linux) racc (~> 1.4) - nokogiri (1.16.4-arm64-darwin) + nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) okcomputer (1.18.5) - parallel (1.24.0) - parser (3.3.1.0) + parallel (1.25.1) + parser (3.3.3.0) ast (~> 2.4.1) racc phony (2.20.12) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.4) - racc (1.7.3) - rack (3.0.10) + public_suffix (5.0.5) + racc (1.8.0) + rack (3.0.11) rack-protection (4.0.0) base64 (>= 0.1.0) rack (>= 3.0.0, < 4) @@ -216,13 +216,14 @@ GEM rack (>= 3) webrick (~> 1.8) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) redis (5.2.0) redis-client (>= 0.22.0) - redis-client (0.22.1) + redis-client (0.22.2) connection_pool - regexp_parser (2.9.0) - rexml (3.2.6) + regexp_parser (2.9.2) + rexml (3.3.0) + strscan rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -232,11 +233,11 @@ GEM rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.63.4) + rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -249,17 +250,13 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) rubocop-minitest (0.35.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-performance (1.21.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.24.0) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -269,13 +266,8 @@ GEM rubocop-minitest rubocop-performance rubocop-rails - rubocop-rspec (2.29.2) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - rubocop-rspec_rails (~> 2.28) - rubocop-rspec_rails (2.28.3) - rubocop (~> 1.40) + rubocop-rspec (3.0.1) + rubocop (~> 1.61) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) ruby_ami (2.4.0) @@ -311,13 +303,14 @@ GEM skylight (6.0.4) activesupport (>= 5.2.0) state_machine (1.2.0) + strscan (3.1.0) sucker_punch (3.2.0) concurrent-ruby (~> 1.0) thor (1.3.1) thread_safe (0.3.6) tilt (2.3.0) timers (4.3.5) - twilio-ruby (7.0.2) + twilio-ruby (7.1.1) faraday (>= 0.9, < 3.0) jwt (>= 1.5, < 3.0) nokogiri (>= 1.6, < 2.0) @@ -331,7 +324,7 @@ GEM coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) equalizer (~> 0.0, >= 0.0.9) - webmock (3.23.0) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -342,6 +335,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 arm64-linux x86_64-linux x86_64-linux-musl @@ -379,4 +373,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.5.6 + 2.5.11 diff --git a/components/s3_mpeg/.tool-versions b/components/s3_mpeg/.tool-versions index f2a971aa7..51f617d22 100644 --- a/components/s3_mpeg/.tool-versions +++ b/components/s3_mpeg/.tool-versions @@ -1 +1 @@ -ruby 3.2.2 +ruby 3.3.1 diff --git a/components/s3_mpeg/Dockerfile b/components/s3_mpeg/Dockerfile index 18d1d3e56..4a5912943 100644 --- a/components/s3_mpeg/Dockerfile +++ b/components/s3_mpeg/Dockerfile @@ -1,27 +1,6 @@ -# Adopted from https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-create-from-alt - -# From: https://docs.aws.amazon.com/lambda/latest/dg/images-test.html#images-test-add -# To test an image without adding RIE to the image -# -# mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ -# https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ -# && chmod +x ~/.aws-lambda-rie/aws-lambda-rie -# -# For ARM: -# -# https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 -# -# Run the command -# -# docker run --rm -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ -# --entrypoint /aws-lambda/aws-lambda-rie record_to_mp3:latest \ -# /usr/local/bundle/bin/aws_lambda_ric app.App::Handler.process -# -# curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ARG FUNCTION_DIR="/app" - -FROM ruby:3.2-alpine as build-image +ARG RUBY_VERSION=3.3 +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine AS build-image RUN apk update && \ apk upgrade && \ @@ -48,7 +27,7 @@ COPY app.rb ${FUNCTION_DIR} ############################# -FROM ruby:3.2-alpine +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine ARG FUNCTION_DIR WORKDIR ${FUNCTION_DIR} @@ -62,5 +41,7 @@ RUN apk update && \ gem install bundler && \ gem install aws_lambda_ric +ENV RUBY_YJIT_ENABLE=true + ENTRYPOINT [ "/usr/local/bundle/bin/aws_lambda_ric" ] CMD [ "app.App::Handler.process" ] diff --git a/components/s3_mpeg/Gemfile.lock b/components/s3_mpeg/Gemfile.lock index 878bfd7ad..a949e84dc 100644 --- a/components/s3_mpeg/Gemfile.lock +++ b/components/s3_mpeg/Gemfile.lock @@ -2,17 +2,17 @@ GEM remote: https://rubygems.org/ specs: aws-eventstream (1.3.0) - aws-partitions (1.925.0) - aws-sdk-core (3.194.1) + aws-partitions (1.944.0) + aws-sdk-core (3.197.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.80.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-kms (1.83.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.149.1) - aws-sdk-core (~> 3, >= 3.194.0) + aws-sdk-s3 (1.152.2) + aws-sdk-core (~> 3, >= 3.197.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) @@ -21,7 +21,8 @@ GEM docile (1.4.0) jmespath (1.6.2) ox (2.14.18) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -31,10 +32,10 @@ GEM rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.0) + rspec-support (3.13.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -44,6 +45,7 @@ GEM simplecov (~> 0.19) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + strscan (3.1.0) PLATFORMS ruby @@ -56,4 +58,4 @@ DEPENDENCIES simplecov-cobertura BUNDLED WITH - 2.4.12 + 2.5.11 diff --git a/components/services/.tool-versions b/components/services/.tool-versions index f2a971aa7..51f617d22 100644 --- a/components/services/.tool-versions +++ b/components/services/.tool-versions @@ -1 +1 @@ -ruby 3.2.2 +ruby 3.3.1 diff --git a/components/services/Dockerfile b/components/services/Dockerfile index 1a0bfa48a..8d319b935 100644 --- a/components/services/Dockerfile +++ b/components/services/Dockerfile @@ -1,6 +1,6 @@ ARG FUNCTION_DIR="/function" - -FROM ruby:3.2-alpine as build-image +ARG RUBY_VERSION=3.3 +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine AS build-image RUN apk update && \ apk upgrade && \ @@ -30,7 +30,7 @@ COPY lib/ ${FUNCTION_DIR}/lib/ ############################# -FROM ruby:3.2-alpine +FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine ARG FUNCTION_DIR WORKDIR ${FUNCTION_DIR} @@ -44,5 +44,7 @@ RUN apk update && \ gem install bundler && \ gem install aws_lambda_ric +ENV RUBY_YJIT_ENABLE=true + ENTRYPOINT [ "/usr/local/bundle/bin/aws_lambda_ric" ] CMD [ "app.App::Handler.process" ] diff --git a/components/services/Gemfile.lock b/components/services/Gemfile.lock index 05f20d88a..b176d757d 100644 --- a/components/services/Gemfile.lock +++ b/components/services/Gemfile.lock @@ -2,37 +2,38 @@ GEM remote: https://rubygems.org/ specs: aws-eventstream (1.3.0) - aws-partitions (1.925.0) - aws-sdk-core (3.194.2) + aws-partitions (1.940.0) + aws-sdk-core (3.197.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-ec2 (1.456.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-ec2 (1.460.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) - aws-sdk-ecs (1.146.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-ecs (1.148.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) - aws-sdk-ssm (1.168.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-ssm (1.170.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) - bigdecimal (3.1.7) + bigdecimal (3.1.8) coderay (1.1.3) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) diff-lcs (1.5.1) docile (1.4.0) jmespath (1.6.2) - method_source (1.0.0) + method_source (1.1.0) ox (2.14.18) pg (1.5.6) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) rake (13.2.1) - rexml (3.2.5) + rexml (3.2.8) + strscan (>= 3.0.9) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -42,14 +43,14 @@ GEM rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.0) + rspec-support (3.13.1) sentry-ruby (5.17.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - sequel (5.80.0) + sequel (5.81.0) bigdecimal simplecov (0.22.0) docile (~> 1.1) @@ -60,6 +61,7 @@ GEM simplecov (~> 0.19) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + strscan (3.1.0) PLATFORMS ruby @@ -79,4 +81,4 @@ DEPENDENCIES simplecov-cobertura BUNDLED WITH - 2.4.12 + 2.5.11 diff --git a/components/services/spec/support/aws.rb b/components/services/spec/support/aws.rb deleted file mode 100644 index 261763885..000000000 --- a/components/services/spec/support/aws.rb +++ /dev/null @@ -1,41 +0,0 @@ -Aws.config[:ssm] = { - stub_responses: { - get_parameters: lambda { |context| - { - parameters: context.params[:names].map do |name| - Aws::SSM::Types::Parameter.new( - name:, - value: name.delete_prefix("ssm-parameter-name-") - ) - end - } - } - } -} - -Aws.config[:ecs] = { - stub_responses: { - describe_container_instances: lambda { |_context| - { - container_instances: [ - ec2_instance_id: "ec2-instance-id" - ] - } - } - } -} - -Aws.config[:ec2] = { - stub_responses: { - describe_instances: lambda { |_context| - { - reservations: [ - instances: [ - private_ip_address: "10.0.0.1", - public_ip_address: "54.251.92.249" - ] - ] - } - } - } -} diff --git a/infrastructure/modules/somleng_switch/services.tf b/infrastructure/modules/somleng_switch/services.tf index 80f078c58..911a56438 100644 --- a/infrastructure/modules/somleng_switch/services.tf +++ b/infrastructure/modules/somleng_switch/services.tf @@ -12,7 +12,7 @@ resource "docker_image" "services" { } resource "docker_registry_image" "services" { - name = docker_image.services.name + name = docker_image.services.name keep_remotely = true } @@ -29,7 +29,7 @@ resource "aws_ssm_parameter" "services_application_master_key" { # IAM resource "aws_iam_role" "services" { - name = local.services_function_name + name = local.services_function_name assume_role_policy = <