diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index bde97605f6..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# 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 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5bbcf39152..4dfd532583 100644 --- a/.devcontainer/devcontainer.json +++ b/.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"] diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 380a0a4760..18e8d3e513 100644 --- a/.devcontainer/docker-compose.yml +++ b/.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 diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh deleted file mode 100644 index 71f8330853..0000000000 --- a/.devcontainer/post_create.sh +++ /dev/null @@ -1,4 +0,0 @@ - #!/bin/bash - -# configure aiida -/opt/configure-aiida.sh