From e92b1d96a2cf74f8c9ff848db2054fba464051ca Mon Sep 17 00:00:00 2001 From: Michel Van den Bergh Date: Tue, 21 Jan 2025 11:12:24 +0100 Subject: [PATCH] Salvage fastchess binary after worker update. Raise worker version to 253 (also server side). --- server/fishtest/api.py | 2 +- worker/sri.txt | 2 +- worker/updater.py | 16 ++++++++++++++++ worker/worker.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/server/fishtest/api.py b/server/fishtest/api.py index cd1bba543..f8e6b9a30 100644 --- a/server/fishtest/api.py +++ b/server/fishtest/api.py @@ -34,7 +34,7 @@ according to the route/URL mapping defined in `__init__.py`. """ -WORKER_VERSION = 252 +WORKER_VERSION = 253 @exception_view_config(HTTPException) diff --git a/worker/sri.txt b/worker/sri.txt index 65a211ab4..76675870c 100644 --- a/worker/sri.txt +++ b/worker/sri.txt @@ -1 +1 @@ -{"__version": 252, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "JHO7pc2YF9noh8wsc1Pxmtd9x9zG8Hr+0haT7HEAvsCR1wYzUAYCUk7bWT/BJqOX", "games.py": "IZmJeczQV7IDMOvWS1NqR/tPe+Zg3rI8D1QDYIz/dvRE8auUU66PEjyfhWf9nbNe"} +{"__version": 253, "updater.py": "KiNaNadQJzjX85e2joCkfy87KUWIHizx+80xiFWMF7G7av2rDQaRrawnvhIjn9tL", "worker.py": "A3XMZNXEhv4Vi3qZYG6ZPBNROtWWiX4s8tmHCUD9bqxR9vmddPBOqvsF/Tfxu7w7", "games.py": "IZmJeczQV7IDMOvWS1NqR/tPe+Zg3rI8D1QDYIz/dvRE8auUU66PEjyfhWf9nbNe"} diff --git a/worker/updater.py b/worker/updater.py index a86c326cd..860f6d12f 100644 --- a/worker/updater.py +++ b/worker/updater.py @@ -7,6 +7,7 @@ from zipfile import ZipFile import requests +from games import EXE_SUFFIX start_dir = Path().cwd() @@ -112,6 +113,21 @@ def update(restart=True, test=False): sep="", file=sys.stderr, ) + # Salvage fastchess binary + fastchess_binary = Path("fastchess" + EXE_SUFFIX) + old_fast_chess = bkp_testing_dir / fastchess_binary + if old_fast_chess.exists(): + new_fast_chess = testing_dir / fastchess_binary + try: + old_fast_chess.replace(new_fast_chess) + except Exception as e: + print( + "Failed to preserve fastchess binary:\n", + e, + sep="", + file=sys.stderr, + ) + # Clean up old folder backups (keeping the num_bkps most recent). num_bkps = 3 for old_bkp_dir in sorted( diff --git a/worker/worker.py b/worker/worker.py index 22a08e8b0..ba106f452 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -69,7 +69,7 @@ MIN_CLANG_MAJOR = 8 MIN_CLANG_MINOR = 0 -WORKER_VERSION = 252 +WORKER_VERSION = 253 FILE_LIST = ["updater.py", "worker.py", "games.py"] HTTP_TIMEOUT = 30.0 INITIAL_RETRY_TIME = 15.0