Skip to content

Commit

Permalink
Fix double warning
Browse files Browse the repository at this point in the history
Tighten the cutechess-cli regular expression

Raise the worker version to 222 (also server side)
  • Loading branch information
Disservin authored and ppigazzini committed Oct 7, 2023
1 parent c522eef commit d786837
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/fishtest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
on how frequently the main instance flushes its run cache.
"""

WORKER_VERSION = 221
WORKER_VERSION = 222


def validate_request(request):
Expand Down
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"__version": 221, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "6LoP8vE7iFc/DFRdkMZ66FwBHtjKNt4MRaiBs7XpLRyrkWxfZNEMwcfyZxvs/XKJ", "games.py": "I+cktT3rD/gXlFYHmQpT8GHBfqR8VIjI4c6NHM68rn9gJJL/xu9AsOSLZys71s38"}
{"__version": 222, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "9RVstpWvQ/yVTHckLMbwE0+bat+pBj0IKxTdDjhwsN6/EElf9+FARDLRCFLrVg5v", "games.py": "I+cktT3rD/gXlFYHmQpT8GHBfqR8VIjI4c6NHM68rn9gJJL/xu9AsOSLZys71s38"}
14 changes: 10 additions & 4 deletions worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Several packages are called "expression".
# So we make sure to use the locally installed one.

WORKER_VERSION = 221
WORKER_VERSION = 222
FILE_LIST = ["updater.py", "worker.py", "games.py"]
HTTP_TIMEOUT = 30.0
INITIAL_RETRY_TIME = 15.0
Expand Down Expand Up @@ -405,6 +405,9 @@ def download_cutechess(cutechess, save_dir):
def verify_required_cutechess(cutechess_path):
# Verify that cutechess is working and has the required minimum version.

if not cutechess_path.exists():
return False

print("Obtaining version info for {} ...".format(cutechess_path))

try:
Expand All @@ -417,7 +420,7 @@ def verify_required_cutechess(cutechess_path):
close_fds=not IS_WINDOWS,
) as p:
errors = p.stderr.read()
pattern = re.compile("cutechess-cli ([0-9]*).([0-9]*).([0-9]*)")
pattern = re.compile(r"cutechess-cli ([0-9]+)\.([0-9]+)\.([0-9]+)")
major, minor, patch = 0, 0, 0
for line in iter(p.stdout.readline, ""):
m = pattern.search(line)
Expand Down Expand Up @@ -466,8 +469,11 @@ def setup_cutechess(worker_dir):
cutechess_path = testing_dir / cutechess

# Download cutechess-cli if missing or overwrite if there are issues.
if not cutechess_path.exists() or not verify_required_cutechess(cutechess_path):
if not verify_required_cutechess(cutechess_path):
download_cutechess(cutechess, testing_dir)
else:
os.chdir(curr_dir)
return True

ret = True

Expand Down Expand Up @@ -1355,7 +1361,7 @@ def fetch_and_handle_task(
if near_github_api_limit:
print(
"""
We have almost exhausted our github api calls.
We have almost exhausted our github api calls.
The server will only give us tasks for tests we have seen before.
"""
)
Expand Down

0 comments on commit d786837

Please sign in to comment.