65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Check the Hermes agent environment and spark profile status."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def check_hermes_spark():
|
|
"""Verify Hermes spark profile exists and has correct structure."""
|
|
errors = []
|
|
|
|
# Check profile directory
|
|
profile_dir = Path("/root/.hermes/profiles/spark")
|
|
if not profile_dir.exists():
|
|
errors.append("Profile directory missing")
|
|
else:
|
|
# Check cache/scratch exists
|
|
scratch_dir = profile_dir / "cache" / "scratch"
|
|
if not scratch_dir.exists():
|
|
errors.append("Scratch directory missing")
|
|
|
|
# Check key files
|
|
config_file = profile_dir / "config.yaml"
|
|
if not config_file.exists():
|
|
errors.append("config.yaml missing")
|
|
|
|
return errors
|
|
|
|
|
|
def check_wizard_outputs():
|
|
"""Verify wizard-outputs/spark directory structure."""
|
|
errors = []
|
|
|
|
output_dir = Path("/root/.hermes/wizard-outputs/spark")
|
|
if not output_dir.exists():
|
|
errors.append("wizard-outputs/spark directory missing")
|
|
return errors
|
|
|
|
# Check for key output files
|
|
required_files = ["results.txt", "env-check.sh"]
|
|
for fname in required_files:
|
|
if not (output_dir / fname).exists():
|
|
errors.append(f"Missing {fname}")
|
|
|
|
return errors
|
|
|
|
|
|
def main():
|
|
all_errors = []
|
|
|
|
all_errors.extend(check_hermes_spark())
|
|
all_errors.extend(check_wizard_outputs())
|
|
|
|
if all_errors:
|
|
print("Verification FAILED:")
|
|
for err in all_errors:
|
|
print(f" - {err}")
|
|
sys.exit(1)
|
|
else:
|
|
print("All checks PASSED")
|
|
sys.exit(0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |