Repository navigation
Implement Custom Stacks RFC: allow docker:// URIs as stacks - #5492
Conversation
4559c0a to
e067283
Compare
423f2ae to
15f6b1c
Compare
Add custom container-image stacks for buildpack and CNB lifecycle apps behind the diego_custom_stacks feature flag. - Accept and validate docker:// stack image URIs without creating Stack records or persisting the deprecated stack_id field. - Use custom root filesystems for staging, runtime LRPs, and tasks, with lifecycle-bundle fallback for droplets whose original stack was removed. - Support custom buildpacks and stackless admin buildpacks, including buildpack auto-detection. - Store registry credentials encrypted, redact them from app events, reject credentials embedded in stack URIs, and pass only complete matching username/password pairs to Diego. - Reject unsupported token credentials for custom stack registries while retaining token support for CNB buildpack images. - Derive CF_STACK and CNB_STACK_ID from the final image repository component, excluding tags and digests. - Skip stack-record validation and buildpack-cache handling where they do not apply to remote custom stack images. - Document custom stack syntax, credentials, buildpack restrictions, stack identifiers, and image-layer disk quota behavior. - Add coverage for validation, lifecycle staging, desired LRPs, tasks, credentials, feature-flag enforcement, manifests, and event redaction. Co-authored-by: FloThinksPi <5863788+FloThinksPi@users.noreply.github.com>
|
Tested on a bbl environment with a default CF deployment, works! But I also tested some error scenarios and found a few confusing error messages and a few minor issues:
Maybe better: "You must either specify a custom buildpack URL or your platform operator must provide an enabled buildpack not pinned to a stack."
Shouldn't the error say something like "404 not found"?
|
|
Thanks for the feedback @jochenehret . I addressed the points as follows:
|
313bfcb to
52af2a7
Compare
Preserve configured buildpacks during stack-only updates and reject non-string custom stack credentials before constructing Diego messages. Reject empty image repository path components, align staging lifecycle asset cache keys with the resolved platform stack, and expand image credential hashes directly into Diego recipes. Clarify staging-only build credentials versus app-level runtime credentials. Consolidate lifecycle tests, reuse existing fixtures, and remove duplicated coverage while retaining classic, CNB, and mixed-lifecycle regressions.
|
Tested again, just one finding: This still produces the somewhat confusing error message: |
This was fixed a few days ago: https://github.com/cloudfoundry/cloud_controller_ng/pull/5492/changes#diff-c05e3cf7801009354b84e037205a5e1fca2fef85f667d318a4e7d5ffe8919cd8R36-R41 |
Changes in cloud_controller_ng:
- Implement Custom Stacks RFC: allow docker:// URIs as stacks
PR: cloudfoundry/cloud_controller_ng#5492
Author: Johannes Haass <johannes.haass@sap.com>
Author: FloThinksPi <5863788+FloThinksPi@users.noreply.github.com>
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
Implements RFC-0046 behind the disabled-by-default
diego_custom_stacksfeature flag. Buildpack and CNB apps can use adocker://image URI as their stack without requiring aStackdatabase record.Custom stacks are used for staging, runtime LRPs, and tasks. They support custom buildpacks or admin buildpacks without a stack association. Registry credentials are stored encrypted and only complete username/password pairs are passed to Diego. Embedded credentials are rejected.
Public registry example:
The stack can also be provided directly to
cf push:Private registry example:
During staging, the final image repository component is exposed as
CF_STACKorCNB_STACK_ID. Custom stack image layers count toward the app instance disk quota.An explanation of the use cases your change solves
Operators can allow apps to use patched, specialized, or independently maintained root filesystems without registering platform stacks. This also supports private registries and apps that must continue using an image after its corresponding platform stack has been removed.
Manual test coverage
CF_STACKandCNB_STACK_IDderivation, a modified/etc/os-release, and the expected staging failure when image and buildpack ABIs were incompatible.I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests