Skip to main content

Deployment configuration tool for Octopize Avatar platform

Project description

Octopize Avatar Deployment Tool

Automated configuration tool for deploying Octopize Avatar platform using Docker Compose.

Overview

This tool simplifies Avatar deployment by:

  • ๐Ÿ“ฆ Standalone package - No need to clone the entire repository
  • โฌ‡๏ธ Downloads templates automatically from GitHub
  • ๐ŸŽฏ Deployment presets - dev-mode, production, airgapped configurations
  • ๐Ÿ” Secure secrets generation - Automatic creation of encryption keys
  • โœ… Stateless by design - Minimal bundled dependencies
  • ๐Ÿ”„ Resumable configuration - State management for interrupted setups

Architecture

What's Bundled vs Downloaded

Bundled in PyPI Package:

  • configure.py - Main configuration logic
  • state_manager.py - State management for resuming
  • download_templates.py - Template downloader
  • defaults.yaml - Default values and presets

Downloaded from GitHub (on-demand):

  • .env.template - Environment configuration template
  • nginx.conf.template - Nginx configuration template
  • docker-compose.yml - Docker services definition
  • .template-version - Template version information
  • Other deployment files

These templates are located in docker/templates/ in the avatar-deployment repository.

This design means you can install and run the tool without cloning the repository!

Quick Start

Option 1: Using uvx (Recommended - After PyPI Publication)

uvx octopize-avatar-deploy --output-dir /app/avatar

Option 2: Using pip

pip install octopize-avatar-deploy
octopize-avatar-deploy --output-dir /app/avatar

Option 3: From Source with uv

# Sparse clone (only deployment-tool directory)
git clone --depth 1 --filter=blob:none --sparse https://github.com/octopize/avatar-deployment
cd avatar-deployment
git sparse-checkout set deployment-tool

# Run with uv
cd deployment-tool
uv run configure.py --output-dir /app/avatar

Deployment Presets

Choose a preset to quickly configure for your environment:

default - Production Configuration

  • Console logging: disabled (use structured logs)
  • Sentry monitoring: enabled
  • Telemetry: enabled
  • Best for: Production deployments with monitoring

dev-mode - Development Configuration

  • Console logging: enabled (see logs in terminal)
  • Sentry monitoring: disabled
  • Telemetry: disabled
  • Best for: Local development and testing

airgapped - Air-Gapped Deployment

  • Console logging: disabled
  • Sentry monitoring: disabled (no external connections)
  • Telemetry: disabled (no external connections)
  • Best for: Secure, isolated environments

custom - Manual Configuration

  • Configure all options interactively
  • Best for: Specific requirements

Usage

Interactive Mode with Preset

octopize-avatar-deploy --output-dir /app/avatar --preset dev-mode

The tool will:

  1. Download latest templates from GitHub
  2. Apply preset configuration
  3. Prompt for required values (PUBLIC_URL, ENV_NAME)
  4. Generate configuration files

Non-Interactive Mode

# Create config file
cat > my-config.yaml << EOF
PUBLIC_URL: avatar.mycompany.com
ENV_NAME: mycompany-prod
AVATAR_API_VERSION: 2.20.1
AVATAR_WEB_VERSION: 0.40.0
MAIL_PROVIDER: smtp
SMTP_HOST: mail.mycompany.com
EOF

# Run with config
octopize-avatar-deploy \
  --config my-config.yaml \
  --preset default \
  --non-interactive \
  --output-dir /app/avatar

Advanced Options

octopize-avatar-deploy \
  --output-dir /app/avatar \
  --preset dev-mode \
  --download-branch main \          # Git branch to download from
  --skip-download \                 # Use cached templates
  --save-config \                   # Save config to deployment-config.yaml
  --verbose                         # Show detailed progress

Command Line Options

--output-dir DIR           Output directory (default: current directory)
--preset NAME              Use preset: default, dev-mode, airgapped
--config FILE              YAML configuration file
--non-interactive          Non-interactive mode (use config/defaults)
--auth-type TYPE           Authentication: email or username (default: email)
--save-config              Save config to deployment-config.yaml
--download-branch BRANCH   Git branch for templates (default: main)
--skip-download            Use cached templates
--verbose                  Detailed output

What Gets Generated

After running the tool, you'll have:

/app/avatar/
โ”œโ”€โ”€ .env                      # Environment configuration
โ”œโ”€โ”€ nginx.conf                # Nginx reverse proxy config
โ”œโ”€โ”€ .secrets/                 # Generated secrets (gitignored)
โ”‚   โ”œโ”€โ”€ db_password
โ”‚   โ”œโ”€โ”€ authentik_secret_key
โ”‚   โ”œโ”€โ”€ avatar_api_encryption_key
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ docker-compose.yml        # Downloaded from GitHub
โ””โ”€โ”€ .avatar-templates/        # Cached templates (auto-downloaded)
    โ”œโ”€โ”€ .env.template
    โ”œโ”€โ”€ nginx.conf.template
    โ”œโ”€โ”€ docker-compose.yml
    โ””โ”€โ”€ .template-version

Configuration Presets in Detail

Presets are defined in defaults.yaml:

presets:
  default:
    description: "Production-ready with telemetry and monitoring"
    application:
      use_console_logging: "false"
      sentry_enabled: "true"
    telemetry:
      enabled: true
  
  dev-mode:
    description: "Development with console logging"
    application:
      use_console_logging: "true"
      sentry_enabled: "false"
    telemetry:
      enabled: false
  
  airgapped:
    description: "No external monitoring/telemetry"
    application:
      use_console_logging: "false"
      sentry_enabled: "false"
    telemetry:
      enabled: false

You can override preset values during interactive configuration.

Template Download Mechanism

Templates are downloaded from GitHub on first run:

  1. Check cache - .avatar-templates/ directory
  2. Download if needed - From github.com/octopize/avatar-deployment
  3. Use cached - On subsequent runs (unless --skip-download is used)

This ensures:

  • โœ… Always get latest templates (from specified branch)
  • โœ… Offline support (once cached)
  • โœ… No repository cloning required
  • โœ… Minimal package size

State Management

The tool saves progress to .deployment-state.yaml allowing you to:

  • Resume interrupted configurations
  • Track which steps completed
  • Avoid re-entering values

Steps:

  1. Collect required config
  2. Collect optional config
  3. Generate .env file
  4. Generate nginx.conf
  5. Generate secrets
  6. Prompt for user secrets (optional)
  7. Finalize
# If interrupted, just run again:
octopize-avatar-deploy --output-dir /app/avatar

# Tool will ask: "Continue from where you left off? [Y/n]"

Troubleshooting

Templates not downloading

# Force re-download
rm -rf .avatar-templates/
octopize-avatar-deploy --output-dir /app/avatar --verbose

Use specific Git branch

# Download from development branch
octopize-avatar-deploy \
  --output-dir /app/avatar \
  --download-branch develop \
  --verbose

Offline mode

# Download templates once
octopize-avatar-deploy --output-dir /app/avatar

# Then use cached versions
octopize-avatar-deploy --output-dir /app/avatar --skip-download

Development

Project Structure

deployment-tool/
โ”œโ”€โ”€ configure.py           # Main script (bundled)
โ”œโ”€โ”€ state_manager.py       # State management (bundled)
โ”œโ”€โ”€ download_templates.py  # Template downloader (bundled)
โ”œโ”€โ”€ defaults.yaml          # Defaults and presets (bundled)
โ”œโ”€โ”€ tests/                 # Test suite
โ”œโ”€โ”€ README.md             
โ””โ”€โ”€ pyproject.toml         # Package configuration

Running Tests

cd deployment-tool
pytest tests/

Building Package

pip install build
python -m build

Related Documentation

Support

For issues and questions:

License

Apache License v2.0

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

octopize_deploy_tool-0.1.0.tar.gz (132.9 kB view details)

Uploaded Source

Built Distribution

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

octopize_deploy_tool-0.1.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file octopize_deploy_tool-0.1.0.tar.gz.

File metadata

  • Download URL: octopize_deploy_tool-0.1.0.tar.gz
  • Upload date:
  • Size: 132.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for octopize_deploy_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 814d7a2525f8ae7d69ae8016b01b5d596a4200f2ad51314b4d8732e6bdda7b60
MD5 7c396a27f6adc05a6f24c515b7a7d7f9
BLAKE2b-256 2480a075a80eb119d32b447a0089bc94d1f2af717767bbd85503315b0c7c49e6

See more details on using hashes here.

File details

Details for the file octopize_deploy_tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: octopize_deploy_tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for octopize_deploy_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ceb720a51962a925f94e07ef8b1721b530894ba08fe5d6a6afa5bec8842e2f91
MD5 26647f0fd9fd5cc09dd048df344ac793
BLAKE2b-256 c70854d3938bba90d18131a184d8442e77704c6fe75ab4c663ed5e634e805343

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