Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

pack build --clear-cache #30

Closed
ekcasey opened this issue Dec 14, 2018 · 7 comments
Closed

pack build --clear-cache #30

ekcasey opened this issue Dec 14, 2018 · 7 comments
Assignees

Comments

@ekcasey
Copy link
Member

ekcasey commented Dec 14, 2018

Given I have a cache volume associated with my app image
When I call pack build or pack run with the --clear-cache flag
Then The old cache volume associated with the specific image is deleted and a clean cache volume is supplied for the build

Notes

  • Ensure that any stopped containers you delete were created by pack
@ekcasey ekcasey created this issue from a note in Planning Board (Backlog) Dec 14, 2018
@ameyer-pivotal ameyer-pivotal moved this from Backlog to In Progress in Planning Board Dec 20, 2018
@ameyer-pivotal ameyer-pivotal self-assigned this Dec 20, 2018
ameyer-pivotal pushed a commit to buildpacks/pack that referenced this issue Jan 2, 2019
[buildpacks/roadmap#30]

Signed-off-by: Andrew Meyer <ameyer@pivotal.io>
@ameyer-pivotal ameyer-pivotal moved this from In Progress to Release 9 in Planning Board Jan 2, 2019
@ameyer-pivotal ameyer-pivotal moved this from Release 9 to Done in Planning Board Jan 2, 2019
@sclevine sclevine moved this from Done to Release 9 in Planning Board Jan 4, 2019
@sclevine sclevine moved this from Release 9 to Done in Planning Board Jan 4, 2019
@sclevine
Copy link
Member

sclevine commented Jan 4, 2019

With --clear-cache, I consistently get:

liberty:pack pivotal$ ./pack-676-osx build myapp --builder packs/samples:0.0.1-rc.490 --buildpack ./test-bp/ --env-file <(echo 'TESTME=pass') --clear-cache
Defaulting app directory to current working directory /Users/pivotal/workspace/cncf-buildpacks/pack (use --path to override)
Using user-provided builder image packs/samples:0.0.1-rc.490
Pulling builder image packs/samples:0.0.1-rc.490 (use --no-pull flag to skip this step)
Selected run image packs/run:v3alpha2 from stack io.buildpacks.stacks.bionic
Pulling run image packs/run:v3alpha2 (use --no-pull flag to skip this step)
Using cache volume pack-cache-7bae996a0e238a80f14b74a61e3178bf
ERROR: clearing cache: Error response from daemon: remove pack-cache-7bae996a0e238a80f14b74a61e3178bf: volume is in use - [1ac007e017a7e066ddbfd7e224f9d34ad1f6e3dc4b57328052c8c07904434b9c]

This consistently fails (and building without --clear-cache consistently succeeds) regardless for every interleaving of them with the same image name.

@sclevine
Copy link
Member

sclevine commented Jan 4, 2019

@ekcasey

@sclevine sclevine added the reject label Jan 4, 2019
@sclevine sclevine moved this from Done to Backlog in Planning Board Jan 4, 2019
@ameyer-pivotal
Copy link

@sclevine We noticed that too and it went away when we ensured acceptance tests were not running parallel. Interesting that it still happens. Wonder if we should just manually empty the directory, rather than use the docker CLI to remove the volume.

@ekcasey
Copy link
Member Author

ekcasey commented Jan 4, 2019

@ameyer-pivotal @sclevine Sounds to me like we are leaving a stopped container around after pack build, we should probably fix that, including in cases where build was interrupted.

@sclevine
Copy link
Member

sclevine commented Jan 4, 2019

Agree that we should remove the stopped container. Would prefer to re-create the volume instead of clearing the directory.

matthewmcnew added a commit to buildpacks/pack that referenced this issue Jan 4, 2019
[buildpacks/roadmap#30]

Signed-off-by: Andrew Meyer <ameyer@pivotal.io>
@sclevine sclevine moved this from Backlog to Done in Planning Board Jan 7, 2019
@sclevine sclevine moved this from Done to Backlog in Planning Board Jan 7, 2019
@sclevine
Copy link
Member

sclevine commented Jan 7, 2019

Resolution:

  • Add metadata to our created containers that identifies it as created by the pack CLI
  • When removing a volume, check for bound containers that contain the metdata
  • Remove if present

@joaopapereira joaopapereira moved this from Backlog to In Progress in Planning Board Jan 15, 2019
joaopapereira added a commit to buildpacks/pack that referenced this issue Jan 15, 2019
* container label author=pack used to check if container is ok to remove

[buildpacks/roadmap#30]

Signed-off-by: Emily Casey <ecasey@pivotal.io>
Signed-off-by: Joao Pereira <jdealmeidapereira@pivotal.io>
@joaopapereira joaopapereira moved this from In Progress to Done in Planning Board Jan 15, 2019
@mgibson1121 mgibson1121 moved this from Done to Release v0.1.0 in Planning Board Jan 28, 2019
@mgibson1121
Copy link
Member

Accepted this with @ekcasey on 1/25

@sclevine sclevine closed this as completed Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants