Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salvage fastchess binary after worker update. #2179

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/fishtest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
according to the route/URL mapping defined in `__init__.py`.
"""

WORKER_VERSION = 252
WORKER_VERSION = 253


@exception_view_config(HTTPException)
Expand Down
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -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"}
16 changes: 16 additions & 0 deletions worker/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from zipfile import ZipFile

import requests
from games import EXE_SUFFIX

start_dir = Path().cwd()

Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading