feat: runtime manager

This commit is contained in:
Ilia Denisov
2026-04-28 20:39:18 +02:00
committed by GitHub
parent e0a99b346b
commit a7cee15115
289 changed files with 45660 additions and 2207 deletions
+55
View File
@@ -127,6 +127,39 @@ type LobbyRaceNameRegistrationDeniedPayload struct {
Reason string `json:"reason"`
}
// RuntimeImagePullFailedPayload stores the normalized payload for
// `runtime.image_pull_failed`. AttemptedAtMs carries Unix milliseconds in
// UTC of the failed pull attempt.
type RuntimeImagePullFailedPayload struct {
GameID string `json:"game_id"`
ImageRef string `json:"image_ref"`
ErrorCode string `json:"error_code"`
ErrorMessage string `json:"error_message"`
AttemptedAtMs int64 `json:"attempted_at_ms"`
}
// RuntimeContainerStartFailedPayload stores the normalized payload for
// `runtime.container_start_failed`. AttemptedAtMs carries Unix milliseconds
// in UTC of the failed start attempt.
type RuntimeContainerStartFailedPayload struct {
GameID string `json:"game_id"`
ImageRef string `json:"image_ref"`
ErrorCode string `json:"error_code"`
ErrorMessage string `json:"error_message"`
AttemptedAtMs int64 `json:"attempted_at_ms"`
}
// RuntimeStartConfigInvalidPayload stores the normalized payload for
// `runtime.start_config_invalid`. AttemptedAtMs carries Unix milliseconds
// in UTC of the rejected start attempt.
type RuntimeStartConfigInvalidPayload struct {
GameID string `json:"game_id"`
ImageRef string `json:"image_ref"`
ErrorCode string `json:"error_code"`
ErrorMessage string `json:"error_message"`
AttemptedAtMs int64 `json:"attempted_at_ms"`
}
// NewGeoReviewRecommendedIntent builds the admin-email intent published by Geo
// Profile Service when a user becomes review-worthy.
func NewGeoReviewRecommendedIntent(metadata Metadata, payload GeoReviewRecommendedPayload) (Intent, error) {
@@ -226,3 +259,25 @@ func NewLobbyRaceNameRegisteredIntent(metadata Metadata, recipientUserID string,
func NewLobbyRaceNameRegistrationDeniedIntent(metadata Metadata, recipientUserID string, payload LobbyRaceNameRegistrationDeniedPayload) (Intent, error) {
return newIntent(NotificationTypeLobbyRaceNameRegistrationDenied, ProducerGameLobby, AudienceKindUser, []string{recipientUserID}, metadata, payload)
}
// NewRuntimeImagePullFailedIntent builds the administrator-email intent
// published by Runtime Manager when a start operation fails because the
// engine image cannot be pulled.
func NewRuntimeImagePullFailedIntent(metadata Metadata, payload RuntimeImagePullFailedPayload) (Intent, error) {
return newIntent(NotificationTypeRuntimeImagePullFailed, ProducerRuntimeManager, AudienceKindAdminEmail, nil, metadata, payload)
}
// NewRuntimeContainerStartFailedIntent builds the administrator-email
// intent published by Runtime Manager when a start operation fails because
// `docker create` or `docker start` returns an error.
func NewRuntimeContainerStartFailedIntent(metadata Metadata, payload RuntimeContainerStartFailedPayload) (Intent, error) {
return newIntent(NotificationTypeRuntimeContainerStartFailed, ProducerRuntimeManager, AudienceKindAdminEmail, nil, metadata, payload)
}
// NewRuntimeStartConfigInvalidIntent builds the administrator-email intent
// published by Runtime Manager when start configuration validation rejects
// the request (invalid image reference, missing Docker network, unwritable
// state directory).
func NewRuntimeStartConfigInvalidIntent(metadata Metadata, payload RuntimeStartConfigInvalidPayload) (Intent, error) {
return newIntent(NotificationTypeRuntimeStartConfigInvalid, ProducerRuntimeManager, AudienceKindAdminEmail, nil, metadata, payload)
}