- gitleaks (via docker cp, dockerignore-agnostic) and hadolint scan every push/PR - new ruff lint stage (ruff.toml pins known-first-party for host/container consistency; B905 in env_config.py's zip() left un-fixed — app-logic change, see feedback-no-app-logic-changes) - pytest --cov-fail-under=75 gate on the test stage - scheduled Trivy critical failures now attempt an apk upgrade rebuild and open a PR if it clears the finding, instead of just failing red - ruff --fix/--format applied to existing code to start the gate clean
30 lines
804 B
Python
30 lines
804 B
Python
import logging
|
|
import signal
|
|
import sys
|
|
import time
|
|
|
|
from env_config import REFRESH_TIME
|
|
from gpu_checker import check_rtx_50_founders
|
|
|
|
|
|
# Signal handler function
|
|
def handle_exit(signum, frame):
|
|
logging.info(f"🛑 Received signal {signum}. Exiting gracefully...")
|
|
sys.exit(0)
|
|
|
|
|
|
# Register signal handlers
|
|
signal.signal(signal.SIGINT, handle_exit) # Ctrl+C
|
|
signal.signal(signal.SIGTERM, handle_exit) # docker stop / kill -15
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
while True:
|
|
start = time.time()
|
|
check_rtx_50_founders()
|
|
elapsed = time.time() - start
|
|
time.sleep(max(0, REFRESH_TIME - elapsed))
|
|
except KeyboardInterrupt:
|
|
logging.info("🛑 Script interrupted by user (KeyboardInterrupt). Exiting gracefully.")
|
|
sys.exit(0)
|