Skip to content

Commit

Permalink
profile to test profile
Browse files Browse the repository at this point in the history
echo_info and set default loglevel of cmdline to INFO

aiida version all to 2.0.0b1

add default_user_email for test_psql_dos

Ping aiida-core version to v2.0.1
  • Loading branch information
unkcpz committed May 13, 2022
1 parent 1d01074 commit 75adadb
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 619,790 deletions.
2 changes: 1 addition & 1 deletion .ci/aiida-version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "AiiDA",
"message": "v1.6.5",
"message": "v2.0.1",
"color": "brightgreen"
}
1 change: 1 addition & 0 deletions .github/aiida/profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ broker_password: guest
broker_host: 127.0.0.1
broker_port: 5672
broker_virtual_host: ''
test_profile: true
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
- name: Load test data
run: |
if [ "${{ matrix.database }}" == "aiida" ]; then
verdi import --migration --non-interactive .github/aiida/optimade.aiida
verdi archive import --migration .github/aiida/optimade.aiida
else
.github/mongo/load_data.py
fi
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
run: .github/aiida/setup_aiida.sh

- name: Load test data (AiiDA)
run: verdi import --migration --non-interactive .github/aiida/optimade.aiida
run: verdi archive import --migration .github/aiida/optimade.aiida

- name: Build docker image
run: docker-compose -f profiles/docker-compose-mongo.yml build --build-arg CONFIG_FILE=".github/mongo/ci_config.json"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
# Install specific optimade and aiida-core versions
ARG OPTIMADE_TOOLS_VERSION=0.16.10
# FIXME when production version released
ARG AIIDA_VERSION=2.0.0b1
ARG AIIDA_VERSION=2.0.1

# Copy repo contents
COPY setup.py setup.json README.md requirements*.txt ./
Expand Down
10 changes: 6 additions & 4 deletions aiida_optimade/cli/cmd_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def calc(obj: dict, fields: Tuple[str], force_yes: bool, silent: bool):
from aiida import load_profile
from aiida.cmdline.utils import echo

echo.CMDLINE_LOGGER.setLevel("INFO")

try:
profile: str = obj.get("profile").name
except AttributeError:
Expand Down Expand Up @@ -68,12 +70,12 @@ def calc(obj: dict, fields: Tuple[str], force_yes: bool, silent: bool):
number_of_nodes = STRUCTURES.count(**query_kwargs)
if number_of_nodes:
if not silent:
echo.echo_report(
echo.echo_info(
f"Field{'s' if len(fields) > 1 else ''} found for {number_of_nodes}"
f" Node{'s' if number_of_nodes > 1 else ''}."
)
if not silent:
echo.echo_report(
echo.echo_info(
f"Total number of Nodes in profile {profile!r}: {STRUCTURES.count()}"
)

Expand Down Expand Up @@ -110,7 +112,7 @@ def calc(obj: dict, fields: Tuple[str], force_yes: bool, silent: bool):
del all_calculated_nodes

if not silent:
echo.echo_report(
echo.echo_info(
f"Done removing {', '.join(fields)} from {number_of_nodes} Node"
f"{'s' if number_of_nodes > 1 else ''}."
)
Expand Down Expand Up @@ -154,7 +156,7 @@ def calc(obj: dict, fields: Tuple[str], force_yes: bool, silent: bool):
"AiiDA-OPTIMADE."
)
else:
echo.echo_report(
echo.echo_info(
"No StructureData and CifData Nodes found to calculate field"
f"{'s' if len(fields) > 1 else ''} {', '.join(fields)} for {profile!r}."
)
14 changes: 9 additions & 5 deletions aiida_optimade/cli/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def init(obj: dict, force: bool, silent: bool, mongo: bool, filename: str):
from aiida import load_profile
from aiida.cmdline.utils import echo

# The default aiida.cmdline loglevel inherit from aiida loglevel is REPORT
# Here we use INFO loglevel for the operations
echo.CMDLINE_LOGGER.setLevel("INFO")

filename: Path = Path(filename) if filename else filename

if mongo and filename:
Expand Down Expand Up @@ -77,7 +81,7 @@ def init(obj: dict, force: bool, silent: bool, mongo: bool, filename: str):
)
STRUCTURES_MONGO.collection.drop()
if not silent:
echo.echo_report(
echo.echo_info(
f"Done dropping {STRUCTURES_MONGO.collection.full_name!r} "
"collection."
)
Expand All @@ -90,7 +94,7 @@ def init(obj: dict, force: bool, silent: bool, mongo: bool, filename: str):

number_of_nodes = STRUCTURES.count(**query_kwargs)
if not silent:
echo.echo_report(
echo.echo_info(
"Forcing re-calculation. About to remove OPTIMADE-specific "
f"extras for {number_of_nodes} Nodes."
)
Expand All @@ -111,13 +115,13 @@ def init(obj: dict, force: bool, silent: bool, mongo: bool, filename: str):
del all_calculated_nodes

if not silent:
echo.echo_report(
echo.echo_info(
f"Done removing extra {extras_key!r} in {number_of_nodes} "
"Nodes."
)

if not silent:
echo.echo_report(f"Initializing {profile}.")
echo.echo_info(f"Initializing {profile}.")
echo.echo_warning("This may take several minutes!")

if filename:
Expand Down Expand Up @@ -209,7 +213,7 @@ def init(obj: dict, force: bool, silent: bool, mongo: bool, filename: str):
"documents have been initialized."
)
else:
echo.echo_report(
echo.echo_info(
"No new StructureData and CifData Nodes or MongoDB documents found to "
f"initialize for {profile}."
)
Expand Down
4 changes: 2 additions & 2 deletions profiles/docker-compose-mongo.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.16.10
AIIDA_VERSION: 1.6.5
OPTIMADE_TOOLS_VERSION: 0.16.12
AIIDA_VERSION: 2.0.1
CONFIG_FILE: aiida_optimade/config.json
environment:
AIIDA_PATH: /app
Expand Down
4 changes: 2 additions & 2 deletions profiles/docker-compose-mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.16.10
AIIDA_VERSION: 1.6.5
OPTIMADE_TOOLS_VERSION: 0.16.12
AIIDA_VERSION: 2.0.1
CONFIG_FILE: aiida_optimade/config.json
environment:
AIIDA_PATH: /app
Expand Down
4 changes: 2 additions & 2 deletions profiles/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.16.10
AIIDA_VERSION: 1.6.5
OPTIMADE_TOOLS_VERSION: 0.16.12
AIIDA_VERSION: 2.0.1
CONFIG_FILE: aiida_optimade/config.json
environment:
AIIDA_PATH: /app
Expand Down
4 changes: 2 additions & 2 deletions profiles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ services:
context: ..
dockerfile: Dockerfile
args:
OPTIMADE_TOOLS_VERSION: 0.16.10
AIIDA_VERSION: 1.6.5
OPTIMADE_TOOLS_VERSION: 0.16.12
AIIDA_VERSION: 2.0.1
CONFIG_FILE: aiida_optimade/config.json
environment:
AIIDA_PATH: /app
Expand Down
4 changes: 3 additions & 1 deletion profiles/test_psql_dos.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"broker_virtual_host": ""
}
},
"options": {}
"options": {},
"test_profile": true,
"default_user_email": "aiida@localhost"
}
}
}
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiida-core[atomic_tools]~=2.0.0b1
optimade[mongo]~=0.16.10
uvicorn~=0.17.4
aiida-core[atomic_tools]~=2.0.1
optimade[mongo]~=0.16.12
uvicorn~=0.17.6

# Dependencies used directly in this package, but included through other dependencies:
# aiida-core:
Expand Down
Loading

0 comments on commit 75adadb

Please sign in to comment.