buildout.coredev icon indicating copy to clipboard operation
buildout.coredev copied to clipboard

Dev containers support for VS Code and GitHub Codespaces

Open davisagli opened this issue 1 year ago • 4 comments

Proof of concept.

To do:

  • [ ] docs

davisagli avatar Nov 30 '24 20:11 davisagli

I am testing it and the build process took me several minutes (in the first run). Looks too slow for using in a training with slow internet connection.

ramiroluz avatar Dec 01 '24 17:12 ramiroluz

I did clone the repo. I checked out the wrong branch devcontainer, then it failed. I checked out the branch davisagli-devcontainers and it failed again.

''' Can not execute action! Traceback (most recent call last): File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/common.py", line 328, in worker output = action(**kwargs) ^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 289, in checkout return self.update(**kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 333, in update if not self.matches(): ^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 328, in matches raise GitError(f"git remote of '{name}' failed.\n{stderr}") mxdev.vcs.git.GitError: git remote of 'Plone' failed. fatal: detected dubious ownership in repository at '/workspaces/buildout.coredev/src/Plone' To add an exception for this directory, call:

    git config --global --add safe.directory /workspaces/buildout.coredev/src/Plone

Can not execute action! Traceback (most recent call last): File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/common.py", line 328, in worker output = action(**kwargs) ^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 289, in checkout return self.update(**kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 333, in update if not self.matches(): ^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 328, in matches raise GitError(f"git remote of '{name}' failed.\n{stderr}") mxdev.vcs.git.GitError: git remote of 'Products.CMFPlone' failed. fatal: detected dubious ownership in repository at '/workspaces/buildout.coredev/src/Products.CMFPlone' To add an exception for this directory, call:

    git config --global --add safe.directory /workspaces/buildout.coredev/src/Products.CMFPlone

Can not execute action! Traceback (most recent call last): File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/common.py", line 328, in worker output = action(**kwargs) ^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 289, in checkout return self.update(**kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 333, in update if not self.matches(): ^^^^^^^^^^^^^^ File "/workspaces/buildout.coredev/.venv/lib/python3.12/site-packages/mxdev/vcs/git.py", line 328, in matches raise GitError(f"git remote of '{name}' failed.\n{stderr}") mxdev.vcs.git.GitError: git remote of 'mockup' failed. fatal: detected dubious ownership in repository at '/workspaces/buildout.coredev/src/mockup' To add an exception for this directory, call:

    git config --global --add safe.directory /workspaces/buildout.coredev/src/mockup

Cloned 'docs' with git using branch '6.0' from 'https://github.com/plone/documentation.git'. Initialized 'docs' submodule at 'submodules/plone.api' with git. Initialized 'docs' submodule at 'submodules/plone.restapi' with git. Initialized 'docs' submodule at 'submodules/volto' with git. There have been errors, see messages above. make: *** [Makefile:247: .mxmake/sentinels/sources.sentinel] Error 1 [417095 ms] postCreateCommand failed with exit code 2. Skipping any further user-provided commands. '''

ramiroluz avatar Dec 01 '24 18:12 ramiroluz

@ramiroluz Thanks for testing it.

I am testing it and the build process took me several minutes (in the first run). Looks too slow for using in a training with slow internet connection.

This is a scenario where it might make more sense to use the dev container in a GitHub Codespace. Then most of the network transfer is to the remote VM that runs the software, rather than to your own device.

The "fatal: detected dubious ownership" error might happen if you already had some repositories cloned in the src folder before you started the dev container (because the owner outside the container is different than the user inside the container). I'll check how we can avoid this error.

davisagli avatar Dec 01 '24 18:12 davisagli

So I tried on code space and there was one problem: Captura de tela de 2024-12-01 15-46-02

ramiroluz avatar Dec 01 '24 18:12 ramiroluz