Do Interactive Git deploY - Deploy Python applications from Git repositories in isolated environments with interactive menu
Project description
DIGY - Do Interactive Git deploY
Docker Configuration
DIGY supports running projects in isolated Docker containers with RAM-based storage for maximum performance. This ensures that:
- Projects run in complete isolation
- No local filesystem changes are made
- Resources are cleaned up automatically
- Execution is as fast as possible using RAM storage
Configuration
DIGY uses a manifest file (digy/manifest.yml) to configure Docker settings. You can override these settings either:
- In the manifest file
- Using environment variables
- Through command-line arguments
Volume Types
DIGY supports two types of volumes:
-
RAM Volumes
- Stored in RAM for maximum speed
- Automatically cleaned up after use
- Size configurable in GB
- Example:
/tmp/digy_ram
-
Local Volumes
- Mount local directories into containers
- Can be read-only or read-write
- Useful for:
- Persistent data storage
- Local development
- Configuration files
Usage Examples
- Basic Usage
# Run a repository from GitHub
digy run github.com/pyfunc/digy
# Run with 4GB RAM
digy run --ram-size 4 github.com/pyfunc/digy
- Local File Mount
# Mount local directory into container
digy run --mount ./data:/app/data:ro github.com/pyfunc/digy
- Custom Docker Configuration
# Build and run with custom Dockerfile
digy build -f Dockerfile .
digy run --image myapp:latest github.com/pyfunc/digy
# Or in one command
digy run --build -f Dockerfile github.com/pyfunc/digy
Performance Tips
-
RAM Size
- Default: 2GB (
--ram-size 2) - Adjust based on project needs
- Example:
digy run --ram-size 4 github.com/user/repo
- Default: 2GB (
-
Volume Mounts
- Read-only mount:
--mount ./config:/app/config:ro - Read-write mount:
--mount ./data:/app/data:rw - RAM disk:
--ram-disk /cache
- Read-only mount:
-
Cleanup
- Automatic cleanup:
--cleanup - Remove all data:
digy clean --all - List resources:
digy ls
- Automatic cleanup:
Environment Configuration
DIGY supports configuration through environment variables. You can create a .env file in your project root based on the example:
# Initialize with default configuration
digy init
Key environment variables:
DIGY_RAM_SIZE: RAM disk size in GB (default: 1)DIGY_RAM_PATH: RAM disk mount path (default: /tmp/digy_ram)DIGY_DOCKER_IMAGE: Default Docker image (default: python:3.12-slim)DIGY_LOCAL_VOLUMES: Local volume mounts (format: host:container:mode)DIGY_RAM_VOLUMES: RAM volume mountsDIGY_ENV_VARS: Default environment variablesDIGY_AUTO_CLEANUP: Automatic cleanup after execution (true/false)DIGY_LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR)
Example .env file:
DIGY_RAM_SIZE=2
DIGY_DOCKER_IMAGE=python:3.12-slim
DIGY_LOCAL_VOLUMES=/app:/app:rw
DIGY_LOG_LEVEL=INFO
Security
- All execution happens in isolated containers
- No changes are made to the host system
- RAM volumes are ephemeral
- Local mounts can be made read-only
- Environment variables can be configured per project
Troubleshooting
-
Not enough RAM
- Increase RAM size in manifest
- Use
--ram-sizeflag - Monitor container memory usage
-
Volume permissions
- Check Docker volume permissions
- Use
--userflag to match UID - Verify mount points are accessible
-
Resource cleanup
- Use
--cleanupflag - Check Docker volume usage
- Monitor RAM disk usage
- Use
Basic Usage
DIGY is a tool for deploying Python applications from Git repositories in isolated environments with interactive menu support.
Features
- Load repositories from Git
- Run Python applications in isolated environments
- Interactive menu for easy navigation
- RAM-based storage for maximum speed
- Docker container isolation
- Local volume support
- Automatic cleanup
Installation
# Install globally
pip install digy
# Or use Poetry
poetry install
DIGY to narzędzie do deploymentu aplikacji Python z repozytoriów Git w izolowanych środowiskach z interaktywnym menu nawigacyjnym.
🎯 Akronim DIGY
DIGY = Dynamic Interactive Git deploY
- Dynamic - Dynamiczne ładowanie repozytoriów
- Interactive - Interaktywne menu z nawigacją strzałkami
- Git - Integracja z repozytoriami Git
- deploY - Deployment w izolowanych środowiskach
🚀 Funkcjonalności
- ⚡ Szybkie ładowanie - Pobieranie repozytoriów bezpośrednio do pamięci RAM (100MB bazowo)
- 🔒 Izolowane środowiska - Automatyczne tworzenie virtual environment
- 🎮 Interaktywne menu - Nawigacja strzałkami z pomocą
- 🐍 Uruchamianie kodu - Wykonywanie plików Python z wyświetlaniem wyników
- 📊 Zarządzanie pamięcią - Monitoring i kontrola użycia RAM
- 🔍 Inspekcja kodu - Przeglądanie plików z podświetlaniem składni
📦 Instalacja
# Instalacja z pip (gdy będzie dostępne)
pip install digy
# Lub instalacja z źródeł
git clone https://github.com/pyfunc/digy
cd digy
poetry install
🎯 Użycie
Podstawowe użycie
from digy import digy
# Załaduj repozytorium i uruchom interaktywne menu
digy.local('github.com/pyfunc/free-on-pypi')
Wiersz poleceń
# Uruchomienie w środowisku lokalnym
digy local github.com/pyfunc/free-on-pypi
# Uruchomienie w pamięci RAM (najszybsze)
digy ram github.com/pyfunc/free-on-pypi
# Uruchomienie w kontenerze Docker
digy docker github.com/pyfunc/free-on-pypi
# Dodatkowe opcje
# Z określoną gałęzią
digy local github.com/user/repo --branch develop
# Szybkie uruchomienie konkretnego pliku
digy ram github.com/pyfunc/free-on-pypi pypi.py --args "from_file"
# Status i informacje
digy status
digy info
📋 Interaktywne Menu
Po załadowaniu repozytorium DIGY wyświetli interaktywne menu z opcjami:
📋 Show Repository Info - Informacje o repozytorium
📖 View README - Wyświetl plik README
🔧 Setup Environment - Skonfiguruj środowisko
📁 List Python Files - Lista plików Python
🚀 Run Python File - Uruchom plik Python
🔍 Inspect File - Zbadaj zawartość pliku
💻 Interactive Shell - Interaktywna powłoka Python
🧹 Cleanup & Exit - Wyczyść i wyjdź
Nawigacja
- ↑/↓ lub j/k - Poruszanie się po menu
- Enter - Wybór opcji
- 1-8 - Bezpośredni wybór numerem
- q - Wyjście
🔧 Przykład użycia z repozytorium free-on-pypi
from digy import digy
# Załaduj repozytorium lokalnie
digy.local('github.com/pyfunc/free-on-pypi')
# Lub w pamięci RAM
digy.ram('github.com/pyfunc/free-on-pypi')
# Albo w Dockerze
digy.docker('github.com/pyfunc/free-on-pypi')
Po załadowaniu zobaczysz menu z opcjami uruchomienia:
pypi.py from_file- Sprawdzenie nazw z plikupypi.py generator- Generator kombinacji nazwgithub.py from_file- Sprawdzenie nazw na GitHub
Każde uruchomienie pokaże:
- Pełne wyjście konsoli
- Błędy (jeśli wystąpią)
- Pytanie o uruchomienie kolejnej komendy
🎮 Funkcje interaktywne
Uruchamianie plików Python
- Wybór pliku z listy
- Podanie argumentów
- Wyświetlenie pełnego wyjścia
- Monitoring czasu wykonania
Inspekcja kodu
- Podświetlanie składni
- Informacje o pliku (linie, rozmiar)
- Lista importów
- Wykrywanie bloku
if __name__ == "__main__"
Zarządzanie środowiskiem
- Automatyczne tworzenie virtual environment
- Instalacja requirements.txt
- Instalacja pakietu w trybie deweloperskim
- Monitoring pamięci RAM
🔧 Konfiguracja
Zmienne środowiskowe
export DIGY_MEMORY_BASE=100 # Bazowa alokacja pamięci w MB
export DIGY_TIMEOUT=300 # Timeout wykonania w sekundach
Programowa konfiguracja
from digy.loader import memory_manager
# Zmień bazową alokację pamięci
memory_manager.base_size_mb = 200
# Sprawdź dostępną pamięć
available = memory_manager.check_available_memory()
print(f"Dostępne: {available} MB")
📝 API Reference
digy(repo_url, branch='main')
Główna funkcja ładująca repozytorium i uruchamiająca interaktywne menu.
Parametry:
repo_url(str): URL repozytorium (github.com/user/repo lub pełny URL)branch(str): Gałąź do pobrania (domyślnie 'main')
Zwraca:
str | None: Ścieżka do lokalnego repozytorium lub None przy błędzie
Klasa Deployer
Zarządza deploymentem aplikacji w izolowanych środowiskach.
Klasa InteractiveMenu
Zapewnia interaktywne menu z nawigacją strzałkami.
Klasa MemoryManager
Zarządza alokacją pamięci dla załadowanych repozytoriów.
🔍 Przykłady zaawansowane
Niestandardowa ścieżka
from digy.loader import GitLoader
from digy.deployer import Deployer
loader = GitLoader("/custom/path")
local_path = loader.download_repo("github.com/user/repo")
deployer = Deployer(local_path)
Programowe uruchamianie
from digy import digy
# Uruchomienie z kodu Pythona
# Lokalnie
result = digy.local('github.com/user/repo', 'script.py', ['arg1', 'arg2'])
# W pamięci RAM
result = digy.ram('github.com/user/repo', 'script.py', ['arg1', 'arg2'])
# W Dockerze
result = digy.docker('github.com/user/repo', 'script.py', ['arg1', 'arg2'])
# Wynik zawiera (success, stdout, stderr)
print(f"Sukces: {result[0]}")
print(f"Wyjście: {result[1]}")
if result[2]:
print(f"Błędy: {result[2]}")
🛠️ Rozwój
Wymagania deweloperskie
- Python 3.8+
- Poetry
- Git
Instalacja deweloperska
git clone https://github.com/pyfunc/digy
cd digy
poetry install
poetry run pytest
Struktura projektu
digy/
├── digy/
│ ├── __init__.py # Główny moduł
│ ├── loader.py # Ładowanie repozytoriów
│ ├── deployer.py # Deployment i uruchamianie
│ ├── interactive.py # Interaktywne menu
│ ├── cli.py # Interface wiersza poleceń
│ └── version.py # Informacje o wersji
├── tests/ # Testy
├── pyproject.toml # Konfiguracja Poetry
└── README.md # Dokumentacja
📄 Licencja
Apache Software License - Zobacz plik LICENSE dla szczegółów.
🤝 Wkład
Zapraszamy do współpracy! Prosimy o:
- Forkowanie repozytorium
- Tworzenie feature branch
- Commit zmian
- Push do branch
- Tworzenie Pull Request
📞 Wsparcie
- Issues: https://github.com/pyfunc/digy/issues
- Email: info@softreck.dev
- Dokumentacja: https://github.com/pyfunc/digy
DIGY - Twój interaktywny asystent do deploymentu aplikacji Python! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file digy-0.1.8.tar.gz.
File metadata
- Download URL: digy-0.1.8.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.14.11-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7378a2ae6453e07685b433ebd17f6ec1a4222f3fdaaae6b97418857daecaf1c
|
|
| MD5 |
1fcf425cfec0e9c3582e98eb085edfe0
|
|
| BLAKE2b-256 |
9402357f1e12d1558091f1094decd41b17c3bd1b0efbb7af5a0a1f156e2097ee
|
File details
Details for the file digy-0.1.8-py3-none-any.whl.
File metadata
- Download URL: digy-0.1.8-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.14.11-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bd90e42222e2dc75c2290ba36f50f045951bf010f4292059387871d181b0c50
|
|
| MD5 |
4c244ad2c0662ace44183fef781f3c02
|
|
| BLAKE2b-256 |
5d11f0dae61cc82b5ce3154be644427db0703c269b5c543e1240a5dcad2690b0
|