I can pack build Ruby apps that use a Gemfile using packit
Closed this issue · 8 comments
Context
We should go back and re-implement Bundler CNB functionality using packit.
Acceptance Criteria
GIVEN I have a Ruby app that has a Gemfile
WHEN I pack build
it
THEN I can see that packit style logging appears during detection
AND I can successfully run the app
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/172482468
The labels on this github issue will be updated when the story is started.
Acceptance
- Download latest bundler CNB
wget -O /tmp/bundler.tgz https://github.com/cloudfoundry/bundler-cnb/releases/download/v0.0.88/bundler-cnb-0.0.88.tgz
.............
/tmp/bundler.tgz 100%[=============================>] 4.59M 6.09MB/s in 0.8s
2020-04-23 12:11:20 (6.09 MB/s) - ‘/tmp/bundler.tgz’ saved [4818361/4818361]
- Download latest MRI CNB
wget -O /tmp/mri.tgz https://github.com/cloudfoundry/mri-cnb/releases/download/v0.0.97/ruby-cnb-0.0.97.tgz
- Pack build a bundler app using downloaded Buildpack, Paketo Builder. I used this app - https://github.com/cloudfoundry/bundler-cnb/tree/master/integration/testdata/simple_app.
pack build app-with-gemfile --buildpack /tmp/mri.tgz --buildpack /tmp/bundler.tgz --builder gcr.io/paketo-buildpacks/builder:full-cf --verbose
Pulling image gcr.io/paketo-buildpacks/builder:full-cf
full-cf: Pulling from paketo-buildpacks/builder
Digest: sha256:6ec54c781b8c76b21686565ee792bc79d96720ebc708d32553ff464ffafb310c
Status: Image is up to date for gcr.io/paketo-buildpacks/builder:full-cf
Selected run image gcr.io/paketo-buildpacks/run:full-cnb-cf
Pulling image gcr.io/paketo-buildpacks/run:full-cnb-cf
full-cnb-cf: Pulling from paketo-buildpacks/run
Digest: sha256:c3f90713f0f6b5cdce3fcb3ee3e1e46ec0f7e1209741b5144a0883f17ae51532
Status: Image is up to date for gcr.io/paketo-buildpacks/run:full-cnb-cf
Adding buildpack org.cloudfoundry.ruby-mri version 0.0.97 to builder
Adding buildpack org.cloudfoundry.bundler version 0.0.88 to builder
Setting custom order
Using build cache volume pack-cache-46b260c25dce.build
===> DETECTING
[detector] ======== Output: org.cloudfoundry.bundler@0.0.88 ========
[detector] Implement detect
[detector] []
[detector] unable to resolve ruby version exit status 1
[detector] ======== Results ========
[detector] pass: org.cloudfoundry.ruby-mri@0.0.97
[detector] fail: org.cloudfoundry.bundler@0.0.88
[detector] ERROR: No buildpack groups passed detection.
[detector] ERROR: Please check that you are running against the correct path.
[detector] ERROR: failed to detect: no buildpacks participating
ERROR: failed with status code: 6
Looks like this the Gemfile is pinned to ruby 2.6.0 which is no longer in the MRI CNB because we only support latest 2 versions of a given Major.Minor version line.
We should update all of our bundler fixtures to be buildable apps before delivering this.
@kvedurmu This looks to be another unrelated issue. The latest release was never cut with the rewrite because CI was broken due to the change in names for the build/run and builder images. We need to change this code: https://github.com/cloudfoundry/bundler-cnb/blob/d0d25c9d08f2ba0593e5d6aa0e627c3bea557093/scripts/integration.sh#L43-L59
We'll go ahead and do that and then ping here when Release v0.0.89 comes out with that code.
I'm seeing the following error with the latest release:
pack build simple-app-gemfile --buildpack /tmp/bundler.tgz --buildpack /tmp/mri.tgz --builder gcr.io/paketo-buildpacks/builder:full-cf --verbose
Pulling image gcr.io/paketo-buildpacks/builder:full-cf
full-cf: Pulling from paketo-buildpacks/builder
....................
Digest: sha256:e94eac51d9a95136ed42f55eacb7f9c3ce424152863c57ebc8c8ad046702f225
Status: Downloaded newer image for gcr.io/paketo-buildpacks/builder:full-cf
Selected run image gcr.io/paketo-buildpacks/run:full-cnb-cf
Pulling image gcr.io/paketo-buildpacks/run:full-cnb-cf
full-cnb-cf: Pulling from paketo-buildpacks/run
Digest: sha256:52dc8e2cd9efd1920cd4963d40251bd28f541019aa9beb6ca2f4b48d90e9c695
Status: Image is up to date for gcr.io/paketo-buildpacks/run:full-cnb-cf
Adding buildpack org.cloudfoundry.bundler version 0.0.89 to builder
Adding buildpack org.cloudfoundry.mri version 0.0.98 to builder
Setting custom order
Using build cache volume pack-cache-4839c202e7c1.build
===> DETECTING
[detector] ======== Results ========
[detector] pass: org.cloudfoundry.bundler@0.0.89
[detector] pass: org.cloudfoundry.mri@0.0.98
[detector] Resolving plan... (try #1)
[detector] fail: org.cloudfoundry.bundler@0.0.89 requires ruby
[detector] ERROR: No buildpack groups passed detection.
[detector] ERROR: Please check that you are running against the correct path.
[detector] ERROR: failed to detect: no buildpacks participating
ERROR: failed with status code: 6