|
| 1 | +"""Closed-vocabulary constants for CloudOpsBench scoring and prediction. |
| 2 | +
|
| 3 | +Package-level module (not under ``predictor/``) so ``taxonomy`` and |
| 4 | +``scoring`` can import fault-object lists without loading |
| 5 | +``predictor/__init__.py``. The predictor subpackage re-exports these |
| 6 | +from ``predictor.vocabulary`` for backward compatibility. |
| 7 | +""" |
| 8 | + |
| 9 | +from __future__ import annotations |
| 10 | + |
| 11 | +# Declaring ``__all__`` tells CodeQL that these names are the module's |
| 12 | +# public surface — they are not "unused globals" but intentional |
| 13 | +# re-exports consumed by ``taxonomy``, ``scoring``, and |
| 14 | +# ``predictor.vocabulary`` (which re-exports them for legacy callers). |
| 15 | +__all__ = [ |
| 16 | + "_FAULT_OBJECT_NAMESPACES", |
| 17 | + "_FAULT_OBJECT_NODES", |
| 18 | + "_FAULT_OBJECT_SERVICES", |
| 19 | + "_ROOT_CAUSES", |
| 20 | + "_TAXONOMY_CATEGORIES", |
| 21 | +] |
| 22 | + |
| 23 | +_TAXONOMY_CATEGORIES: tuple[str, ...] = ( |
| 24 | + "Admission_Fault", |
| 25 | + "Scheduling_Fault", |
| 26 | + "Infrastructure_Fault", |
| 27 | + "Startup_Fault", |
| 28 | + "Runtime_Fault", |
| 29 | + "Service_Routing_Fault", |
| 30 | + "Performance_Fault", |
| 31 | +) |
| 32 | + |
| 33 | +_ROOT_CAUSES: tuple[str, ...] = ( |
| 34 | + # Scheduling |
| 35 | + "missing_service_account", |
| 36 | + "node_cordon_mismatch", |
| 37 | + "node_affinity_mismatch", |
| 38 | + "node_selector_mismatch", |
| 39 | + "pod_anti_affinity_conflict", |
| 40 | + "taint_toleration_mismatch", |
| 41 | + "cpu_capacity_mismatch", |
| 42 | + "memory_capacity_mismatch", |
| 43 | + # Infrastructure |
| 44 | + "node_network_delay", |
| 45 | + "node_network_packet_loss", |
| 46 | + "containerd_unavailable", |
| 47 | + "kubelet_unavailable", |
| 48 | + "kube_proxy_unavailable", |
| 49 | + "kube_scheduler_unavailable", |
| 50 | + # Startup |
| 51 | + "image_registry_dns_failure", |
| 52 | + "incorrect_image_reference", |
| 53 | + "missing_image_pull_secret", |
| 54 | + "pvc_selector_mismatch", |
| 55 | + "pvc_storage_class_mismatch", |
| 56 | + "pvc_access_mode_mismatch", |
| 57 | + "pvc_capacity_mismatch", |
| 58 | + "pv_binding_occupied", |
| 59 | + "volume_mount_permission_denied", |
| 60 | + # Runtime |
| 61 | + "oom_killed", |
| 62 | + "liveness_probe_incorrect_protocol", |
| 63 | + "liveness_probe_incorrect_port", |
| 64 | + "liveness_probe_incorrect_timing", |
| 65 | + "readiness_probe_incorrect_protocol", |
| 66 | + "readiness_probe_incorrect_port", |
| 67 | + "mysql_invalid_credentials", |
| 68 | + "mysql_invalid_port", |
| 69 | + "missing_secret_binding", |
| 70 | + "db_connection_exhaustion", |
| 71 | + "db_readonly_mode", |
| 72 | + "gateway_misrouted", |
| 73 | + "deployment_zero_replicas", |
| 74 | + # Service routing |
| 75 | + "service_selector_mismatch", |
| 76 | + "service_port_mapping_mismatch", |
| 77 | + "service_protocol_mismatch", |
| 78 | + "service_env_var_address_mismatch", |
| 79 | + "service_sidecar_port_conflict", |
| 80 | + "service_dns_resolution_failure", |
| 81 | + # Performance |
| 82 | + "pod_network_delay", |
| 83 | + "pod_cpu_overload", |
| 84 | + # Admission |
| 85 | + "namespace_cpu_quota_exceeded", |
| 86 | + "namespace_memory_quota_exceeded", |
| 87 | + "namespace_pod_quota_exceeded", |
| 88 | + "namespace_service_quota_exceeded", |
| 89 | + "namespace_storage_quota_exceeded", |
| 90 | +) |
| 91 | + |
| 92 | +_FAULT_OBJECT_SERVICES: tuple[str, ...] = ( |
| 93 | + # online-boutique |
| 94 | + "adservice", |
| 95 | + "cartservice", |
| 96 | + "checkoutservice", |
| 97 | + "currencyservice", |
| 98 | + "emailservice", |
| 99 | + "frontend", |
| 100 | + "paymentservice", |
| 101 | + "productcatalogservice", |
| 102 | + "recommendationservice", |
| 103 | + "redis-cart", |
| 104 | + "shippingservice", |
| 105 | + # train-ticket |
| 106 | + "ts-gateway-service", |
| 107 | + "ts-order-service", |
| 108 | + "ts-payment-service", |
| 109 | + "ts-travel-service", |
| 110 | + "ts-user-service", |
| 111 | + "ts-auth-service", |
| 112 | + "ts-route-service", |
| 113 | + "ts-ticket-office-service", |
| 114 | + "ts-assurance-service", |
| 115 | + "ts-basic-service", |
| 116 | + "ts-cancel-service", |
| 117 | + "ts-config-service", |
| 118 | + "ts-consign-service", |
| 119 | + "ts-contacts-service", |
| 120 | + "ts-delivery-service", |
| 121 | + "ts-food-delivery-service", |
| 122 | + "ts-food-service", |
| 123 | + "ts-inside-payment-service", |
| 124 | + "ts-notification-service", |
| 125 | + "ts-order-other-service", |
| 126 | + "ts-preserve-service", |
| 127 | + "ts-price-service", |
| 128 | + "ts-seat-service", |
| 129 | + "ts-security-service", |
| 130 | + "ts-station-food-service", |
| 131 | + "ts-station-service", |
| 132 | + "ts-train-food-service", |
| 133 | + "ts-train-service", |
| 134 | + "ts-travel2-service", |
| 135 | + "ts-voucher-service", |
| 136 | + "ts-wait-order-service", |
| 137 | + "tsdb-mysql", |
| 138 | +) |
| 139 | + |
| 140 | +_FAULT_OBJECT_NODES: tuple[str, ...] = ("master", "worker-01", "worker-02", "worker-03") |
| 141 | +_FAULT_OBJECT_NAMESPACES: tuple[str, ...] = ("boutique", "train-ticket") |
0 commit comments