Skip to content

Enable multi-arch Dockerfile, add CI pytest matrix, and implement graceful shutdown - #17

Open
KingUdo wants to merge 10 commits into
mainfrom
feature-ci-multiarch-and-graceful-shutdown
Open

KingUdo wants to merge 10 commits into
mainfrom
feature-ci-multiarch-and-graceful-shutdown

Conversation

@KingUdo

@KingUdo KingUdo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary of Improvements

  1. Multi-Architecture Base Image in src/Dockerfile:

    • Removed hardcoded --platform=linux/amd64 from FROM python:3.10-slim, enabling native ARM64 and AMD64 builds with Docker buildx and build.sh.
  2. Automated CI Testing & Safe Dockerhub Publishing:

    • Updated .github/workflows/build-and-push.yml to run a preliminary test job with pytest on Python 3.10, 3.11, and 3.12 before building images.
    • Added docker/setup-qemu-action for cross-architecture builds.
    • Made DockerHub login and image push conditional on non-PR events (github.event_name != 'pull_request'), preventing PRs from failing due to missing secrets.
  3. Graceful Shutdown & Signal Handling (SIGTERM / SIGINT):

    • Registered signal handlers for SIGINT and SIGTERM in src/monitor.py.
    • Replaced infinite blocking server.accept() with a 1.0s timeout loop that respects shutdown_event.
    • Updated attack_forward_worker to drain remaining queued attacks on shutdown and joined the worker thread before exit, preventing dropped telemetry when containers stop.

Test Results

============================== 25 passed in 3.15s ==============================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant