How gitlabhq/gitlab-runner works
Main Components
a. Core Components:
• Runner Service (main coordinator)
• Executors Layer
• Network Communication Layer
• Cache System
• Session Management
• Shell Execution Layer
b. Executor Types (show as parallel components):
• Docker
• Kubernetes
• Shell
• SSH
• VirtualBox
• Parallels
• Custom
• Instance
• Docker Machine (autoscaling)
c. Supporting Systems:
• Secret Management (Vault, Azure Key Vault, GCP Secret Manager, etc.)
• Logging System
• Metrics & Monitoring
• Configuration Management
Component Relationships
a. Primary Flow:
GitLab Server <-> Network Layer <-> Runner Service <-> Executor Layer <-> Job Execution
b. Secondary Flows:
• Cache System interactions with various cloud providers (S3, GCS, Azure)
• Secret resolution flow through different providers
• Session proxy for interactive terminals
• Helper container interactions for Docker/Kubernetes executors
Detailed Component Breakdown
a. Runner Service:
• Configuration Management
• Job Coordination
• Build Management
• Cache Coordination
• Security & Authentication
b. Executor Layer:
• Abstract Executor Interface
• Executor-specific Implementations
• Build Steps Management
• Shell Command Generation
• Container Management (for container-based executors)
c. Network Layer:
• API Client
• Job Status Updates
• Artifact Transfer
• Cache Transfer
• Rate Limiting
Implementation Details
a. Key Technologies (include as annotations):
• Go (primary language)
• gRPC (for helper communication)
• Docker API
• Kubernetes API
• Cloud Provider SDKs
b. Configuration Elements:
• config.toml settings
• Environment variables
• Feature flags
• Runtime configuration
Operational Aspects
a. Monitoring Points:
• Prometheus metrics
• Logging endpoints
• Health checks
• Performance monitoring
b. Management Interfaces:
• CLI commands
• API endpoints
• Status reporting