-
Notifications
You must be signed in to change notification settings - Fork 361
How we pick stack and buildpacks for staging
Lisa Cho edited this page May 4, 2018
·
32 revisions
- AppLifeCycleProvider chooses docker vs buildpacks here
- Creates an lifecycle (AppBuildpackLifecle) and passes it to AppCreate to be saved in DB.
- Given a message with requested buildpacks, fetches and validates them
- If no stack was requested, store the default stack on the app
- Finds the stack in DB
- Fetches the requested buildpacks from the DB
- Some buildpacks aren't found in the DB because they are github urls or nonexistent.
- Preserves requested buildpack order
- Allow matching buildpacks on 'nil' unknown stacks and exact stack matches.
- Maps to BuildpackInfos
- Validates the combination of buildpacks and stacks.
- Small class
- Primary responsibility is to set
buildpack_url
for git buildpacks
- Lifecycle data is actually saved in
buildpack_lifecycle_data
andbuildpack_lifecycle_buildpacks
tables. - BuildpackLifecycleData has a buildpack field, but it's for legacy use.
- Normally, BuildpackLifecycleData is linked to either an app or a build & droplet. The buildpack_lifecycle_data has many BuildpackLifecycleBuildpacks.
- Additional validation on these models.
End result is that buildpacks and stack get saved on lifecycle on the app in the DB
- basic string validation is in BuildpackLifecycleDataMessage
- LifecycleProvider switches between buildpacks and docker similar to AppLifecycleProvider here
- Calls Buildcreate with
lifecycle
- Similar to AppBuildPackLifecycle (creates lifecycle from a message object)
- Key difference: buildpacks and stack can be requested on the message on stage request, or fall back to the what is saved on the app's lifecycle.
- Calculates
staging_details
from the package (along with memory, disk, environment variables, etc). -
lifecycle
is nested on thestaging_details
. - Calls the Stager with the
staging_details
- Responsibility (once was to hold Diego staging logic vs DEA staging logic?)
- Calls the Messenger with
staging_details
- Creates a task definition using the TaskRecipeBuilder and
staging_details
and passes off to BbsStagerClient
- Responsibility: Defines all the fields to pass to Diego
- The stack is called
root_fs
- Buildpacks are passed in the
action
- These two fields are calculated using the LifecycleProtocol, which then chooses BuildpacksLifecycleProtocol
- Responsibility:
- The stack comes from
staging_details
- The buildpacks are calculated using
staging_details
and BuildpackEntryGenerator
- Handles user-specified buildpacks vs autodetection
- For autodetection, return all the admin buildpacks.
- For user-defined buildpacks, adds
skip_detect
field and return those.
- Translates arguments into download actions and stage action commands
-
Pipelines
-
Contributing
- Tips and Tricks
- Cloud Controller API v3 Style Guide
- Playbooks
- Development configuration
- Testing
-
Architectural Details
-
CC Resources
- Apps
- Audit Events
- Deployments
- Labels
- Services
- Sidecars
-
Dependencies
-
Troubleshooting
- Ruby Console Script to Find Fields that Cannot Be Decrypted
- Logging database queries in unit tests
- Inspecting blobstore cc resources and cc packages(webdav)
- How to Use USR1 Trap for Diagnostics
- How to Perf: Finding and Fixing Bottlenecks
- How to get access to mysql database
- How To Get a Ruby Heap Dumps & GC Stats from CC
- How to curl v4 internal endpoints with mtls
- How to access Bosh Director console and restore an outdated Cloud Config
- Analyzing Cloud Controller's NGINX logs using the toplogs script
-
k8s
-
Archive