Skip to content

Feat/distributed architecture#3

Open
MrUprizing wants to merge 6 commits intomainfrom
feat/distributed-architecture
Open

Feat/distributed architecture#3
MrUprizing wants to merge 6 commits intomainfrom
feat/distributed-architecture

Conversation

@MrUprizing
Copy link
Copy Markdown
Owner

This pull request introduces distributed mode support by refactoring configuration, adding new binaries for orchestrator and worker processes, and extending the API and database to support worker registration and image listing by worker. The changes enable the system to run in a multi-worker setup, where an orchestrator manages worker nodes that execute Docker operations.

Distributed Mode & Process Separation

  • Added new binaries: cmd/orchestrator/main.go for orchestrator and cmd/worker/main.go for worker, each with their own configuration, startup routines, and graceful shutdown logic. Workers can self-register and deregister with the orchestrator, and the orchestrator manages a registry of active workers. [1] [2]
  • Refactored configuration into three types: Config (all-in-one), WorkerConfig (worker), and OrchestratorConfig (orchestrator), each with dedicated loading functions. [1] [2]

Database & Repository Enhancements

  • Extended the database schema and repository with a new Worker model and related CRUD operations, including support for tracking active workers and associating sandboxes with specific workers. [1] [2] [3]

API Extensions

  • Updated the /images endpoint to support filtering by worker ID via a worker_id query parameter; added the WorkerImageLister interface to allow distributed image listing.
  • Updated API documentation (Swagger/OpenAPI) to describe the new worker_id parameter for image listing and the new name field for pre-generated container names used by orchestrator-to-worker communication. [1] [2] [3] [4] [5] [6]

Dependency Injection & Integration Test Updates

  • Updated Docker client construction to use explicit options (e.g., docker.WithRepository, docker.WithHostIP) for clarity and flexibility in distributed mode. [1] [2]

These changes lay the foundation for running the application in both all-in-one and distributed orchestrator/worker modes, improving scalability and flexibility.

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