From 4a5092bd31c4b2b39b994e313557adb1c07fe240 Mon Sep 17 00:00:00 2001 From: Xavier Bouthillier Date: Fri, 23 Jul 2021 11:49:04 -0400 Subject: [PATCH 1/3] Remove space upgrade from DB upgrade Why: The space upgrade relies on local files if the experiment's search space is defined in a configuration file. Parsing these file during the DB upgrade can break the DB because all experiments may not be executed on the same file system and thus some configuration files may not be present. The space should only be upgraded when the user attempts running an experiment, in which case the configuration file is available. The space does not need to be upgraded during DB upgrade anyway, because experiment built is backward compatible with experiments lacking an explicit space definition in DB (relying on cmdargs and config file to define space at run-time). How: Remove space upgrade from db upgrade script. --- src/orion/core/cli/db/upgrade.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/orion/core/cli/db/upgrade.py b/src/orion/core/cli/db/upgrade.py index e2263da85..a79fa3126 100644 --- a/src/orion/core/cli/db/upgrade.py +++ b/src/orion/core/cli/db/upgrade.py @@ -126,7 +126,6 @@ def upgrade_documents(storage): """Upgrade scheme of the documents""" for experiment in storage.fetch_experiments({}): add_version(experiment) - add_space(experiment) storage.update_experiment(uid=experiment.pop("_id"), **experiment) @@ -135,11 +134,6 @@ def add_version(experiment): experiment.setdefault("version", 1) -def add_space(experiment): - """Add space to metadata if not present""" - backward.populate_space(experiment) - - def update_indexes(database): """Remove user from unique indices. From b547fc9f6bcb1ca7897fcbab786beb8009bf4022 Mon Sep 17 00:00:00 2001 From: Xavier Bouthillier Date: Fri, 23 Jul 2021 11:58:01 -0400 Subject: [PATCH 2/3] Remove unused backward --- src/orion/core/cli/db/upgrade.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/orion/core/cli/db/upgrade.py b/src/orion/core/cli/db/upgrade.py index a79fa3126..bafcdc748 100644 --- a/src/orion/core/cli/db/upgrade.py +++ b/src/orion/core/cli/db/upgrade.py @@ -12,7 +12,6 @@ import sys import orion.core.io.experiment_builder as experiment_builder -import orion.core.utils.backward as backward from orion.core.io.database.ephemeraldb import EphemeralCollection from orion.core.io.database.mongodb import MongoDB from orion.core.io.database.pickleddb import PickledDB From f557555ed28db0d388dcd628909be58b4837b227 Mon Sep 17 00:00:00 2001 From: Xavier Bouthillier Date: Fri, 23 Jul 2021 12:30:22 -0400 Subject: [PATCH 3/3] Do not test for priors in backward comp tests The DB upgrade does not update the space and priors anymore. The are handled anyway at runtime, no need to update them in the DB --- tests/functional/backward_compatibility/test_versions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functional/backward_compatibility/test_versions.py b/tests/functional/backward_compatibility/test_versions.py index bbf827bc9..b249099b8 100644 --- a/tests/functional/backward_compatibility/test_versions.py +++ b/tests/functional/backward_compatibility/test_versions.py @@ -244,7 +244,6 @@ def test_db_upgrade(self): experiments = storage.fetch_experiments({}) assert "version" in experiments[0] - assert "priors" in experiments[0]["metadata"] def test_db_test(self): """Verify db test command"""