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

Builds fail with example builder images unless experimental image extension enabled #170

Open
edmorley opened this issue Sep 7, 2023 · 11 comments
Assignees

Comments

@edmorley
Copy link

edmorley commented Sep 7, 2023

If I try a Pack build using Pack CLI 0.30.0 and pack build --builder cnbs/sample-builder:alpine ..., I currently get the following error:

$ pack build example-basics --builder cnbs/sample-builder:alpine --trust-builder --buildpack packaged/x86_64-unknown-linux-musl/debug/libcnb-examples_basics --path examples/
alpine: Pulling from cnbs/sample-builder
...
Status: Downloaded newer image for cnbs/sample-stack-run:alpine
ERROR: failed to build: experimental features must be enabled when builder contains image extensions

eg:
https://github.com/heroku/libcnb.rs/actions/runs/6113111959/job/16591949217?pr=668#step:10:119

I was wondering whether it might be best to move the experimental extension support to a different Docker image tag until Pack CLI can support it out of the box (without needing to enable non-default features).

(Originally discussed at: https://cloud-native.slack.com/archives/C033DV8D9FB/p1694119138551089)

@edmorley
Copy link
Author

What are the next steps for this? As far as I can tell, any end-users trying out the samples in this repo will have had a broken build for the alpine example since July. Whilst the alpine example probably isn't the first example people will try, it might still put some people off the project if the official examples don't work.

@AidanDelaney
Copy link
Member

@edmorley We should now have experimental feature support in the latest pack, see https://buildpacks.io/docs/tools/pack/cli/pack_config_experimental/. I can build samples with our alpine builder if I pack config experimental true. We should add the experimental config to the Makefile.

We also have plans to refactor our docs at buildpacks/rfcs#296, which should hopefully see us documenting this better.

@edmorley
Copy link
Author

@AidanDelaney Thank you for the reply. I realise experimental mode can be enabled (see OP), this issue is about the examples not working out of the box (ie default configuration).

@natalieparellano
Copy link
Member

I need to do some samples work this week, I can look into this

@natalieparellano natalieparellano self-assigned this Oct 31, 2023
@AidanDelaney
Copy link
Member

Fixed in 0a90553

edmorley added a commit to heroku/libcnb.rs that referenced this issue Nov 15, 2023
In CI a `pack build` is performed using one of libcnb's example CNBs
and the upstream `cnb/sample-builder:alpine` builder, in order to test
that our static MUSL compile works with non-libc base images.

However, in #594 the version of that builder had to be pinned to
an older release, to work around a temporary incompatibility
between the latest version of the builder and the latest stable
Pack CLI.

That issue has now been resolved:
buildpacks/samples#170

So we can switch back to the latest image version again.
@edmorley
Copy link
Author

This still reproduces:
https://github.com/heroku/libcnb.rs/actions/runs/6875118962/job/18698087762?pr=668#step:10:110

ERROR: failed to build: experimental features must be enabled when builder contains image extensions

Unless there is a way to configure the buildpack image to force Pack CLI to enable the experimental features, the experimental rebase features should not be used in these "hello world" type images, and instead demonstrated via other images IMO.

These samples are for basic getting started scenarios, and as-is they don't work out of the box.

@natalieparellano
Copy link
Member

I have yet to pick this up, but it's on my list...

@AidanDelaney
Copy link
Member

Is this something that we can address by improving the docs? Right now you must enable experimental features for this sample to work.

@edmorley
Copy link
Author

edmorley commented Dec 6, 2023

There are two issues here:

  1. If a particular builder needs a particular experimental config option enabled for the builder to work, then the docs should mention this.
  2. IMO experimental features should not be used in the main "getting started" / demo type builders/samples (such as the alpine example), and instead should be their own builder/sample that demos just the experimental feature.

I filed this issue primarily about (2), so fixing (1) whilst useful in general would not resolve this issue.

@edmorley
Copy link
Author

edmorley commented Dec 6, 2023

ie: If you want a sample that shows how to use Dockerfiles extensions then it should be completely separate from other builders like the alpine example.

edmorley added a commit to heroku/libcnb.rs that referenced this issue Feb 4, 2024
In CI a `pack build` is performed using one of libcnb's example CNBs
and the upstream `cnb/sample-builder:alpine` builder, in order to test
that our static MUSL compile works with non-libc base images.

However, in #594 the version of that builder had to be pinned to
an older release, to work around a temporary incompatibility
between the latest version of the builder and the latest stable
Pack CLI.

That issue has now been resolved:
buildpacks/samples#170

So we can switch back to the latest image version again.
@Srishti-j18
Copy link
Contributor

Srishti-j18 commented Feb 9, 2024

Hi! I am following the App developer guide. In the Specify buildpacks section, I was using the Pack CLI to specify which buildpacks are used during the build process, and I encountered the error:

ERROR: failed to build: experimental features must be enabled when the builder contains image extensions.
Initially, I thought I needed to enable experimental features in Docker. However, after receiving the same error again and discussing with @jjbustamante . I realized that the experimental feature had to be enabled in the Pack configuration. It might be a bit confusing for readers as it's not immediately clear that this experimental feature needs to be enabled in Pack.

This issue is relatable, so I believe we should address it.
Screenshot from 2024-02-09 15-46-35

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 a pull request may close this issue.

4 participants