From df4bb5a27e30442df54c9153ff27c412f8c59ca2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 20 Mar 2024 17:27:00 +0000 Subject: [PATCH 1/3] Remove qe build (#438) This was moved to aiidalab-qe repository. --- build.json | 6 ------ docker-bake.hcl | 25 +------------------------ tests/conftest.py | 5 ----- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/build.json b/build.json index 5657520d..bb45ad92 100644 --- a/build.json +++ b/build.json @@ -14,12 +14,6 @@ }, "AIIDALAB_HOME_VERSION": { "default": "23.03.1" - }, - "AIIDALAB_QE_VERSION": { - "default": "23.04.6" - }, - "QE_VERSION": { - "default": "7.2" } } } diff --git a/docker-bake.hcl b/docker-bake.hcl index a01ecd6a..b9a204de 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -17,12 +17,6 @@ variable "AIIDALAB_VERSION" { variable "AIIDALAB_HOME_VERSION" { } -variable "AIIDALAB_QE_VERSION" { -} - -variable "QE_VERSION" { -} - variable "JUPYTER_BASE_IMAGE" { default = "jupyter/minimal-notebook:python-${PYTHON_VERSION}" } @@ -40,7 +34,7 @@ variable "PLATFORMS" { } variable "TARGETS" { - default = ["base", "base-with-services", "lab", "full-stack", "qe"] + default = ["base", "base-with-services", "lab", "full-stack"] } function "tags" { @@ -54,10 +48,6 @@ group "default" { targets = "${TARGETS}" } -target "qe-meta" { - tags = tags("qe") -} - target "base-meta" { tags = tags("base") } @@ -114,16 +104,3 @@ target "full-stack" { } platforms = "${PLATFORMS}" } - -target "qe" { - inherits = ["qe-meta"] - context = "stack/qe" - contexts = { - full-stack = "target:full-stack" - } - args = { - "AIIDALAB_QE_VERSION" = "${AIIDALAB_QE_VERSION}" - "QE_VERSION" = "${QE_VERSION}" - } - platforms = "${PLATFORMS}" -} diff --git a/tests/conftest.py b/tests/conftest.py index e8cf4799..5524cc44 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -92,8 +92,3 @@ def aiidalab_version(_build_config): @pytest.fixture(scope="session") def aiidalab_home_version(_build_config): return _build_config["AIIDALAB_HOME_VERSION"]["default"] - - -@pytest.fixture(scope="session") -def qe_version(_build_config): - return _build_config["QE_VERSION"]["default"] From 2f88e21d6b20c430ec7d544e38c8a73ee3c2fe65 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:19:13 +0100 Subject: [PATCH 2/3] [pre-commit.ci] pre-commit autoupdate (#441) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.3.0](https://github.com/psf/black/compare/23.12.1...24.3.0) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- tests/test-base-with-services.py | 1 + tests/test-base.py | 1 + tests/test-common.py | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcaacc61..63ba5ed3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,6 +19,6 @@ repos: args: [--preserve-quotes] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.3.0 hooks: - id: black diff --git a/tests/test-base-with-services.py b/tests/test-base-with-services.py index 38f6b18a..ddcfcea1 100644 --- a/tests/test-base-with-services.py +++ b/tests/test-base-with-services.py @@ -1,4 +1,5 @@ """Services related tests.""" + import json from packaging.version import parse diff --git a/tests/test-base.py b/tests/test-base.py index 963fadcf..0c4a8506 100644 --- a/tests/test-base.py +++ b/tests/test-base.py @@ -1,4 +1,5 @@ """This module contains tests for the base image, which are AiiDA and package management related tests.""" + import pytest import json from packaging.version import parse diff --git a/tests/test-common.py b/tests/test-common.py index acc63d8b..01ac9f57 100644 --- a/tests/test-common.py +++ b/tests/test-common.py @@ -1,4 +1,5 @@ """Tests for all images, which are docker/docker-compose related tests.""" + import requests From c1aeaec24ebb7b32493f20fe5192cd79aa2c05cb Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 2 Apr 2024 21:40:42 +0100 Subject: [PATCH 3/3] Pin aiida-core version (#440) Prevent Apps from messing with aiida-core installation. If users need to use a specific AiiDA version, they should use the corresponding AiiDAlab image. --- stack/base/Dockerfile | 9 +++++---- tests/test-base.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/stack/base/Dockerfile b/stack/base/Dockerfile index e26421c2..d0ee2b27 100644 --- a/stack/base/Dockerfile +++ b/stack/base/Dockerfile @@ -16,11 +16,12 @@ WORKDIR /opt/ ARG AIIDA_VERSION -# Pin shared requirements in the base environemnt. -# The lower bound of aiida-core is set to the version of aiida-core to prevent -# lower aiida-core DB version installed and trigger database downgrade. +# Pin shared requirements in the base environment. +# We pin aiida-core to the exact installed version, +# to prevent accidental upgrade or downgrade, that might +# induce DB migration or break shared dependencies of AiiDAlab Apps. RUN echo "pip==23.3.1" > /opt/requirements.txt && \ - echo "aiida-core>=${AIIDA_VERSION},<3" >> /opt/requirements.txt + echo "aiida-core==${AIIDA_VERSION}" >> /opt/requirements.txt # Install the shared requirements. RUN mamba install --yes \ diff --git a/tests/test-base.py b/tests/test-base.py index 0c4a8506..3a7a4b56 100644 --- a/tests/test-base.py +++ b/tests/test-base.py @@ -5,13 +5,13 @@ from packaging.version import parse -@pytest.mark.parametrize("incompatible_version", ["1.6.3"]) +@pytest.mark.parametrize("incompatible_version", ["2.3.0"]) def test_prevent_pip_install_of_incompatible_aiida_version( aiidalab_exec, nb_user, aiida_version, incompatible_version ): package_manager = "pip" assert parse(aiida_version) != parse(incompatible_version) - # Expected to succeed: + # Expected to succeed, although should be a no-op. aiidalab_exec( f"{package_manager} install aiida-core=={aiida_version}", user=nb_user )