-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix docker build for server & testbed server
- Loading branch information
1 parent
89e737c
commit 95c0a23
Showing
7 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS | ||
|
||
import time | ||
from urllib.request import Request, urlopen | ||
|
||
|
||
def can_connect_to_testbed(r: Request) -> bool: | ||
MAX_RETRIES = 10 | ||
DURATION_BETWEEN_RETRIES = 1 | ||
|
||
for i in range(MAX_RETRIES): | ||
try: | ||
urlopen(r) | ||
except Exception as exc: | ||
print(f"Try {i + 1}/{MAX_RETRIES}: {exc}") | ||
time.sleep(DURATION_BETWEEN_RETRIES) | ||
continue | ||
else: | ||
return True | ||
return False | ||
|
||
|
||
if __name__ == "__main__": | ||
r = Request("http://127.0.0.1:6777/", method="GET") | ||
print(f"Will connect to testbed server on: {r.get_full_url()}") | ||
|
||
if can_connect_to_testbed(r): | ||
print("Success") | ||
else: | ||
raise SystemExit("Cannot connect to Parsec server :(") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters