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

Enable interception via shell per lifecycle phase execution #485

Closed
wants to merge 11 commits into from

Conversation

jromero
Copy link
Member

@jromero jromero commented Jan 31, 2020

Summary

Work In Progress

Known Issues:
  • stdin not captured properly per phase preventing subsequent phase shell from accepting initial input
    • workaround: type ls first to ensure shell can receive input
TODO:
  • Create Flag: --intercept
  • Window Resizing

Output

┌─[javier.romero][jromero-air][±][hack/intercept ↑1 ↓1 ✓][~/dev/pack]
└─▪ go run cmd/pack/main.go build my-app -B cnbs/sample-builder:bionic -p ../samples/apps/ruby-bundler/ --verbose
Pulling image index.docker.io/cnbs/sample-builder:bionic
bionic: Pulling from cnbs/sample-builder
Digest: sha256:f81f1c46d1164d3e7870724c64514e4edfaa021a1cf8144827e1e645da940ae8
Status: Image is up to date for cnbs/sample-builder:bionic
Selected run image cnbs/sample-stack-run:bionic
Pulling image cnbs/sample-stack-run:bionic
bionic: Pulling from cnbs/sample-stack-run
Digest: sha256:bbccf4244b2646e8ad69f167b5f6c4240679cc7164b6ef795accd33d573bda95
Status: Image is up to date for cnbs/sample-stack-run:bionic
Using build cache volume pack-cache-cbd6ecf04229.build
===> DETECTING
Intercepting...
-----------
To continue to the next phase type: exit
To manually run the phase type:
/cnb/lifecycle/detector -log-level debug -app /workspace -platform /platform
-----------
$ 

Related Issues

Resolves #62

This reverts commit 0a7c43c.

Signed-off-by: Javier Romero <[email protected]>
Known Issues:
- stdin is prematurely captured per phase preventing next phase shell from accepting initial input
    - work around: type `ls` first to ensure shell can receive input

TODO:
- Create flag
- Window resizing

Signed-off-by: Javier Romero <[email protected]>
@ekcasey
Copy link
Member

ekcasey commented Jan 31, 2020

@jromero if we move using lifecycle/all (buildpacks/rfcs#46) in the near future (which we should because because it saves us approximately 6s per build) this phase container based implementation might become moot?

Unless we choose run separate containers in the --intercept case, specifically for this purpose.

@jromero
Copy link
Member Author

jromero commented Jan 31, 2020

@ekcasey yeah, I thought about that as I came back to try to finish this off. My thought was that whatever that may look like we could find a solution for it. For example, your proposal or we can simply list the /all command as the thing they should execute plus a way to list out individual commands. There are possibly other solutions here as well. I just didn't want this to collect too much dust. IMO, the need will always be there for a developer (or bp author) to better be able to debug the app building process.

@ekcasey
Copy link
Member

ekcasey commented Jan 31, 2020

@jromero I think it's also worth noting that the original feature request in the referenced issue is to hijack between the execution of individual buildpacks during the builder phase, not between phases. Not that I can't imagine the latter also being useful, but perhaps this could benefit from a little user research (cc @zmackie), or an RFC.

@jromero jromero changed the base branch from master to main June 18, 2020 14:58
@jromero
Copy link
Member Author

jromero commented Aug 2, 2022

This is now stale. Closing.

@jromero jromero closed this Aug 2, 2022
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 this pull request may close these issues.

Hijack feature: shell into a buildpack container to look at the state of things
2 participants