From 6dfb3f1eb554b17733a398395cc2efa9454456f3 Mon Sep 17 00:00:00 2001 From: Disservin Date: Wed, 22 Jan 2025 16:10:54 +0100 Subject: [PATCH] Update fastchess version --- server/fishtest/api.py | 2 +- worker/games.py | 8 ++++---- worker/sri.txt | 2 +- worker/worker.py | 23 ++++++++++++----------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/server/fishtest/api.py b/server/fishtest/api.py index f8e6b9a30..17526821f 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 = 253 +WORKER_VERSION = 254 @exception_view_config(HTTPException) diff --git a/worker/games.py b/worker/games.py index 1bc43ec76..378c7433f 100644 --- a/worker/games.py +++ b/worker/games.py @@ -142,7 +142,7 @@ def cache_read(cache, name): try: return (Path(cache) / name).read_bytes() - except Exception as e: + except Exception: return None @@ -166,7 +166,7 @@ def cache_write(cache, name, data): # Remove the temporary file os.remove(temp_file.name) - except Exception as e: + except Exception: return @@ -177,7 +177,7 @@ def cache_remove(cache, name): try: (Path(cache) / name).unlink() - except Exception as e: + except Exception: return @@ -230,7 +230,7 @@ def send_api_post_request(api_url, payload, quiet=False): valid_response = True try: response = response.json() - except: + except json.JSONDecodeError: valid_response = False if valid_response and not isinstance(response, dict): valid_response = False diff --git a/worker/sri.txt b/worker/sri.txt index 76675870c..d8155b80f 100644 --- a/worker/sri.txt +++ b/worker/sri.txt @@ -1 +1 @@ -{"__version": 253, "updater.py": "KiNaNadQJzjX85e2joCkfy87KUWIHizx+80xiFWMF7G7av2rDQaRrawnvhIjn9tL", "worker.py": "A3XMZNXEhv4Vi3qZYG6ZPBNROtWWiX4s8tmHCUD9bqxR9vmddPBOqvsF/Tfxu7w7", "games.py": "IZmJeczQV7IDMOvWS1NqR/tPe+Zg3rI8D1QDYIz/dvRE8auUU66PEjyfhWf9nbNe"} +{"__version": 254, "updater.py": "KiNaNadQJzjX85e2joCkfy87KUWIHizx+80xiFWMF7G7av2rDQaRrawnvhIjn9tL", "worker.py": "N3WmdZPsPvqhgmNRMF7OFW1N07s1BcG0RT2I3IyFX7ppaFw5Ho6E5XCG60WzFcYu", "games.py": "L3lFiXS7LlrwjYD6eTuFwMrv/iARyF7Gei33NTiZ0gBl63yKZ1OreT4l8ymeoqrY"} diff --git a/worker/worker.py b/worker/worker.py index ba106f452..09f925f96 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -69,7 +69,9 @@ MIN_CLANG_MAJOR = 8 MIN_CLANG_MINOR = 0 -WORKER_VERSION = 253 +FASTCHESS_SHA = "894616028492ae6114835195f14a899f6fa237d3" + +WORKER_VERSION = 254 FILE_LIST = ["updater.py", "worker.py", "games.py"] HTTP_TIMEOUT = 30.0 INITIAL_RETRY_TIME = 15.0 @@ -122,7 +124,7 @@ /api/nn/ GET /git/trees/master GET /git/trees/master/blobs/ GET - /repos/Disservin/fastchess/zipball/ GET + /repos/Disservin/fastchess/zipball/ GET /repos//zipball/ GET Main loop /api/update_task POST @@ -454,11 +456,10 @@ def setup_fastchess(worker_dir, compiler, concurrency, global_cache): testing_dir = worker_dir / "testing" testing_dir.mkdir(exist_ok=True) - fastchess_sha = "d053a83d641ace390d9079bdab7f7b94f103727f" username = "Disservin" fastchess = "fastchess" + EXE_SUFFIX - if verify_required_fastchess(testing_dir / fastchess, fastchess_sha): + if verify_required_fastchess(testing_dir / fastchess, FASTCHESS_SHA): return True # build it ourselves @@ -469,34 +470,34 @@ def setup_fastchess(worker_dir, compiler, concurrency, global_cache): "https://api.github.com/repos/" + username + "/fastchess/zipball/" - + fastchess_sha + + FASTCHESS_SHA ) print("Building fastchess from sources at {}".format(item_url)) should_cache = False - blob = cache_read(global_cache, fastchess_sha + ".zip") + blob = cache_read(global_cache, FASTCHESS_SHA + ".zip") if blob is None: print("Downloading {}".format(item_url)) blob = requests_get(item_url).content should_cache = True else: - print("Using {} from global cache".format(fastchess_sha + ".zip")) + print("Using {} from global cache".format(FASTCHESS_SHA + ".zip")) file_list = unzip(blob, tmp_dir) prefix = os.path.commonprefix([n.filename for n in file_list]) if should_cache: - cache_write(global_cache, fastchess_sha + ".zip", blob) + cache_write(global_cache, FASTCHESS_SHA + ".zip", blob) os.chdir(tmp_dir / prefix) cmds = [ - f"make -j{concurrency} tests CXX={compiler} GIT_SHA={fastchess_sha[0:8]} GIT_DATE=01010101", + f"make -j{concurrency} tests CXX={compiler} GIT_SHA={FASTCHESS_SHA[0:8]} GIT_DATE=01010101", str(tmp_dir / prefix / ("fastchess-tests" + EXE_SUFFIX)), "make clean", - f"make -j{concurrency} CXX={compiler} GIT_SHA={fastchess_sha[0:8]} GIT_DATE=01010101", + f"make -j{concurrency} CXX={compiler} GIT_SHA={FASTCHESS_SHA[0:8]} GIT_DATE=01010101", ] for cmd in cmds: @@ -539,7 +540,7 @@ def setup_fastchess(worker_dir, compiler, concurrency, global_cache): os.chdir(cd) shutil.rmtree(tmp_dir, ignore_errors=True) - return verify_required_fastchess(testing_dir / fastchess, fastchess_sha) + return verify_required_fastchess(testing_dir / fastchess, FASTCHESS_SHA) def validate(config, schema):