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
Changes from 17 commits
d567380
e4d012f
0604d21
293c662
69a0841
cc2ef17
18892e8
d16eb83
7176fb4
d571126
482ead4
20a9d11
1179b2b
11bb844
9acd368
c948905
10d7b83
3903362
7acd9a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Additions for dev container | ||
FROM aiidateam/aiida-core:main | ||
|
||
# Add test dependencies (not installed in image) | ||
RUN pip install ./aiida-core[tests,rest,docs,pre-commit] | ||
# the `locate` command is needed by many tests | ||
RUN apt-get update \ | ||
&& apt-get install -y mlocate \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# add aiida user | ||
RUN /etc/my_init.d/10_create-system-user.sh | ||
|
||
# copy updated aiida configuration script | ||
# this line can be deleted after the new script has been merged | ||
COPY ../.docker/opt/configure-aiida.sh /opt/configure-aiida.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "aiida", | ||
"workspaceFolder": "/home/aiida/aiida-core", | ||
"postCreateCommand": "bash ./.devcontainer/post_create.sh", | ||
"waitFor": "postCreateCommand", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["ms-python.python", "eamodio.gitlens"] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
version: '3.4' | ||
|
||
services: | ||
|
||
rabbitmq: | ||
image: rabbitmq:3.8.3-management | ||
environment: | ||
RABBITMQ_DEFAULT_USER: guest | ||
RABBITMQ_DEFAULT_PASS: guest | ||
ports: | ||
- '5672:5672' | ||
- '15672:15672' | ||
|
||
healthcheck: | ||
test: rabbitmq-diagnostics -q ping | ||
interval: 30s | ||
timeout: 30s | ||
retries: 5 | ||
networks: | ||
- aiida | ||
|
||
postgres: | ||
image: postgres:12 | ||
ports: | ||
- '5432:5432' | ||
networks: | ||
- aiida | ||
environment: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
# volumes: | ||
# - db-volume:/var/lib/postgresql/data | ||
|
||
aiida: | ||
#image: "aiidateam/aiida-core:main" | ||
image: "aiida-core-dev" | ||
build: | ||
# need to add the parent directory to context to copy over new configure-aiida.sh | ||
context: .. | ||
dockerfile: .devcontainer/Dockerfile | ||
user: aiida | ||
environment: | ||
DB_HOST: postgres | ||
BROKER_HOST: rabbitmq | ||
|
||
# no need for /sbin/my_init | ||
entrypoint: tail -f /dev/null | ||
volumes: | ||
- ..:/home/aiida/aiida-core:cached | ||
# - db-volume:/var/lib/assets | ||
networks: | ||
- aiida | ||
depends_on: | ||
- rabbitmq | ||
- postgres | ||
|
||
# volumes: | ||
# db-volume: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe 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. |
||
|
||
networks: | ||
aiida: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# configure aiida | ||
/opt/configure-aiida.sh |
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).