Skip to content

Disable cache on feature build when --build-no-cache is passed - #790

Merged
Samruddhi Khandale (samruddhikhandale) merged 8 commits into
devcontainers:mainfrom
robjackstewart:control-cache-for-features
Apr 15, 2024
Merged

Samruddhi Khandale (samruddhikhandale) merged 8 commits into
devcontainers:mainfrom
robjackstewart:control-cache-for-features

Conversation

@robjackstewart

@robjackstewart Rob Jack Stewart (robjackstewart) commented Apr 2, 2024 •

Copy link
Copy Markdown
Contributor

Changes

Add --no-cache arg to the docker build command that extends the base image with the feature images when --build-no-cache is passed.

Context

The build will always use a cached feature image if it has one. This was making it impossible to replicate a problem in our CI process caused by this issue. Our CI pipeline was failing to install the Azure CLI, but building locally worked fine. The CI pipeline uses GitHub actions, so no cache of the build was available, however, I had cached versions of the image locally and passing the --build-no-cache continued to use the cache. I had to remove all the images via docker images -q "vsc-$MY_IMAGE*" | xargs docker rmi -f order to get a build representative of my CI environment working locally.

Closes #508

@robjackstewart Rob Jack Stewart (robjackstewart) changed the title Disable cache on feature build when specified Apr 2, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes make sense to me, left one comment.

Comment thread src/spec-node/containerFeatures.ts Resolved

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! Left a comment.

Comment thread src/spec-node/containerFeatures.ts Resolved
@robjackstewart

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Comment thread src/test/cli.build.test.ts Resolved

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thanks!

@robjackstewart

Copy link
Copy Markdown
Contributor Author

Christof Marti (@chrmarti) or Samruddhi Khandale (@samruddhikhandale), may you please approve the run of the CI pipeline? 😸

@robjackstewart

Copy link
Copy Markdown
Contributor Author

Christof Marti (@chrmarti) or Samruddhi Khandale (@samruddhikhandale), may you please approve the run of the CI pipeline? 😸

The pipeline failed to install dependencies for the windows run. This is unlikely to be related to my changes.

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

Labels

None yet

3 participants