-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add Devcontainer support #358
base: develop
Are you sure you want to change the base?
Conversation
@MatthewSteen @gtfierro I'd love to have either of your opinions on this if you have the time to take a look. |
This is pretty cool! I got it running with
Do you mean the Python packages are system wide in the devcontainer? Or do they use a copy of the libraries that's on my own machine? I do occasionally drop into the dependencies to add some debugging statements but I can try to be careful about not reloading the devcontainer while those are in there. I guess I'm not familiar with when the devcontainer reloads -- is this automatic or do I have to trigger it? |
I wanted to have the python dependencies installed in the devcontainer without copying the entire project in during build time. To accomplish this I copy just the In my regular BuildingMOTIF setup I like to have my virtual environment in a This approach isn't needed for node dependencies as I believe they are platform agnostic. So node will just use the
It seems like the container is reloaded everytime you start it. When I exit VS code the container goes down. A way around this could be mounting a volume, but that would make it so that you would need to reinstall the python packages as you'd be voluming over them. I'm not entirely happy with the current setup as if you change your depedencies relative to Finally, in my mind the devcontainer is probably best suited to people who aren't getting too in the weeds and just want to get an environment to play around with BuildingMOTIF. I don't really think all of us should move to using a devcontainer outside of making sure it stays working (we could potentially use it as our CI base image to enforce this). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to test this on Windows if you haven't already.
Need to add how to use this to the docs, probably with a new page at docs/references/user_documentation.md
.
Co-authored-by: Matt Steen <[email protected]>
@MatthewSteen I switched the way I was exposing docker, so it should be pretty stable now. It is now using the official docker outside of docker feature. |
The last thing I need to do is switch the CI to run on develop only instead of this branch. But I'm waiting for review before I do that incase there are more things to change. |
@MatthewSteen I just tried this out on my desktop running windows 10. It seems to setup fine, interested to see what the error you got was. |
@TShapinsky I'm the following error, which sounds like Poetry needs to be installed. [13284 ms] Start: Run in container: /bin/sh -c pre-commit install
[13284 ms] Start: Run in container: /bin/sh -c poetry install --all-extras
[14067 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands. |
Hmm, that's strange. The dockerfile includes poetry and installs all of the dependencies already. Is your working directory clean? Also is your VS code entirely up to date? |
Yes, I cloned the repo to the Windows side of my machine, then checked out this branch.
Yes. |
Devcontainers are an easy way to provide developers with a consistent build environment.
This container comes with buildingmotif python dependencies (all extras) pre installed as well angular cli. It supports both x86_64 and arm64 (to support newer macs).
Devcontainers are supported by several popular code editors and also have a cli for use without one of the supported editors. Users on VSCode will (upon opening the repo) be prompted as to whether they would like to use the dev container or not. If they click yes it will pull the container from github, spin it up and install the extensions I have specified.
TODO:
/var/run/docker.sock
) but I'm not clear as to whether this path on windows is contained within the WSL tree or windows regular file structure.node_modules
lives within the project and the python packages are system wide. When you reload the container you lose any changes you had made to the packages. This could be a good thing, as it provides a stable starting point, but it could get annoying in some cases.