Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.2 Support #654

Merged
merged 1 commit into from
May 27, 2023
Merged

Ruby 3.2 Support #654

merged 1 commit into from
May 27, 2023

Conversation

tongueroo
Copy link
Collaborator

@tongueroo tongueroo commented May 27, 2023

This is a πŸ™‹β€β™‚οΈ feature or enhancement.
This is a 🧐 documentation change.

  • I've added tests (if it's a bug, feature or enhancement)
  • I've adjusted the documentation (if it's a feature or enhancement)
  • The test suite passes (run bundle exec rspec to verify this)

Summary

Add Ruby 3.2 Support to Jets

  • Allow custom runtimes to work.
  • Note: Seems like only provided.al2 works with custom ruby runtimes.
  • The provided.al2 has the mimimal required packages.
  • Improve supported Ruby version check.
  • Check at boot time instead of gem install time.
  • Remove required_ruby_version upper bound in gemspec.
  • Yamler wrapper class to work for both Ruby 2 and 3
  • ERB trim_mode option to remove deprecation warning
  • File.exists? alias so libraries that haven't upgraded to Ruby 3 work.

Context

How to Test

To test Ruby 3.2 support before AWS officially releases the Ruby 3.2 runtime, you can use a custom runtime.

config/application.rb

Jets.application.configure do
  # ...
  config.function.runtime = "provided.al2"
  config.lambda.layers = [
    "arn:aws:lambda:us-west-2:536766270177:layer:ruby_3-2:1",
  ]
end

On your machine, switch ruby 3.2. Example:

cd demo
rbenv local 3.2.2
jets deploy

Docs: https://rubyonjets.com/docs/extras/custom-runtime/

Version Changes

Major

Upgrading

If you're upgrading from Jets v3 to v4, take a look at the Jets Upgrading Guide. A blue-green deploy is probably required.

What Happens When AWS Releases Ruby 3.2

When AWS releases the official Ruby 3.2 runtime, Jets v4 should support it as-is. You just have to remove the Custom Runtime layer config.lambda.layers configuration in config/application.rb and jets deploy again. That'll swap out the Custom Runtime with the Official Runtime. That's how it's supposed to work πŸ˜„

Related

Blog Post: Jets v4 Release: Ruby 3.2 Support

* Allow custom runtimes to work.
* Note: Seems like only `provided.al2` works with custom ruby runtimes.
* The `provided.al2` has the minimal required packages.
* Improve supported Ruby version check.
* Check at boot time instead of gem install time.
* Remove required_ruby_version upper bound in gemspec.
* Yamler wrapper class to work for both Ruby 2 and 3
* ERB trim_mode option to remove deprecation warning
* File.exists? alias so libraries that haven't upgraded to Ruby 3 work.
@tongueroo tongueroo merged commit 5408e4e into master May 27, 2023
@tongueroo tongueroo deleted the ruby-3.2 branch May 27, 2023 22:52
@tongueroo
Copy link
Collaborator Author

Released in jets 4.0.0

@tongueroo tongueroo mentioned this pull request May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruby 3.x support
1 participant