|
17 | 17 | from execution_layer.circuit import ProofSystem
|
18 | 18 |
|
19 | 19 | from functools import partial
|
| 20 | +from collections import OrderedDict |
20 | 21 |
|
21 | 22 | LOCAL_SNARKJS_INSTALL_DIR = os.path.join(os.path.expanduser("~"), ".snarkjs")
|
22 | 23 | LOCAL_SNARKJS_PATH = os.path.join(
|
@@ -55,21 +56,21 @@ def run_shared_preflight_checks(role: Optional[Roles] = None):
|
55 | 56 | Exception: If any of the pre-flight checks fail.
|
56 | 57 | """
|
57 | 58 |
|
58 |
| - preflight_checks = [ |
59 |
| - ("Syncing model files", partial(sync_model_files, role=role)), |
60 |
| - ("Ensuring Node.js version", ensure_nodejs_version), |
61 |
| - ("Checking SnarkJS installation", ensure_snarkjs_installed), |
62 |
| - ("Checking EZKL installation", ensure_ezkl_installed), |
63 |
| - ] |
| 59 | + preflight_checks = OrderedDict({ |
| 60 | + "Syncing model files": partial(sync_model_files, role=role), |
| 61 | + "Ensuring Node.js version": ensure_nodejs_version, |
| 62 | + "Checking SnarkJS installation": ensure_snarkjs_installed, |
| 63 | + "Checking EZKL installation": ensure_ezkl_installed, |
| 64 | + }) |
64 | 65 |
|
65 | 66 | bt.logging.info(" PreFlight | Running pre-flight checks")
|
66 | 67 |
|
67 | 68 | # Skip sync_model_files during docker build
|
68 | 69 | if os.getenv("OMRON_DOCKER_BUILD", False):
|
69 | 70 | bt.logging.info(" PreFlight | Skipping model file sync")
|
70 |
| - preflight_checks.remove(("Syncing model files", sync_model_files)) |
| 71 | + _ = preflight_checks.pop("Syncing model files") |
71 | 72 |
|
72 |
| - for check_name, check_function in preflight_checks: |
| 73 | + for check_name, check_function in preflight_checks.items(): |
73 | 74 | bt.logging.info(f" PreFlight | {check_name}")
|
74 | 75 | try:
|
75 | 76 | check_function()
|
|
0 commit comments