feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -7,6 +7,7 @@ namespace App\Framework\Discovery\Storage;
use App\Framework\Cache\Cache;
use App\Framework\Cache\CacheItem;
use App\Framework\Cache\CacheKey;
use App\Framework\Cache\CachePrefix;
use App\Framework\Core\Events\EventDispatcher;
use App\Framework\Core\ValueObjects\Byte;
use App\Framework\Core\ValueObjects\Duration;
@@ -23,7 +24,7 @@ use App\Framework\Discovery\ValueObjects\CacheMetrics;
use App\Framework\Discovery\ValueObjects\CacheTier;
use App\Framework\Discovery\ValueObjects\CompressionLevel;
use App\Framework\Discovery\ValueObjects\DiscoveryContext;
use App\Framework\Filesystem\FilePath;
use App\Framework\Filesystem\ValueObjects\FilePath;
use App\Framework\Filesystem\FileSystemService;
use App\Framework\Logging\Logger;
use App\Framework\Logging\ValueObjects\LogContext;
@@ -76,7 +77,8 @@ final class DiscoveryCacheManager
// Fallback to standard cache
$key = $this->buildCacheKey($context);
$item = $this->cache->get($key);
$result = $this->cache->get($key);
$item = $result->getItem($key);
if (! $item->isHit) {
$this->emitCacheMissEvent($key->toString(), 'not_found');
@@ -217,12 +219,11 @@ final class DiscoveryCacheManager
*/
public function clearAll(): bool
{
// This would ideally use cache tags, but for now we'll use pattern matching
// Clear only discovery-prefixed cache entries
$this->logger?->info('Clearing all discovery caches');
// Since we can't iterate cache keys, we'll just return true
// In a real implementation, you'd want cache tags support
return true;
$prefix = CachePrefix::fromString(self::CACHE_PREFIX);
return $this->cache->forget($prefix);
}
/**
@@ -378,7 +379,8 @@ final class DiscoveryCacheManager
// Try each tier in order of preference
foreach (CacheTier::orderedByPriority() as $tier) {
$key = $this->buildTieredCacheKey($context, $tier);
$item = $this->cache->get($key);
$result = $this->cache->get($key);
$item = $result->getItem($key);
if ($item->isHit) {
$data = $this->processRetrievedData($item->value);

View File

@@ -10,7 +10,7 @@ use App\Framework\Discovery\Results\AttributeRegistry;
use App\Framework\Discovery\Results\InterfaceRegistry;
use App\Framework\Discovery\Results\TemplateRegistry;
use App\Framework\Filesystem\Directory;
use App\Framework\Filesystem\FilePath;
use App\Framework\Filesystem\ValueObjects\FilePath;
use App\Framework\Filesystem\FileStorage;
/**
@@ -21,16 +21,17 @@ use App\Framework\Filesystem\FileStorage;
final readonly class DiscoveryStorageService
{
private Directory $storageDir;
private FileStorage $storage;
public function __construct(PathProvider $pathProvider)
{
$this->storage = new FileStorage($pathProvider->getBasePath());
$storagePath = $pathProvider->getBasePath() . '/storage/discovery';
$this->storageDir = new Directory($storagePath, $this->storage);
if (!$this->storageDir->exists()) {
if (! $this->storageDir->exists()) {
$this->storageDir->create();
}
}
@@ -111,12 +112,12 @@ final readonly class DiscoveryStorageService
{
$filePath = $this->getFilePath($type);
if (!$this->storage->exists($filePath->toString())) {
if (! $this->storage->exists($filePath->toString())) {
return null;
}
$metadata = $this->storage->getMetadata($filePath->toString());
return Timestamp::fromInt((int)$metadata->modifiedAt->format('U'));
}
@@ -161,7 +162,7 @@ final readonly class DiscoveryStorageService
{
$filePath = $this->getFilePath($type);
if (!$this->storage->exists($filePath->toString())) {
if (! $this->storage->exists($filePath->toString())) {
return null;
}

View File

@@ -7,9 +7,9 @@ namespace App\Framework\Discovery\Storage;
use App\Framework\Async\FiberManager;
use App\Framework\Filesystem\Directory;
use App\Framework\Filesystem\File;
use App\Framework\Filesystem\FileMetadata;
use App\Framework\Filesystem\PermissionChecker;
use App\Framework\Filesystem\Storage;
use App\Framework\Filesystem\ValueObjects\FileMetadata;
use SplFileInfo;
/**