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

ci: remove yarn cache for worker dev deps image #499

Merged
merged 4 commits into from
Aug 30, 2021
Merged

ci: remove yarn cache for worker dev deps image #499

merged 4 commits into from
Aug 30, 2021

Conversation

samchungy
Copy link
Contributor

The workers don't need to run yarn install after this step so we might as well remove the yarn cache associated with it.

In my testing -> this reduced the size of images by half

@samchungy samchungy requested a review from a team as a code owner August 30, 2021 06:55
@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2021

🦋 Changeset detected

Latest commit: 0422fab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Does the same apply to our non-worker templates, or is the cache required for the yarn install --production step seen elsewhere?

@samchungy
Copy link
Contributor Author

samchungy commented Aug 30, 2021

Yeah the cache is required if yarn --offline is used, which is what the APIs seem to use when building the prod image

@72636c
Copy link
Member

72636c commented Aug 30, 2021

Should we && yarn cache clean off of e.g. this then?

RUN yarn install --ignore-optional --ignore-scripts --non-interactive --offline --production

@samchungy
Copy link
Contributor Author

samchungy commented Aug 30, 2021

Should we && yarn cache clean off of e.g. this then?

RUN yarn install --ignore-optional --ignore-scripts --non-interactive --offline --production

hmmm 🤔 I don't know Docker well enough, does the image layer from that step contribute to the size of the final image? If it doesn't then maybe not?

@72636c
Copy link
Member

72636c commented Aug 30, 2021

D'oh, that's me overlooking that we only copy node_modules over. We could include this in the Hello World template though, thoughts? https://github.com/seek-oss/skuba/blob/master/template/greeter/Dockerfile

@samchungy
Copy link
Contributor Author

D'oh, that's me overlooking that we only copy node_modules over. We could include this in the Hello World template though, thoughts? https://github.com/seek-oss/skuba/blob/master/template/greeter/Dockerfile

Hmmm maybe, depends on that repos usage I guess

@72636c 72636c enabled auto-merge (squash) August 30, 2021 23:21
@72636c 72636c merged commit 8e25aa6 into seek-oss:master Aug 30, 2021
@samchungy samchungy deleted the worker-docker-image-optimisation branch August 31, 2021 06:38
@github-actions github-actions bot mentioned this pull request Sep 16, 2021
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.

None yet

2 participants