Skip to main content

A simple command line tool for managing Docker Compose stacks using tags and other metadata.

Project description

Maestro

Maestro is a command-line tool designed to manage Docker Compose applications based on defined configurations. It facilitates starting, stopping, and listing services across multiple Docker Compose projects, allowing for streamlined Docker-based development workflows.

Installation

You can install Maestro via pipx:

pipx install maestro-compose

Usage

Maestro offers several commands to interact with your Docker Compose applications:

  • maestro up: Start the services specified in the configured Docker Compose files.
  • maestro down: Stop the running services.
  • maestro list: List the Docker Compose applications along with their respective services and states.

Additional Options

Up

Usage: maestro up [OPTIONS]

Options:
  --applications-dir TEXT  Specify the path containing docker compose applications.
  --target-file TEXT       Specify the target YAML file to use for configuration.
  --dry-run                Simulate the command without making any changes.

Down

Usage: maestro down [OPTIONS]

Options:
  --applications-dir TEXT  Specify the path containing docker compose applications.
  --target-file TEXT       Specify the target YAML file to use for configuration.
  --dry-run                Simulate the command without making any changes.

List

Usage: maestro list [OPTIONS]

Options:
  --applications-dir TEXT  Specify the path containing docker compose applications.
  --target-file TEXT       Specify the target YAML file to use for configuration.
  --services               List the services running in each application.

Configuration

Docker Label Configuration

Maestro utilizes Docker labels for configuration. Below is an example of the Docker label configuration that Maestro expects:

services:
  nginx:
    restart: unless-stopped
    image: nginx
    container_name: myapp
    labels:
      - "maestro.enable=true"
      - "maestro.tags=nfs_mount,compute_intensive"
      - "maestro.priority=800"
      - "maestro.hosts=server,vm"

Maestro Target Configuration (YAML)

Maestro requires a YAML configuration file to define its behavior. Below is an example of the expected structure of this configuration file (maestro.yaml):

hosts_include:
- $current
hosts_exclude:
- vm
tags_include:
  - server
tags_exclude:
- compute_intensive
  • hosts_include: List of hosts to include. Applications matching any of these hosts will be managed by Maestro. Use $all to match all hosts or $current to match the current host.
  • hosts_exclude: List of hosts to exclude. Applications matching any of these hosts will not be managed by Maestro.
  • tags_include: List of tags to include. Applications with any of these tags will be managed by Maestro.
  • tags_exclude: List of tags to exclude. Applications with any of these tags will not be managed by Maestro.

File Tree Setup

Here's an example of how to set up your project directory structure:

project_root/
│
├── applications/
│   ├── app1/
│   │   ├── docker-compose.yaml
│   │   ├── Makefile
│   │   └── ...
│   ├── app2/
│   │   ├── docker-compose.yaml
│   │   ├── Makefile
│   │   └── ...
│   └── app3/
│       ├── docker-compose.yaml
│       ├── Makefile
│       └── ...
│
└── maestro.yaml

In this structure:

  • project_root/: This is the root directory of your project.
  • applications/: This directory contains your Docker Compose applications.
    • app1/, app2/, app3/: Each subdirectory represents a Docker Compose application.
      • docker-compose.yaml: This file contains the Docker Compose configuration for each application.
      • Makefile: This file provides targets to manage Docker Compose services. It must contain a make up and make down target to Maestro to work properly.

Makefile

Each application directory must contain a Makefile with up and down targets to manage Docker Compose services. Here's an example of the Makefile content:

up:
    docker-compose up -d

down:
    docker-compose down

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maestro_compose-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maestro_compose-0.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file maestro_compose-0.2.0.tar.gz.

File metadata

  • Download URL: maestro_compose-0.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for maestro_compose-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d6e6d914931581c6a3b85f90084f9fc696e066a8e9b999e82d0a64540693627c
MD5 44a8fa66464eceb7e85304a5758d30f3
BLAKE2b-256 f3e6f149076ea5cc63dfd6f6efd12361743719cb789bc1d6c7dc0f108a83893f

See more details on using hashes here.

File details

Details for the file maestro_compose-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: maestro_compose-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for maestro_compose-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6628f591584a01357ce01ea406254cde0ccdff63ca07e074769db53c8aafca
MD5 7a794b11f90b2c146e9b60e8d4a9288f
BLAKE2b-256 bea9c128167804867eec7e30a74460f891aaeb905dc6edeb94a73ad0d89eb01c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page