-
Notifications
You must be signed in to change notification settings - Fork 203
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
DevOps: Add devcontainer #5913
DevOps: Add devcontainer #5913
Conversation
for more information, see https://pre-commit.ci
a short video of how it works https://www.youtube.com/watch?v=ibkFSNLQsww&ab_channel=LeopoldTalirz you can try it yourself at https://github.com/ltalirz/aiida-core/tree/feat/devcontainer-compose Note: I first built a version with a single container in https://github.com/ltalirz/aiida-core/tree/feat/devcontainer but then abandoned it since the approach of the |
the duplication of the |
@yakutovicha I understand that the If that is the case, then we could probably at some point get rid of the |
That is correct 👍 |
@unkcpz @chrisjsewell @yakutovicha any thoughts on this PR? It anyhow reuses the current aiida-core container, so the decision of deprecating aiida-prerequisites or not can be decoupled. |
Looks fine to me, I've always championed multiple containers (via docker-compose) and VS Code |
I fully agree with this. I think instead of having the aiida image in aiidalab as I tried in aiidalab/aiidalab-docker-stack#319, it makes more sense to just have the parallel one base on the simple |
aiida: | ||
#image: "aiidateam/aiida-core:main" | ||
image: "aiida-core-dev" | ||
build: |
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 think the image aiidalab/base
from https://hub.docker.com/r/aiidalab/base/tags is what we can put here in the future if we manage to move it from aiidalab to here, correct?
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.
Almost. It would probably rather become FROM
image in the .devcontainer/Dockerfile
, since the devcontainer focuses on development (which requires e.g. some further dependencies installed).
Thanks for the feedback @unkcpz ! Given this, I will prepare this PR for review with minimal changes; |
PR is now ready for review (the UI doesn't let me convert it from a draft) |
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.
thanks @ltalirz, I just have one question. I'll test locally it later.
.devcontainer/docker-compose.yml
Outdated
# volumes: | ||
# db-volume: |
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.
Do this need to be kept here? Since it is useful for having data stored persistent I suggest keeping it and adding more details.
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.
Yes, that was the intention. Will add further comments
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.
in the end I decided to remove them as they are untested.
it's easy enough to reintroduce them and go to a setup with persistent data
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.
Thanks, but it is a bit confusing for me how this codespace is working, if I understand correctly, the container is opened in a remote machine provided by GitHub. How is this persistent volumes mapping can mapping to the local DB file or local file repository?
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.
Indeed this would have been intended for running the devcontainer locally through VS Code.
I am not aware of a way of persisting files after github codespaces deletes the containers.
remove comments
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.
@ltalirz Thanks for the update. I give it a test and it is super cool. Just one follow-up question on the volume mapping of the container.
The devcontainer specification [1] is about making it easier for developers to get a first development environment up and running.
This gives (prospective) AiiDA developers and contributors a fully-fledged AiiDA development environment in two ways:
On GitHub, a user can simply click on "Code" => "Open with Codespaces", wait 5 minutes
In the command palette, type "Open Folder in Container" (automatically pops up when opening folder in VS Code)
[1] https://containers.dev