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

Configure docker layer caching for external image between builds does not work #405

Closed
danielleallopez opened this issue Nov 18, 2020 · 4 comments

Comments

@danielleallopez
Copy link

We are pulling a DynamoDB local image in our CodeBuild project to run tests over the source code, and are trying to set up cache docker layer to save time between builds.

However, we see that there is no time improvement between builds that are only seconds apart.

We saw someone with a similar problem in another issue: is there any recommended way how to cache docker layers for more than a life span of a codebuild?
my UC - for every build I pull mysql image from public docker registry to execute some local integration tests. How can I cache this image between builds (Let's say I have build frequency 2 times a day)

Originally posted by @ivanmartos in #26 (comment)

@subinataws
Copy link
Contributor

@danielleallopez - This limitation is tracked in #194. There is a workaround mentioned there. Resolving to track under one issue.

@danielleallopez
Copy link
Author

@subinataws Thanks for taking the time to answer. I saw that issue before creating this one, and the thing is that it mentions that cache works fine when builds are ran minutes apart, but we're not seeing that even when they are ran seconds apart.

We've been basically running one after another and see no improvement regarding time, so issue/question was about what might be wrong there.

@subinataws
Copy link
Contributor

@danielleallopez - Could you tell me more about the build configuration? Which compute type is being used? Do you have privileged mode enabled?

If you have privileged mode enables, then there will be no warm node available for any period of time, unless you enable docker_layer_caching under the local cache setting.

@danielleallopez
Copy link
Author

@subinataws Thanks for the response.

We created a simple code build project with build image LinuxBuildImage.STANDARD_4_0, compute type ComputeType.SMALL and not privileged.

The build spec installs python dependencies using pip in the install phase and just runs pytest in the build phase.

We were expecting to see a decrease in the total runtime on consecutive builds, but we don't.

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

No branches or pull requests

2 participants