From a99a94493ce1d7b35744c6c75fcaada770e44bd2 Mon Sep 17 00:00:00 2001 From: Yoshifumi Nakamura Date: Wed, 5 Aug 2026 09:18:30 +0900 Subject: [PATCH] Fix dev execution profile registry config Signed-off-by: Yoshifumi Nakamura --- docs/guides/add-site.md | 6 +++++- result_server/app_dev.py | 4 ++++ result_server/tests/test_app_dev_security.py | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/guides/add-site.md b/docs/guides/add-site.md index 3767a60..5fb0428 100644 --- a/docs/guides/add-site.md +++ b/docs/guides/add-site.md @@ -854,11 +854,15 @@ Singularity/Apptainer が計算ノードで使える場合は、共有ファイ ```bash BASE=/uhome//gitlab-runner_jacamar-ci_amd SING=/path/to/singularity +ALPINE_GIT_IMAGE=docker://alpine/git: mkdir -p "$BASE/containers" "$BASE/bin" -"$SING" build --sandbox "$BASE/containers/git" docker://alpine/git:latest +"$SING" build --sandbox "$BASE/containers/git" "$ALPINE_GIT_IMAGE" ``` +`` は site 側で動作確認した固定 tag に置き換えてください。 +`latest` は使わないでください。 + `$BASE/bin/git`: ```bash diff --git a/result_server/app_dev.py b/result_server/app_dev.py index cb537ce..7691f0b 100644 --- a/result_server/app_dev.py +++ b/result_server/app_dev.py @@ -220,6 +220,10 @@ def payload_too_large(_error): app.config["RECEIVED_PADATA_DIR"] = received_padata_dir app.config["RECEIVED_ESTIMATION_ARTIFACTS_DIR"] = received_estimation_artifacts_dir app.config["ESTIMATED_DIR"] = estimated_dir + app.config["EXECUTION_PROFILE_DB_PATH"] = os.environ.get( + "RESULT_SERVER_DB_PATH", + os.path.join(base_dir, "cx_portal.sqlite3"), + ) # Home routes and loaders pull everything from current_app.config. register_home_routes(app) diff --git a/result_server/tests/test_app_dev_security.py b/result_server/tests/test_app_dev_security.py index f03eacc..95b1d88 100644 --- a/result_server/tests/test_app_dev_security.py +++ b/result_server/tests/test_app_dev_security.py @@ -42,3 +42,12 @@ def test_validate_dev_runtime_rejects_production_env(monkeypatch): monkeypatch.setenv("FLASK_ENV", "production") with pytest.raises(SystemExit): app_dev.validate_dev_runtime("127.0.0.1") + + +def test_create_dev_app_configures_execution_profile_db(tmp_path, monkeypatch): + monkeypatch.delenv("RESULT_SERVER_DB_PATH", raising=False) + app_dev.setup_dev_environment(str(tmp_path)) + + app = app_dev.create_dev_app(str(tmp_path)) + + assert app.config["EXECUTION_PROFILE_DB_PATH"] == str(tmp_path / "cx_portal.sqlite3")