You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
This PR completely rewrites the docker compose deployment infrastructure
to address critical issues that prevented the validator deployment from
working correctly. The previous implementation had become unmaintainable
with hardcoded values, missing error handling, and no proper
documentation.
## Key Problems Fixed
### 🔧 Deployment Script Issues
- **Missing error handling**: Script would silently fail without proper
error reporting
- **Hardcoded configuration**: No way to customize deployments without
modifying the script
- **No documentation**: 89 lines of undocumented bash made
troubleshooting impossible
- **No validation**: Script didn't check for required dependencies or
validate inputs
- **Poor UX**: No help text, dry-run mode, or progress indicators
### 🐳 Docker Compose Infrastructure
- **Missing reverse proxy**: No proper HTTPS termination for external
access
- **Outdated dependencies**: ScyllaDB was using an older version (6.1.3
→ 6.2.1)
- **No certificate management**: Manual certificate handling instead of
automated Let's Encrypt
## What's New
### ✨ Complete Script Rewrite (`scripts/deploy-validator.sh`)
The deployment script has grown from 89 to 749 lines with proper
engineering:
- **Comprehensive documentation**: Full header docs with usage,
examples, and environment variables
- **Proper error handling**: `set -euo pipefail` and error recovery
paths
- **Configuration management**: All settings via environment variables
with sensible defaults
- **Command-line options**:
- `--help` for comprehensive documentation
- `--dry-run` to preview changes without execution
- `--verbose` for debugging
- `--skip-genesis` / `--force-genesis` for genesis management
- `--remote-image` to use pre-built images
- **Colored output**: Clear visual feedback with timestamps
- **Dependency checking**: Validates Docker, Docker Compose, Git, and
wget
- **State management**: Tracks deployment info for easier maintenance
- **Modular functions**: Clean separation of concerns with
single-responsibility functions
- **Interactive prompts**: User-friendly confirmations with
non-interactive fallbacks
- **Post-deployment guidance**: Shows useful commands after successful
deployment
### 🔒 HTTPS & Certificate Management (`docker/Caddyfile`)
Added Caddy as a reverse proxy for automatic HTTPS:
- **Automatic certificates**: Let's Encrypt integration with ACME
- **Security headers**: HSTS, X-Frame-Options, CSP headers
- **gRPC support**: Properly configured for Linera's gRPC traffic
- **Compression**: Automatic gzip for better performance
- **Logging**: Structured logs for debugging
### 🐳 Docker Compose Updates (`docker/docker-compose.yml`)
- **New web service**: Caddy container for reverse proxy
- **Updated ScyllaDB**: Version 6.1.3 → 6.2.1
- **Proper volumes**: Persistent storage for certificates and config
- **Service dependencies**: Ensures proper startup order
## Configuration Options
All configuration is now properly documented and configurable via
environment variables:
```bash
# Core settings
ACME_EMAIL # Let's Encrypt email (default: [email protected])
LINERA_IMAGE # Docker image override
GENESIS_URL # Genesis configuration override
PORT # Internal port (default: 19100)
METRICS_PORT # Metrics port (default: 21100)
NUM_SHARDS # Validator shards (default: 4)
```
## Usage Examples
```bash
# Standard deployment
./scripts/deploy-validator.sh validator.example.com
# Use remote image instead of building
./scripts/deploy-validator.sh validator.example.com --remote-image
# Custom configuration
[email protected] NUM_SHARDS=8 ./scripts/deploy-validator.sh validator.example.com
# Preview without making changes
./scripts/deploy-validator.sh validator.example.com --dry-run
```
## Testing
The deployment has been tested with the new infrastructure and is
working correctly. The script includes:
- Dry-run mode for safe testing
- Verbose mode for debugging
- Proper rollback on failures
- State tracking for recovery
## Breaking Changes
None - the script maintains backward compatibility while adding new
features.
## Next Steps
After deployment, operators can:
1. Monitor logs: `docker compose logs -f`
2. Check metrics: Access Grafana at port 3000
3. Verify health: Use the provided health check commands
4. Scale shards: Adjust NUM_SHARDS and redeploy
---
*Fixes the broken docker compose deployment that was preventing proper
validator setup. The old approach had become unmaintainable and needed
this comprehensive cleanup.*
0 commit comments