Maestro-Docker Container Orchestration Made Simple

Maestro

Docker Container Orchestration Made Simple

Docker
Python

Maestro is an elegant and lightweight solution for Docker container orchestration that simplifies the complex symphony of container deployments. Like a conductor leading an orchestra, Maestro harmoniously manages your Docker containers with precision and grace.

:dart: Features

  • :arrows_counterclockwise: Automated container orchestration and lifecycle management
  • :rocket: Boot-time container initialization
  • :video_game: On-demand container reconstruction
  • :musical_keyboard: Interactive container management interface
  • :musical_score: Selective container exclusion
  • :globe_with_meridians: Universal Docker environment compatibility

:rocket: Prerequisites

  • Python 3.6 or higher
  • Docker Engine
  • Docker Compose
  • Appropriate Docker permissions for the executing user

:package: Installation

  1. Clone the repository:
git clone https://git.hhf.technology/hhf/maestro.git
cd maestro
  1. Configure your environment by editing maestro.conf (see Configuration section below)

  2. Ensure scripts have executable permissions:

chmod +x *.py

:gear: Configuration

maestro.conf

The docker-composer.conf file conducts your container orchestra with these essential parameters:

Parameter Description Example
compose-path Directory containing Docker container folders /opt/docker/containers
exclude-containers List of containers to exclude from management ["container1", "container2"]

Example configuration:

compose-path: /opt/docker/containers
exclude-containers:
  - monitoring
  - internal-proxy

Directory Structure

Your container directory should be organized as follows:

compose-path/
โ”œโ”€โ”€ container1/
โ”‚   โ””โ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ container2/
โ”‚   โ””โ”€โ”€ docker-compose.yml
โ””โ”€โ”€ container3/
    โ””โ”€โ”€ docker-compose.yml

:musical_score: Usage

Available Scripts

Script Description Use Case
composer.py Main orchestration script Automated container management on system boot
re_compose.py Manual reconstruction tool On-demand container rebuild and reconfiguration
basic_management.py Interactive management interface Basic container operations (start, stop, remove)

Running the Scripts

All scripts must be executed from the same directory as docker-composer.conf.

  1. Automated Boot Management
./composer.py

  1. Manual Container Reconstruction
./re_compose.py

  1. Interactive Container Management
./basic_management.py

System Integration

To enable automatic container management on system boot:

Using systemd

  1. Create a service file:
sudo nano /etc/systemd/system/docker-composer.service
  1. Add the following content:
[Unit]
Description=Maestro Docker Container Orchestration
After=docker.service
Requires=docker.service

[Service]
Type=simple
ExecStart=/path/to/docker-composer.py
WorkingDirectory=/path/to/maestro
User=your-user
Group=docker

[Install]
WantedBy=multi-user.target
  1. Enable and start the service:
sudo systemctl enable docker-composer
sudo systemctl start docker-composer

:lock: Security Considerations

  • Ensure proper file permissions on configuration files
  • Run scripts with minimal required privileges
  • Regularly audit excluded containers list
  • Monitor container logs for unexpected behavior

:wrench: Troubleshooting

Common issues and solutions:

  1. Permission Denied

    • Ensure the executing user is in the docker group
    • Check file permissions on scripts and configuration
  2. Configuration Not Found

    • Verify script execution from correct directory
    • Check docker-composer.conf exists and is readable
  3. Container Exclusion Issues

    • Verify container names match exactly
    • Check for whitespace in configuration

:handshake: Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

:page_facing_up: License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

:clap: Acknowledgments

  • Inspired by Umbrelโ€™s container management approach
  • Built with Python and Docker
  • Community contributions and feedback

For bug reports and feature requests, please use the comments below for bugs and other requests.

:star2: Why Maestro?

Like a masterful conductor, Maestro brings harmony to your Docker container orchestra. It simplifies complex container management tasks into elegant, automated solutions. Whether youโ€™re managing a small ensemble of containers or a full symphony of services, Maestro ensures everything plays together perfectly.

1 Like