Giter Club home page Giter Club logo

ruby's Introduction

Ruby Paketo Buildpack

gcr.io/paketo-buildpacks/ruby

The Ruby Paketo Buildpack provides a set of collaborating buildpacks that enable the building of a Ruby-based application. These buildpacks include:

The buildpack supports building simple Ruby applications or applications which utilize Bundler for managing their dependencies. Usage examples can be found in the samples repository under the ruby directory.

The Ruby buildpack is compatible with the following builder(s):

ruby's People

Contributors

andymoe avatar arjun024 avatar dependabot[bot] avatar dwillist avatar foresteckhardt avatar kvedurmu avatar paketo-bot avatar robdimsdale avatar ryanmoran avatar sophiewigmore avatar thitch97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ruby's Issues

Proposal: Write a CNB implementation for each ruby framework start command.

Motivation

There are a few different popular ruby web frameworks, including rails and sinatra, and many different popular web servers. We need to make it possible for app authors to use whatever framework/server combination they want to run their ruby app, and an easy, extensible way for CNB authors to allow app authors to run their app with best practices.

The v2 Ruby Buildpack hard coded logic to start rails and sinatra apps with our without the thin server implementation. If developers wanted to use a different web framework, or a different framework/server combination, they would need to change the logic of the Buildpack itself.

Proposal

Each framework in the v3 world will implement its own CNB, in which detect will return true if the framework exists in the app's Gemfile, and build will run the app using some combination of the framework and a server also found in the app's Gemfile, app authors can define this relationship in the buildpack.yml.

The Buildpack team can start by implementing a few popular frameworks, like rails and sinatra with the thin server implementation in order to keep feature parity with what the current Ruby Buildpack provides.

Release Paketo Ruby buildpack

Release in the week of May 17th if relevant changes or dependency updates are merged.

What steps did you take to close this issue? What resources did you use? How long did you spend on this task this week? Answer in a comment.

Migrate docs into a Hugo module

In order to locate Paketo documentation closer to the code it documents, we can migrate the docs for this language family from where they currently live in the paketo website repo into a Hugo module that sits inside this repository.

For an example of this, see the Hugo module that sits inside the Paketo Dotnet Core language family repo.

To do this successfully, we need

  • A workflow that automatically tags a release of the docs module when a release is cut on this language family repo. This has been handled in a PR to the centralized Paketo github-config repository
  • A Hugo module inside this language family repo (This module needs to have the name github.com/paketo-buildpacks/<name of this repo>/docs in order for the existing automation to work properly.) It should have the same structure as the Hugo module inside the dotnet-core repo.
  • An additional entry in the go.mod of the paketo-website repo for this repo's docs module
  • An additional [[module.imports.mounts]]in the paketo-website repo's hugo config.toml that mounts the content in this repo's docs module into the proper path in the site's directory structure. That path should match the path to the existing docs file in that repo (Hint: The docs file is probably in here).

Set RAILS_LOG_TO_STDOUT to true/1

What happened?

  • What were you attempting to do?

Build a rails app that sends logs to stdout

  • What did you expect to happen?

I expected RAILS_LOG_TO_STDOUT to be enabled so that our environment config could pick it up and use it to set the appropriate logger to direct logs to stdout for the container

  • What was the actual behavior? Please provide log output, if possible.

It is not enabled, the logs were directed to a file

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.

  • What buildpacks are you using? Please include versions.

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

New release to support Ruby 3.1.0

I can't build Ruby 3.1 apps since version 0.10 of this buildpack still refers to mri buildpack 0.5.1. Version 0.6 of the mri buildpack has Ruby 3.1 support. This is already correctly referred to in the main branch, it's just missing a new release.

Ruby Paketo Buildpacks should support apps that use Rack

Background
Rack is a pretty popular Ruby web server for local rails development (using rails s to start a server locally), and it would be great if Paketo Buildpacks could support building apps that use Rack. I'm throwing this feature request into the MRI CNB repo as we don't have a language family Ruby repo just yet.

Notes:

Can we support jruby applications in the Ruby Paketo Buildpack?

On top of MRI, jruby is a fairly popular ruby runtime that we've supported in the Ruby CF Buildpack. It would be great if we could support jruby in the Ruby buildpack.

We should also think about how we can support other runtimes such as Rubinius in the future.

Language Family Ruby Buildpack should include Procfile

We should add the Procfile Paketo Buildpack to the Ruby Language family buildpack so that users can define start commands via a Procfile (see paketo-buildpacks/rfcs#7) for existing web servers.

Ordering will look something like

[[order]]
  [[order.group]]
    id = "paketo-community/mri"
    version = "0.0.128"
  [[order.group]]
    id = "paketo-community/bundler"
    version = "0.0.114"
  [[order.group]]
    id = "paketo-community/bundle-install"
    version = "0.0.18"
  [[order.group]]
    id = "paketo-community/puma"
    version = "0.0.10"
  [[order.group]]
    id = "paketo-buildpacks/procfile"
    version = "0.0.1"
[[order]]
   .......... 
   [[order.group]]
    id = "paketo-community/thin"
    version = "0.0.10"
  [[order.group]]
    id = "paketo-buildpacks/procfile"
    version = "0.0.1"
[[order]]
   .......... 
   [[order.group]]
    id = "paketo-community/unicorn"
    version = "0.0.10"
  [[order.group]]
    id = "paketo-buildpacks/procfile"
    version = "0.0.1"
................

This way, users can override the default start command set for each ruby web server.

Failure to detect Ruby app from the Buildpacks sample directory

What happened?

I tried to build a ruby app with the base (paketobuildpacks/builder:base) and full (paketobuildpacks/builder:full) builder but they couldn't detect the app, and thus nothing was built. I'm using the sample app in the buildpacks sample repo. However, when I switch to Heroku buildpacks or the CNB ones, it was able to detect and build the app.

  • What were you attempting to do?

Build a Ruby app

  • What did you expect to happen?

Detect the app and package it.

  • What was the actual behavior? Please provide log output, if possible.
===> DETECTING
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.

Tekton

  • What buildpacks are you using? Please include versions.

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?

paketobuildpacks/builder:base and paketobuildpacks/builder:full

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?

https://github.com/buildpacks/samples/tree/main/apps/ruby-bundler

Support Ruby apps that require NodeJS to run

I have a ruby application that requires nodejs to run. When I provide both buildpacks, they appear to apply correctly, but then the application fails to run. It appears that nodejs isn't actually in the image.

This is the build command:

pack build app --buildpack gcr.io/paketo-buildpacks/ruby --buildpack gcr.io/paketo-buildpacks/node-engine

(Note: I also tried switching the order of the buildpacks and had the same issue.)

This is the error when running the image:

/layers/paketo-buildpacks_bundle-install/gems/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
	from /layers/paketo-buildpacks_bundle-install/gems/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `require'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
	from /layers/paketo-buildpacks_bundler/bundler/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
	from /workspace/config/application.rb:24:in `<top (required)>'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:141:in `block in perform'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:138:in `tap'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:138:in `perform'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/command/base.rb:69:in `perform'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/command.rb:46:in `invoke'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/railties-6.0.3.1/lib/rails/commands.rb:18:in `<top (required)>'
	from /workspace/bin/rails:11:in `require'
	from /workspace/bin/rails:11:in `<top (required)>'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
	from /layers/paketo-buildpacks_bundle-install/gems/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
	from /workspace/bin/spring:16:in `require'
	from /workspace/bin/spring:16:in `<top (required)>'
	from bin/rails:5:in `load'
	from bin/rails:5:in `<main>'

With some guidance from @ryanmoran, I was able to build an image that works with this command:

pack build app --buildpack gcr.io/paketo-buildpacks/ruby --buildpack gcr.io/paketo-buildpacks/node-engine --buildpack https://github.com/paketo-community/build-plan/releases/download/v0.0.8/build-plan-v0.0.8.tgz

And a plan.toml that contains:

[[requires]]
  name = "node"
  version = "~10"
[requires.metadata]
  launch = true

Implement RFC0052: Graceful Stack Upgrades

RFC

Summary

All Paketo Buildpacks should support graceful stack upgrades between the current Bionic and Jammy stacks. For most buildpacks, this should not require any changes, but for some buildpacks, layers created in previous builds that would normally be reused should be recreated if the stack ID changes.

Action Item

Consider what types of buildpacks would be impacted by a stack upgrade and make any relevant changes that would help to mitigate issues caused by that upgrade. If there is no work to be done, please comment on this issue explaining the context that helped to arrive at that conclusion.

Build fails with "max depth exceeded"

Expected Behavior

Build succeeds like it have been up until recently

Current Behavior

Since some days the build fails during image layer download with this message:

Building Cloud Native Buildpack-based application with builder paketobuildpacks/builder:full...
full: Pulling from paketobuildpacks/builder
415e3fde5bca: Pulling fs layer
d08d3c1e32f0: Pulling fs layer
15de52ae9c9d: Pulling fs layer
<snip>
607425cbcd39: Pull complete
7d9dccdc2e67: Verifying Checksum
7d9dccdc2e67: Download complete
88b7955b77ba: Pull complete
7d9dccdc2e67: Pull complete
Digest: sha256:077d819956695e51719c020e3063014f5e564044e699913f87b72d898421f818
Status: Downloaded newer image for paketobuildpacks/ruby@sha256:077d819956695e51719c020e3063014f5e564044e699913f87b72d898421f818
ERROR: failed to build: failed to write image to the following tags: [pack.local/builder/6e777974666c72687072:latest: loading image "pack.local/builder/6e777974666c72687072:latest". first error: embedded daemon response: max depth exceeded]

We've added only one additional buildpack: fagiani/apt.

Possible Solution

I am not sure. Maybe it's related to spring-projects/spring-boot#31233

Steps to Reproduce

Just try to build a RoR project.

Add top level [[buildpack.licenses]] field

What happened?

We should add the top level [[buildpack.licenses]] field to buildpack.toml (and all implementation buildpacks) so users can see the buildpack's license through an app image's bill of materials.

Upgrade to packit v2

Please upgrade to the latest packit v2 release to enable new features and extended support.

Should gem projects be supported here?

What happened?

What were you attempting to do?

Build an image for a project that is also published as a gem for internal use. TLDR it is a gem that is used by client apps for "kafka interactions" which also bundles some reusable tasks that we run across all of our staging clusters through a Docker image built with CNB buildpacks.

Yes we could write a Dockerfile instead but it'd be amazing if we could just leverage the same CNB infra we have for other ruby / rails projects we maintain.

What did you expect to happen?

Build should succeed, but we hit a few snags. Also, FWIW I have no idea if other builders like heroku's support this use case, so totally fine if you folks feel like this is not something you wanna move forward with

What was the actual behavior? Please provide log output, if possible.

Some of the "snags" mentioned above include:

  • Detect the bundler version to install based on what is present on the .gemspec: fixed by setting BP_BUNDLER_VERSION
  • Dependency on git command on gemspec

Build Configuration

What platform (pack, kpack, tekton buildpacks plugin, etc.) are you using? Please include a version.

We got our own way of building things, including a base image that builds on top of paketo stacks (only using the full one for real ATM). It relies on the execution of individual steps with lifecycle CLI as we kinda reimplement the lifecycle creator with some additional logic that makes sense to us (ex: a custom cache fallback mechanism we use).

The builder is being created by pack v0.24.0, so it uses whatever lifecycle release it injects under the hood.

What buildpacks are you using? Please include versions.

Click to see
Inspecting builder: <REDACTED>-builder:full-v0.5.0

REMOTE:

Description: Ubuntu bionic base image with buildpacks for Golang, Ruby and Nodejs

Created By:
  Name: Pack CLI
  Version: 0.24.0+git-79a40b7.build-3148

Trusted: No

Stack:
  ID: io.buildpacks.stacks.bionic

Lifecycle:
  Version: 0.13.3
  Buildpack APIs:
    Deprecated: (none)
    Supported: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7
  Platform APIs:
    Deprecated: (none)
    Supported: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8

Run Images:
  <REDACTED>-stack-run:bionic-full-f73c656-b638

Buildpacks:
  ID                                             NAME                                                            VERSION        HOMEPAGE
  paketo-buildpacks/bundle-install               Paketo Bundle Install Buildpack                                 0.3.1          https://github.com/paketo-buildpacks/bundle-install
  paketo-buildpacks/bundler                      Paketo Bundler Buildpack                                        0.3.1          https://github.com/paketo-buildpacks/bundler
  paketo-buildpacks/ca-certificates              Paketo CA Certificates Buildpack                                3.0.2          https://github.com/paketo-buildpacks/ca-certificates
  paketo-buildpacks/ca-certificates              Paketo CA Certificates Buildpack                                3.1.0          https://github.com/paketo-buildpacks/ca-certificates
  paketo-buildpacks/dep                          Paketo Dep Buildpack                                            0.3.0          https://github.com/paketo-buildpacks/dep
  paketo-buildpacks/dep-ensure                   Paketo Dep Ensure Buildpack                                     0.2.1          https://github.com/paketo-buildpacks/dep-ensure
  paketo-buildpacks/environment-variables        Paketo Environment Variables Buildpack                          4.0.2          https://github.com/paketo-buildpacks/environment-variables
  paketo-buildpacks/environment-variables        Paketo Environment Variables Buildpack                          4.1.0          https://github.com/paketo-buildpacks/environment-variables
  paketo-buildpacks/git                          Paketo Git Buildpack                                            0.4.1          https://github.com/paketo-buildpacks/git
  paketo-buildpacks/go                           Paketo Go Buildpack                                             1.0.0          https://github.com/paketo-buildpacks/go
  paketo-buildpacks/go-build                     Paketo Go Build Buildpack                                       1.0.2          https://github.com/paketo-buildpacks/go-build
  paketo-buildpacks/go-dist                      Paketo Go Distribution Buildpack                                1.0.1          https://github.com/paketo-buildpacks/go-dist
  paketo-buildpacks/go-mod-vendor                Paketo Go Mod Vendor Buildpack                                  0.5.0          https://github.com/paketo-buildpacks/go-mod-vendor
  paketo-buildpacks/image-labels                 Paketo Image Labels Buildpack                                   4.0.2          https://github.com/paketo-buildpacks/image-labels
  paketo-buildpacks/image-labels                 Paketo Image Labels Buildpack                                   4.1.0          https://github.com/paketo-buildpacks/image-labels
  paketo-buildpacks/mri                          Paketo MRI Buildpack                                            0.6.0          https://github.com/paketo-buildpacks/mri
  paketo-buildpacks/node-engine                  Paketo Node Engine Buildpack                                    0.11.4         https://github.com/paketo-buildpacks/node-engine
  paketo-buildpacks/node-engine                  Paketo Node Engine Buildpack                                    0.12.1         https://github.com/paketo-buildpacks/node-engine
  paketo-buildpacks/node-module-bom              Paketo Node Module Bill of Materials Generator Buildpack        0.2.3          https://github.com/paketo-buildpacks/node-module-bom
  paketo-buildpacks/node-run-script              Paketo Node Run Script Buildpack                                0.3.2          https://github.com/paketo-buildpacks/node-run-script
  paketo-buildpacks/node-start                   Paketo Node Start Buildpack                                     0.7.1          https://github.com/paketo-buildpacks/node-start
  paketo-buildpacks/nodejs                       Paketo Node.js Buildpack                                        0.16.0         https://github.com/paketo-buildpacks/nodejs
  paketo-buildpacks/npm-install                  Paketo NPM Install Buildpack                                    0.8.0          https://github.com/paketo-buildpacks/npm-install
  paketo-buildpacks/npm-start                    Paketo NPM Start Buildpack                                      0.8.0          https://github.com/paketo-buildpacks/npm-start
  paketo-buildpacks/passenger                    Paketo Passenger Buildpack                                      0.3.1          https://github.com/paketo-buildpacks/passenger
  paketo-buildpacks/procfile                     Paketo Procfile Buildpack                                       5.0.2          https://github.com/paketo-buildpacks/procfile
  paketo-buildpacks/procfile                     Paketo Procfile Buildpack                                       5.1.0          https://github.com/paketo-buildpacks/procfile
  paketo-buildpacks/puma                         Paketo Puma Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/puma
  paketo-buildpacks/rackup                       Paketo Rackup Buildpack                                         0.2.1          https://github.com/paketo-buildpacks/rackup
  paketo-buildpacks/rails-assets                 Paketo Rails Assets Buildpack                                   0.4.1          https://github.com/paketo-buildpacks/rails-assets
  paketo-buildpacks/rake                         Paketo Rake Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/rake
  paketo-buildpacks/ruby                         Paketo Ruby Buildpack                                           0.11.0         https://github.com/paketo-buildpacks/ruby
  paketo-buildpacks/thin                         Paketo Thin Buildpack                                           0.2.1          https://github.com/paketo-buildpacks/thin
  paketo-buildpacks/unicorn                      Paketo Unicorn Buildpack                                        0.2.1          https://github.com/paketo-buildpacks/unicorn
  paketo-buildpacks/watchexec                    Paketo Watchexec Buildpack                                      2.3.0          https://github.com/paketo-buildpacks/watchexec
  paketo-buildpacks/yarn                         Paketo Yarn Buildpack                                           0.5.1          https://github.com/paketo-buildpacks/yarn
  paketo-buildpacks/yarn                         Paketo Yarn Buildpack                                           0.6.0          https://github.com/paketo-buildpacks/yarn
  paketo-buildpacks/yarn-install                 Paketo Yarn Install Buildpack                                   0.7.1          https://github.com/paketo-buildpacks/yarn-install
  paketo-buildpacks/yarn-install                 Paketo Yarn Install Buildpack                                   0.8.0          https://github.com/paketo-buildpacks/yarn-install
  paketo-buildpacks/yarn-start                   Paketo Yarn Start Buildpack                                     0.7.1          https://github.com/paketo-buildpacks/yarn-start

Detection Order:
 ├ Group #1:
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #1:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #2:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #3:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #4:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/ruby
 │  │  └ Group #5:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]                     (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]             (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  └ paketo-buildpacks/ruby
 │     └ Group #6:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                  (optional)
 │        ├ paketo-buildpacks/[email protected]           (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 ├ Group #2:
 │  ├ paketo-buildpacks/nodejs
 │  │  └ Group #1:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]                (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  ├ paketo-buildpacks/nodejs
 │  │  └ Group #2:
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]                (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]          (optional)
 │  │     ├ paketo-buildpacks/[email protected]
 │  │     ├ paketo-buildpacks/[email protected]                 (optional)
 │  │     ├ paketo-buildpacks/[email protected]    (optional)
 │  │     └ paketo-buildpacks/[email protected]             (optional)
 │  └ paketo-buildpacks/nodejs
 │     └ Group #3:
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]                (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]          (optional)
 │        ├ paketo-buildpacks/[email protected]
 │        ├ paketo-buildpacks/[email protected]                 (optional)
 │        ├ paketo-buildpacks/[email protected]    (optional)
 │        └ paketo-buildpacks/[email protected]             (optional)
 └ Group #3:
    ├ paketo-buildpacks/go
    │  └ Group #1:
    │     ├ paketo-buildpacks/[email protected]          (optional)
    │     ├ paketo-buildpacks/[email protected]                (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                      (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                 (optional)
    │     ├ paketo-buildpacks/[email protected]    (optional)
    │     └ paketo-buildpacks/[email protected]             (optional)
    ├ paketo-buildpacks/go
    │  └ Group #2:
    │     ├ paketo-buildpacks/[email protected]          (optional)
    │     ├ paketo-buildpacks/[email protected]                (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                      (optional)
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]
    │     ├ paketo-buildpacks/[email protected]                 (optional)
    │     ├ paketo-buildpacks/[email protected]    (optional)
    │     └ paketo-buildpacks/[email protected]             (optional)
    └ paketo-buildpacks/go
       └ Group #3:
          ├ paketo-buildpacks/[email protected]          (optional)
          ├ paketo-buildpacks/[email protected]                (optional)
          ├ paketo-buildpacks/[email protected]                      (optional)
          ├ paketo-buildpacks/[email protected]
          ├ paketo-buildpacks/[email protected]
          ├ paketo-buildpacks/[email protected]                 (optional)
          ├ paketo-buildpacks/[email protected]    (optional)
          └ paketo-buildpacks/[email protected]             (optional)

LOCAL:
(not present)

Can you provide a sample app or relevant configuration (buildpack.yml, nginx.conf, etc.)?

Sure, please see note below, happy to provide more info if you really want to pursue this

Checklist

Note yet, see note below

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

NOTE: Guidance needed

I'm happy to provide additional information like logs and test cases for you folks to see what we're experiencing but at this stage I'm mostly interested in knowing whether providing better support for apps that have .gemspecs is something you are interested in pursuing or not 😄

I'd also wonder in which repo I should open the issue, like here, or one of the ruby's "sub-buildpacks"

Implement Paketo RFC 0038: CycloneDX + Syft SBOM

To implement Paketo RFC0038, this buildpack (and the implementation buildpacks inside) will need to move from storing SBOM information in layer metadata to storing it in files that the CNB lifecycle can manipulate during the build. The RFC outlines what these files are and what they should contain.

This issue serves as a meta-issue for work required to complete this work for the Ruby language family. This will require (link Github issues as they are created):

Upgrade to buildpack API v0.5

The Ruby buildpack currently uses CNB Buildpacks API v0.2. The CNB spec has evolved since then. To take advantage of more upstream features, the buildpack should be upgraded to API v0.5.

Since the buildpack is composed of many implementation buildpacks, the implementation buildpacks should also be updated to v0.5. Here is the list of related issues to bump the version in each of the Ruby-specific implementation buildpacks:
paketo-buildpacks/bundler#193
paketo-buildpacks/mri#210
paketo-buildpacks/passenger#98
paketo-buildpacks/puma#158
paketo-buildpacks/rackup#152
paketo-buildpacks/rake#100
paketo-buildpacks/rails-assets#59
paketo-buildpacks/thin#144
paketo-buildpacks/unicorn#145

Support Jammy Jellyfish

Describe the Enhancement

Ultimately, we want to be able to build Ruby apps on top of the Paketo Jammy stacks. Currently, builds fail because buildpacks like mri don't have the Jammy stack listed in their supported stacks.

Possible Solution

  • Update buildpack.toml and dependencies to add io.buildpacks.stacks.jammy as a compatible stack
  • paketo-buildpacks/node-engine#487
  • (If necessary) Recompile installed dependencies to work on Jammy
  • Add some integration tests that test the buildpack against Jammy

Motivation

Part of paketo-buildpacks/builder-jammy-base#1

Add support for openjdk when rjb gem is present

What happened?

Building a rails app w/rjb fails:

  • What were you attempting to do?
    Build a rails app
  • What did you expect to happen?
    Build successfully
  • What was the actual behavior? Please provide log output, if possible.
    Build failed:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/layers/paketo-buildpacks_bundle-install/build-gems/ruby/2.6.0/gems/rjb-1.6.2/ext
/layers/paketo-buildpacks_mri/mri/bin/ruby -I
/layers/paketo-buildpacks_mri/mri/lib/ruby/2.6.0 -r
./siteconf20210609-134-18g0s92.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/layers/paketo-buildpacks_mri/mri/bin/$(RUBY_BASE_NAME)
extconf.rb:54:in `<main>': JAVA_HOME is not set. (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in
/layers/paketo-buildpacks_bundle-install/build-gems/ruby/2.6.0/gems/rjb-1.6.2
for inspection.
Results logged to
/layers/paketo-buildpacks_bundle-install/build-gems/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/rjb-1.6.2/gem_make.out

An error occurred while installing rjb (1.6.2), and Bundler cannot continue.
Make sure that `gem install rjb -v '1.6.2' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  fillable-pdf was resolved to 0.9.1, which depends on
    rjb

error: exit status 5
ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 145

Build Configuration

  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
    pack 0.19

  • What buildpacks are you using? Please include versions.
    gcr.io/paketo-buildpacks/ruby

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?
    paketobuildpacks/builder:full

  • Can you provide a sample app or relevant configuration (buildpack.yml,
    nginx.conf, etc.)?
    Repo is private

  • Steps to reproduce
    Add rjb to Gemfile and run:

pack build gcr.io/bdt-eng-play/prism-buildpack --buildpack gcr.io/paketo-buildpacks/ruby \
  --builder paketobuildpacks/builder:full

Note: It appears a buildpack for openjdk is already available https://github.com/paketo-buildpacks/adopt-openjdk

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.

Image created 292 years ago

$ docker images | grep gcr.io/paketo-community/ruby
gcr.io/paketo-community/ruby                                                       latest              96066dc1a063        292 years ago       42.8MB

$ docker inspect gcr.io/paketo-community/ruby:latest
...
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

Could we set a

Language Family Ruby Paketo Buildpack

We should have a language family Ruby Paketo Buildpack that includes all Ruby Implementation CNBs.

This meta buildpack should have the ID "paketo-community/ruby"

Add node-engine to Ruby language family ordering?

Asset pipeline is fairly common in most rails apps that serve JS/CSS, and to build a rails app using it at the moment, I'd need to build it with node-engine.

Does it seem reasonable to add node-engine into the language family ordering so that users can build rails apps easier?

Support for bundler binstubs

Slack thread

Describe the Enhancement

Allow us to save a few keystrokes and stop typing in bundle exec on interactive shell sessions.

Possible Solution

Introduce a new bundler-binstubs buildpack that contributes binstubs for all gems installed and pushes them to app's $PATHs. We could start by only pushing them to launch layers unless ppl feel there's a need for them at build time as well.

Motivation

Less typing is always better 😄

Assert that builds are reproducible

Describe the Enhancement

Builds with this buildpack should be reproducible, meaning given identical inputs, the SHAs of resulting buildpack-built images are the same. This means, for a given app, if I run:

pack build my-app -b paketo-buildpacks/ruby

and then run

pack build my-app-copy -b paketo-buildpacks/ruby

with the same source code and configurations, the resulting image SHAs should be the same.

Currently, builds are not reproducible because of SBOMs included in the final app image. See paketo-buildpacks/packit#367 and paketo-buildpacks/packit#368. But once those issues are resolved and a new version of packit has been released, we should expect that the buildpack builds are reproducible.

Possible Solution

Add assertions to integration tests that show that two builds with the same inputs produce identical outputs.

Motivation

Build reproducibility is a selling point of CNBs that we want to provide to Paketo buildpack users. We want to know if future implementation decisions compromise build reproducibility.

Ruby Paketo Buildpack should support Passenger apps

Background
Passenger is a pretty popular Ruby web server, and it would be great if Paketo Buildpacks could support building apps that use Passenger. I'm throwing this feature request into the MRI CNB repo as we don't have a language family Ruby repo just yet.

Notes:

Once this feature is complete, the Language Family Ruby buildpack ordering should look something like:

[[order]]
.........
  [[order.group]]
    id = "paketo-community/mri"
    version = "0.0.149"

  [[order.group]]
    id = "paketo-community/bundler"
    version = "0.0.137"

  [[order.group]]
    id = "paketo-community/bundle-install"
    version = "0.0.42"

  [[order.group]]
    id = "paketo-community/passenger"
    version = "VERSION"

  [[order.group]]
    id = "paketo-buildpacks/procfile"
    version = "1.3.10"
    optional = true
.................

Upgrade to buildpack API > 0.6

The upstream Cloud Native Buildpacks project has a proposal to deprecate Buildpack APIs <= 0.6. This buildpack's API version will need to be upgraded so it remains supported by the lifecycle.

Promotion of Ruby Buildpack as an official Paketo Buildpack

Now that the Ruby Promotion RFC has been accepted, filing this issue to track the repo/artifact promotion into official Paketo Buildpacks org.

The following changes need to be made for all of the repos listed below:

  1. Repo moved from paketo-community to paketo-buildpacks
  2. Buildpack ID is updated to paketo-buildpacks/<RUNTIME>
  3. Buildpackage artifacts are published to gcr.io/paketo-buildpacks/<RUNTIME>
  4. All Ruby repos have a homepage field (https://github.com/paketo-buildpacks/<RUNTIME>
  5. All Ruby buildpacks follow the Paketo Buildpacks Naming Convention "Paketo Buildpack"

These changes need to be made for all of the following repos:

Whether to use yarn cli when running a Ruby app image?

Hey there 👋

I have a ruby app that I built with pack & this buildpack. It has a package.json with the following script:

"start": "yarn run server",

When I try to run this image, it fails with:

bash: yarn: command not found

Since yarn isn't installed in the image, should we be using something else to start the app?

Investigate setting `MALLOC_ARENA_MAX=2` in the buildpacks

Per @fgrehm in Paketo Slack: https://paketobuildpacks.slack.com/archives/CURGNPSTE/p1660655481999109, we should investigate adding MALLOC_ARENA_MAX=2 as a setting in the buildpacks.

❓ Hello folks! Would you be open to automagically setting MALLOC_ARENA_MAX=2 from one of the ruby buildpacks? looks like we already do that for other buildpacks

we've recently noticed that some of our apps were consuming insanely amounts of memory and came across these articles:
https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
https://www.speedshop.co/2017/12/04/malloc-doubles-ruby-memory.html
we've also found out that heroku sets that as the default for new ruby apps, so I think it makes sense to have similar behavior for paketo buildpacks. attached you'll find some real world metrics, that second blue dotted line is when we set the env var for one of our apps in our internal platform

v0.0.10 - manifest.json had unexpected number of entries: 2

$ pack build drnic/depot --buildpack gcr.io/paketo-community/ruby:0.0.10
...
ERROR: opening buildpack blob: extracting buildpack paketo-community/[email protected] layer (diffID sha256:f3c3cee5dd2ce700b3d1fbf4d517533a87c652d7c83f33c37cdc68aefcae9032): manifest.json had unexpected number of entries: 2

I was testing the buildpack against a rails/puma app. I do not get this error with v0.0.9.

move to package.toml with images

The new/proper/standard way for meta buildpacks is to have a package.toml pre-baked in this repo looking like:

dependencies = [
  { image = "gcr.io/paketo-community/mri:0.0.121" },
  { image = "gcr.io/paketo-community/bundler:0.0.107" },
  { image = "gcr.io/paketo-community/bundle-install:0.0.11" },
  { image = "gcr.io/paketo-community/puma:0.0.3" },
]

[buildpack]
  uri = "."

To do this we need images uploaded to GCR for each buildpack. Currently they are missing https://console.cloud.google.com/gcr/images/paketo-community/GLOBAL/mri?gcrImageListsize=30

Relates to paketo-buildpacks/mri#54

This change will then make it easier to integrate other buildpacks like procfile as discussed in paketo-buildpacks/procfile#3 (comment)

Ruby buildpack for paketo looks like doesn't work

I use this builder image gcr.io/paketo-buildpacks/builder:latest to build my ruby source code. But at detect step, it can't get the related buildpack:

{"level":"info","ts":1591328779.063402,"caller":"git/git.go:133","msg":"Successfully initialized and updated submodules in path /workspace/source"}
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
2020/06/05 03:46:20 Skipping step because a previous step failed
2020/06/05 03:46:21 Skipping step because a previous step failed
2020/06/05 03:46:21 Skipping step because a previous step failed
2020/06/05 03:46:22 Skipping step because a previous step failed

BTW, before yesterday, it works fine. From yesterday, it alway failed because above error.

So may I get some opinions from you guys, pls? Thanks a lot!

Non web-server use cases

As of RFC-0001 we are going to support building application that use web servers. There is an open question about what other kinds of ruby applications this buildpack should support. We should investigate/gather feedback about use cases in the following cases:

  • Ruby is just used as a build tool.
  • Ruby is needed at launch time but not because of a web server

If you have experience using ruby in one of the above cases your feedback/input would be greatly appreciated.

Feature Request: Autoconfig for ActionCable Redis adaptor

If you were attempting to accomplish a task, what was it you were attempting to do?

I wanted to push my Rails 6 app, with ActionCable, where ActionCable is configured with the :redis adaptor. This is the default for production rails 6 ActionCable apps

The config in 'config/cable.yml':

development:
  adapter: async
test:
  adapter: test
production:
  adapter: redis
  url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
  channel_prefix: my_app_production

What did you expect to happen?

I expected the buildpack to look for the first VCAP_SERVICES entry tagged as "redis" and use it's credentials to rewrite config/cable.

I only expect this if config/cable.yml matches production: { adapter: redis}

What was the actual behavior?

config/cable.yml was untouched, and I needed to add my own VCAP_SERVICES parser to the app so as to keep my app deployments simple.

Can you provide a sample app?

I could if pressed.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

How to run "rails assets:precompile" during build?

Amongst other things, the old ruby-buildpack would run run rake assets:precompile to build a Rails app's assets.

How can I get a command like this to run amidst the building of my Rails app?

Currently I'm running:

$ cat plan.toml
[[requires]]
  name = "node"
  version = "~12"
[requires.metadata]
  launch = true

$ pack build myapp --buildpack gcr.io/paketo-buildpacks/ruby --buildpack gcr.io/paketo-buildpacks/node-engine --buildpack https://github.com/paketo-community/build-plan/releases/download/v0.0.8/build-plan-v0.0.8.tgz --builder paketobuildpacks/builder:full

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.