Skip to main content

Otta

Otta is compose file inheretance helper

Rationale

For simple usecases builtin defaults of docker-compose are just fine. But systems do grow and the following problems are appearing:

  • shell commands are becoming longer
  • code duplication in compose files is getting worse
  • project root directory is getting bloated with compose files
  • complex compose configurations need up to date documentation

Example

Without Otta:

docker-compose -f base.yml -f local.yml -f mock_emails.yml -p local up

With Otta:

otta up

Otta file and otta directory

Otta directory:

otta
├── base.yml
├── local.yml
├── mock_mail_server.yml
├── prod_common.yml
├── prod_a.yml
├── prod_b.yml
└── otta.yml

Otta file:

files:
  - base.yml
  - local.yml
  - mock_mail_server.yml
  - prod_common.yml
  - prod_a.yml
  - prod_b.yml

default_recipe: local

recipes:
  local:
    project_name: local
    files:
      - base.yml
      - local.yml
    options:
      mockmail:
        files:
          - mock_mail_server.yml

  prod_a:
    files:
      - base.yml
      - prod_common.yml
      - prod_a.yml

  prod_b:
    project_name: production
    files:
      - base.yml
      - prod_common.yml
      - prod_b.yml

Explanation

Otta configuration is a directory with compose files and single otta file.

Otta files defines:

  • root property files that defines all the files that can be used in recipes
  • root property default_recipe that defines... well, default recipe
  • the most important property, recipes defines available recipes

Each recipe has

  • name, 1 to 40 symbols: letters, numbers and underscores
  • optional project_name, with identical restrictions
  • files, list of files defined in root property
  • options, optional definition of available options

Options have name (1 to 20 symbols, numbers letters and underscores) and files property.

CLI reference

Otta and it's variants determine recipe from OTTA_REC env variable.

Recipe specification is either just recipe (local), or recipe with options (local+mockmail)

OTTA_FILE is path to otta file, absolute or relative Setting OTTA_DEBUG to 1 makes the program print debug info

otta binary

otta call is equal to docker-compose -f base.yml -f local.yml -p local

skara binary

skara call is equal to docker stack deploy -c base.yml -c local.yml

project_name is ignored

kumla binary

kumla call is equal to kompose -f base.yml -f local.yml

Contributing

Please report all problems to GitLab

Pull requests are welcome

Download files

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

Source Distribution

otta-0.0.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

otta-0.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file otta-0.0.1.tar.gz.

File metadata

  • Download URL: otta-0.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for otta-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9850dcede1c0c0752982fa05d23ad03b93ff597b72fd65f0dd2ae58b5fab3a47
MD5 69a8bf7af0c75f900060aec6f27a8e76
BLAKE2b-256 28898641d5c49882c673c6be3d7cd56a1c0fd0afd457617160e6be2988a01f60

See more details on using hashes here.

File details

Details for the file otta-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: otta-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for otta-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7bf205792c6621b3969598a815e5a6d11c44e2e9abdce48de1e0adf0856a79c
MD5 42c5380f5716c66cc914e4a22933b0f7
BLAKE2b-256 7b7e8ee6f51292ceccda97cf58b7f8189f6b561bcb044cd1f05050e7160d4972

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