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

Test: Extensions are cached #3052

Closed
2 tasks done
chrmarti opened this issue May 27, 2020 · 4 comments
Closed
2 tasks done

Test: Extensions are cached #3052

chrmarti opened this issue May 27, 2020 · 4 comments

Comments

@chrmarti
Copy link
Contributor

chrmarti commented May 27, 2020

Refs: #2227

Complexity: 3

Create Issue


  • Setup a devcontainer (see any of the instructions).
  • Add a list of extensions to its devcontainer.json (or the attach config, if you are using the attach case). (E.g., using 'Add to devcontainer.json' from the Extensions viewlet's context menu.)
  • Rebuild the container and verify the extensions are installed.
  • Enable 'trace' logging in the settings:
    image
  • Rebuild the container and verify the extensions are copied over from the local cache.
    • Remote-Containers: Show Log and search for extensions cache. One of these entries should say that it copies the extensions to the remote.

If you are using a single container:

  • Add "mounts": ["type=volume,src=extensionsCache,target=/home/node/.vscode-server-insiders/extensionsCache"] to your devcontainer.json.
  • Verify that rebuilding the container now copies the extensions to the container only once, after that the copies on the mounted volume are used. (Again check the log with 'trace' level enabled.)
  • Note: If you are running the container as another user than root, you will need to create the extensionsCache folder in the container with that user as the owner in your Dockerfile first (a Docker limitation). E.g.:
FROM node:12
USER node
RUN mkdir -p /home/node/.vscode-server-insiders/extensionsCache

/fyi @Chuxel Not sure if you want to document the advanced case of mounting a volume (see above).

@chrmarti chrmarti added this to the May 2020 milestone May 27, 2020
@RMacfarlane RMacfarlane removed their assignment Jun 3, 2020
@weinand
Copy link

weinand commented Jun 3, 2020

@chrmarti I'm seeing:

[2016 ms] Extensions cache, copy to remote: andreweinand.mock-debug-0.41.0, eamodio.gitlens-10.2.1

That's the correct log message, right?

After adding the "mounts" definition to the devcontainer.json, "rebuilding" results in this log:
container-log.txt

I still see a "Extensions cache, copy to remote:" in there. Does this mean that the copies from the mounted volume are not used?

@weinand weinand removed their assignment Jun 3, 2020
@weinand weinand closed this as completed Jun 3, 2020
@chrmarti
Copy link
Contributor Author

chrmarti commented Jun 3, 2020

@weinand That's the right message. And yes "copy to remote" means that the copies from the mounted volume are not used. I realize the "mounts" definition above says /home/node when it would be /root in your case, maybe that's the issue?

@weinand
Copy link

weinand commented Jun 3, 2020

@chrmarti after changing the path in the .devcontainer.json from /home/node to /root I see a

[2008 ms] Extensions cache, copy to remote: None

That looks better, right?

@chrmarti
Copy link
Contributor Author

chrmarti commented Jun 4, 2020

@weinand Yes, thanks. 👍

@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants