Skip to content

Commit

Permalink
Use run-before-daemon to simplify implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 4, 2023
1 parent db854fd commit 58e074a
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ RUN mamba install -y -c conda-forge qe=${QE_VERSION} && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${SYSTEM_USER}"

COPY s6-assets/s6-rc.d /etc/s6-overlay/s6-rc.d
COPY s6-assets/init /etc/init
COPY scripts/60-pseudo-code-setup.sh /etc/init/run-before-daemon-start/

# Static example files
RUN mkdir -p /opt/examples
Expand Down
Empty file.
Empty file.

This file was deleted.

1 change: 0 additions & 1 deletion .docker/s6-assets/s6-rc.d/run-before-daemon-start/type

This file was deleted.

6 changes: 0 additions & 6 deletions .docker/s6-assets/s6-rc.d/run-before-daemon-start/up

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# If lock file exists, then we have already run this script
if [ -f ${HOME}/.run-before-daemon-start-done ]; then
if [ -f ${HOME}/.lock_pseudo_code_setup ]; then
exit 0
else
touch ${HOME}/.run-before-daemon-start-done
touch ${HOME}/.lock_pseudo_code_setup
fi

# Install pseudopotential libraries
Expand Down
13 changes: 4 additions & 9 deletions .docker/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@ def is_container_ready(dodkec_compose):
@pytest.fixture(scope='session', autouse=True)
def _docker_service_wait(docker_services):
"""Container startup wait."""
# XXX: Temporary fail the real run test because daemon start is should depened on
# run-before-daemon-start but it does not.

#docker_compose = docker_services._docker_compose
docker_compose = docker_services._docker_compose

#docker_services.wait_until_responsive(
# timeout=120.0, pause=0.1, check=lambda: is_container_ready(docker_compose)
#)
import time
time.sleep(60)
docker_services.wait_until_responsive(
timeout=120.0, pause=0.1, check=lambda: is_container_ready(docker_compose)
)

@pytest.fixture
def container_user():
Expand Down
1 change: 0 additions & 1 deletion .docker/tests/test_aiida.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import time

def test_verdi_status(aiida_exec, container_user):
output = aiida_exec('verdi status', user=container_user).decode().strip()
Expand Down

0 comments on commit 58e074a

Please sign in to comment.