Add cooperative task recovery and persistent live status
Build custom container images / build (map[base_image:php:8-fpm-alpine build_args:PHP_VERSION=8
context:php8-pgsql fingerprint_command:{ apk info -v | LC_ALL=C sort; find /usr/local/lib/php/extensions /usr/local/etc/php/conf.d -type f -exec sha256sum {} + | LC_ALL=C sort; }
name:ph… (push) Successful in 40s
Build custom container images / build (map[base_image:postgres:18 build_args:PG_VERSION=18
POSTGIS_VERSION=3
VCHORD_VERSION=0.5.3
context:postgres fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; find /usr/lib/postgresql -type f -exec sha256su… (push) Successful in 49s
Build custom container images / build (map[base_image:python:3 build_args:PYTHON_VERSION=3
context:python-tools fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:python-tools oci_labels:org.opencontainers.ima… (push) Successful in 1m37s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:linkki-tiedotus fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:linkki-tiedotus oci_labels:… (push) Successful in 36s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:timepoll fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:timepoll oci_labels:org.opencontai… (push) Successful in 42s
Build custom container images / build (map[base_image:php:8-fpm-alpine build_args:PHP_VERSION=8
context:php8-pgsql fingerprint_command:{ apk info -v | LC_ALL=C sort; find /usr/local/lib/php/extensions /usr/local/etc/php/conf.d -type f -exec sha256sum {} + | LC_ALL=C sort; }
name:ph… (push) Successful in 40s
Build custom container images / build (map[base_image:postgres:18 build_args:PG_VERSION=18
POSTGIS_VERSION=3
VCHORD_VERSION=0.5.3
context:postgres fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; find /usr/lib/postgresql -type f -exec sha256su… (push) Successful in 49s
Build custom container images / build (map[base_image:python:3 build_args:PYTHON_VERSION=3
context:python-tools fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:python-tools oci_labels:org.opencontainers.ima… (push) Successful in 1m37s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:linkki-tiedotus fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:linkki-tiedotus oci_labels:… (push) Successful in 36s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:timepoll fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:timepoll oci_labels:org.opencontai… (push) Successful in 42s
This commit is contained in:
1 parent
034fecbd51
commit
3bfd199b9c
28 files changed
+2356
-172
No files matched your search
@@ -141,3 +141,35 @@ def test_removing_file_input_from_task_cleans_up_unused_review_upload(settings):
|
||||
manifest.write_text(json.dumps(definition))
|
||||
app.extensions["run_manager"].cleanup_transient_files()
|
||||
assert not original.parent.exists()
|
||||
|
||||
|
||||
def test_conflicting_execute_is_linked_and_keeps_review_upload(settings, monkeypatch):
|
||||
app, client, review_id = start_review(settings)
|
||||
manager = app.extensions["run_manager"]
|
||||
original = Path(json.loads(manager.store.get(review_id).input_json)["csv"])
|
||||
write_task(settings.task_root, "imports", "other.py", 'print("done")\n')
|
||||
monkeypatch.setattr(manager, "_wake_worker", lambda *_: None)
|
||||
blocker, _ = manager.run_task(app.extensions["catalog"].task("imports/other.py"))
|
||||
page = client.get(f"/runs/{review_id}")
|
||||
assert b'fieldset class="task-controls" disabled' in page.data
|
||||
assert f'href="/runs/{blocker.id}"'.encode() in page.data
|
||||
response = client.post(f"/runs/{review_id}/execute", headers={"Accept": "application/json"})
|
||||
assert response.status_code == 409
|
||||
assert response.get_json()["blocked_by"]["run_id"] == blocker.id
|
||||
assert original.is_file()
|
||||
manager.store.finish(blocker.id, status="cancelled")
|
||||
accepted = client.post(f"/runs/{review_id}/execute", headers={"Accept": "application/json"})
|
||||
assert accepted.status_code == 202
|
||||
assert accepted.get_json()["detail_url"].startswith("/runs/")
|
||||
assert accepted.get_json()["run_id"] != review_id
|
||||
|
||||
|
||||
def test_shutdown_during_execute_keeps_review_upload(settings):
|
||||
app, client, review_id = start_review(settings)
|
||||
manager = app.extensions["run_manager"]
|
||||
original = Path(json.loads(manager.store.get(review_id).input_json)["csv"])
|
||||
manager._closing.set()
|
||||
response = client.post(f"/runs/{review_id}/execute", headers={"Accept": "application/json"})
|
||||
assert response.status_code == 503
|
||||
assert "shutting down" in response.get_json()["error"]
|
||||
assert original.is_file()
|
||||
Reference in new issue
Block a user