Skip to content

Commit

Permalink
Devops: Update the .devcontainer to use the new docker stack (#6139)
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz authored Sep 27, 2023
1 parent 17c5d87 commit 61828e2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 72 deletions.
16 changes: 0 additions & 16 deletions .devcontainer/Dockerfile

This file was deleted.

15 changes: 11 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"dockerComposeFile": "docker-compose.yml",
"service": "aiida",
"workspaceFolder": "/home/aiida/aiida-core",
"postCreateCommand": "bash ./.devcontainer/post_create.sh",
"waitFor": "postCreateCommand",
"service": "daemon",
"workspaceFolder": "/workspaces/aiida-core",
"postCreateCommand": "/etc/init/aiida-prepare.sh",
"postStartCommand": "pip install -e /workspaces/aiida-core[tests,docs,rest,atomic_tools,pre-commit]",
"postAttachCommand": "verdi daemon start",
"waitFor": "postStartCommand",
"containerUser": "aiida",
"remoteUser": "aiida",
"remoteEnv": {
"HOME": "/home/aiida"
},
"customizations": {
"vscode": {
"extensions": ["ms-python.python", "eamodio.gitlens"]
Expand Down
80 changes: 32 additions & 48 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,38 @@
---
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'
database:
image: postgres:15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test: [ "CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 10

healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 5
networks:
- aiida
messaging:
image: rabbitmq:3.8.14-management
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 30s
timeout: 30s
retries: 10

postgres:
image: postgres:12
ports:
- '5432:5432'
networks:
- aiida
environment:
POSTGRES_HOST_AUTH_METHOD: trust

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
networks:
- aiida
depends_on:
- rabbitmq
- postgres

networks:
aiida:
daemon:
image: aiidateam/aiida-core-base:edge
user: aiida
entrypoint: tail -f /dev/null
environment:
SETUP_DEFAULT_AIIDA_PROFILE: 'true'
TZ: 'Europe/Zurich'
depends_on:
database:
condition: service_healthy
4 changes: 0 additions & 4 deletions .devcontainer/post_create.sh

This file was deleted.

0 comments on commit 61828e2

Please sign in to comment.