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
Cherry-pick: 61828e2
  • Loading branch information
unkcpz authored and sphuber committed Nov 15, 2023
1 parent 22e8a80 commit 413a0db
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
@@ -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
@@ -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 413a0db

Please sign in to comment.