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

CodeBuild: Support LOCAL_DOCKER_LAYER_CACHE #1956

Closed
odanado opened this issue Mar 5, 2019 · 2 comments · Fixed by #2529 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Labels
@aws-cdk/aws-codebuild Related to AWS CodeBuild effort/medium Medium work item – several days of effort feature-request A feature should be added or improved.

Comments

@odanado
Copy link

odanado commented Mar 5, 2019

By setting type as LOCAL and modes as LOCAL_DOCKER_LAYER_CACHE, CodeBuild can be cached Docker Image.
https://docs.aws.amazon.com/ja_jp/codebuild/latest/APIReference/API_ProjectCache.html

But, @aws-cdk/aws-codebuild@0.25.1 only can set type as S3.
https://github.com/awslabs/aws-cdk/blob/v0.25.1/packages/@aws-cdk/aws-codebuild/lib/project.ts#L606-L609

@sam-goodwin sam-goodwin added feature-request A feature should be added or improved. @aws-cdk/aws-codebuild Related to AWS CodeBuild labels Mar 7, 2019
@skinny85 skinny85 added effort/medium Medium work item – several days of effort effort/small Small work item – less than a day of effort and removed effort/medium Medium work item – several days of effort labels Mar 18, 2019
@skinny85 skinny85 added effort/medium Medium work item – several days of effort and removed effort/small Small work item – less than a day of effort labels Apr 12, 2019
@rvdwijngaard
Copy link

+1

@SanderKnape
Copy link

SanderKnape commented May 6, 2019

I can look into implementing this feature, but would like some feedback on the how to do so first. As mentioned before there is currently a cacheBucket property (https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-codebuild/lib/project.ts#L591) that will enable S3 caching. I can add a new property, cacheModes, that accepts a list of cache modes (see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html). Then I would also need to check if only one of cacheBucket or cacheModes is set. I guess I can do this around this other validation that is happening: https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-codebuild/lib/project.ts#L658 This is backwards-compatible change.

Another option is to change the existing property to something new that would accept either S3 cache settings or a list of cache modes.

Any thoughts? Maybe @skinny85 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment