Skip to content

Commit 5dc6f28

Browse files
AWS AI Rule: aws.sagemaker.domain.idle (#176)
1 parent 35cc09e commit 5dc6f28

17 files changed

Lines changed: 2103 additions & 32 deletions

File tree

README.fr.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Gaspillage minimum estimé : ~$25 944/mois
100100
- Détecte le gaspillage IA/ML coûteux : SageMaker, AML, Vertex AI — ressources GPU signalées comme candidats à risque plus élevé (500–23 000 $/mois)
101101
- Fonctionne sur AWS, Azure et GCP en un seul outil
102102
- S'exécute entièrement dans votre environnement — aucun agent, pas de SaaS, aucun credential stocké
103-
- 46 règles de détection sélectives et haut signal, conçues pour éviter les faux positifs en environnements IaC
103+
- 47 règles de détection sélectives et haut signal, conçues pour éviter les faux positifs en environnements IaC
104104
- Prêt pour CI/CD — codes de sortie d'application + sorties JSON/CSV/markdown
105105

106106
### Ce que CleanCloud ne fait PAS
@@ -151,6 +151,7 @@ L'infrastructure IA/ML inactive est la source de gaspillage cloud invisible à l
151151
| Endpoint SageMaker (GPU) | 500 – 23 000 $ / mois |
152152
| Instance Notebook SageMaker (GPU) | 500 – 23 000+ $ / mois |
153153
| Studio Apps SageMaker (KernelGateway/JupyterLab/CodeEditor) | 42 – 1 600+ $ / mois |
154+
| Domaine SageMaker (stockage EFS inactif) | Charges EFS continues |
154155
| Training Job SageMaker (job GPU runaway/bloqué) | 670 – 2 360+ $ / jour |
155156
| Cluster AML Compute Azure (GPU) | 600 – 15 000 $ / mois |
156157
| Instance de calcul Azure ML (GPU) | 600 – 15 000+ $ / mois |
@@ -165,7 +166,7 @@ L'infrastructure IA/ML inactive est la source de gaspillage cloud invisible à l
165166
CleanCloud détecte les endpoints à zéro invocation / zéro prédiction, l'activité de contrôle inactive sur les notebooks et apps managés, ainsi que les training jobs managés anormalement longs sur les 3 clouds. Les outils natifs montrent la facture — ils ne nomment pas la ressource concrète à examiner.
166167

167168
```bash
168-
cleancloud scan --provider aws --category ai # PTUs Bedrock + endpoints + notebooks + Studio apps SageMaker + training jobs SageMaker + EC2 GPU
169+
cleancloud scan --provider aws --category ai # PTUs Bedrock + endpoints + notebooks + domaines + Studio apps SageMaker + training jobs SageMaker + EC2 GPU
169170
cleancloud scan --provider azure --category ai # clusters AML + instances ML + endpoints en ligne + AI Search + PTUs OpenAI
170171
cleancloud scan --provider gcp --category ai # endpoints Vertex AI + Workbench + training jobs + Cloud TPU + Feature Stores
171172
cleancloud scan --provider aws --category all # hygiène + IA/ML ensemble
@@ -432,7 +433,7 @@ Oui. CleanCloud n'a besoin d'accès réseau qu'aux endpoints API de votre cloud
432433

433434
## Ce que CleanCloud détecte
434435

435-
46 règles pour AWS, Azure et GCP — conservatrices, haut signal, conçues pour éviter les faux positifs en environnements IaC.
436+
47 règles pour AWS, Azure et GCP — conservatrices, haut signal, conçues pour éviter les faux positifs en environnements IaC.
436437

437438
**AWS :**
438439
- Compute : instances arrêtées 30+ jours (charges EBS continuent)
@@ -441,7 +442,7 @@ Oui. CleanCloud n'a besoin d'accès réseau qu'aux endpoints API de votre cloud
441442
- Plateforme : instances RDS inactives (HIGH)
442443
- Observabilité : logs CloudWatch à rétention infinie
443444
- Gouvernance : ressources sans tags, security groups inutilisés
444-
- IA/ML *(opt-in : `--category ai`)* : Bedrock Provisioned Throughput (Model Units) inactifs avec zéro invocation depuis 7+ jours ; endpoints SageMaker sans trafic `InvokeEndpoint` observé depuis 14+ jours ; instances Notebook SageMaker avec timestamps de contrôle inactifs depuis 14+ jours ; Studio Apps SageMaker (`KernelGateway`/`JupyterLab`/`CodeEditor`) sans signal d'activité récent exploitable depuis 7+ jours ; training jobs SageMaker toujours `InProgress` au-delà du seuil de 24h
445+
- IA/ML *(opt-in : `--category ai`)* : Bedrock Provisioned Throughput (Model Units) inactifs avec zéro invocation depuis 7+ jours ; endpoints SageMaker sans trafic `InvokeEndpoint` observé depuis 14+ jours ; instances Notebook SageMaker avec timestamps de contrôle inactifs depuis 14+ jours ; Domaines SageMaker sans apps en cours d'exécution sur tous les profils et espaces depuis 30+ jours (coût de stockage EFS continu) ; Studio Apps SageMaker (`KernelGateway`/`JupyterLab`/`CodeEditor`) sans signal d'activité récent exploitable depuis 7+ jours ; training jobs SageMaker toujours `InProgress` au-delà du seuil de 24h
445446

446447
**Azure :**
447448
- Compute : VMs arrêtées (non désallouées) (HIGH)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Idle AI/ML infrastructure is the fastest-growing source of invisible cloud spend
151151
| SageMaker endpoint (GPU) | $500 – $23,000 / month |
152152
| SageMaker Notebook Instance (GPU) | $500 – $23,000+ / month |
153153
| SageMaker Studio Apps (KernelGateway/JupyterLab/CodeEditor) | $42 – $1,600+ / month |
154+
| SageMaker Domain (idle EFS storage) | Continuous EFS charges |
154155
| SageMaker Training Job (runaway/hung GPU job) | $670 – $2,360+ / day |
155156
| Azure AML compute cluster (GPU) | $600 – $15,000 / month |
156157
| Azure ML Compute Instance (GPU) | $600 – $15,000+ / month |
@@ -165,7 +166,7 @@ Idle AI/ML infrastructure is the fastest-growing source of invisible cloud spend
165166
CleanCloud detects zero-invocation / zero-prediction endpoints, stale managed notebook and app activity, and long-running managed training jobs across all three clouds. Native cost tools show the bill — they do not name the specific resource to review.
166167

167168
```bash
168-
cleancloud scan --provider aws --category ai # Bedrock PTUs + SageMaker endpoints + notebooks + Studio apps + training jobs + idle GPU EC2
169+
cleancloud scan --provider aws --category ai # Bedrock PTUs + SageMaker endpoints + notebooks + domains + Studio apps + training jobs + idle GPU EC2
169170
cleancloud scan --provider azure --category ai # AML compute + ML instances + online endpoints + AI Search + OpenAI PTUs
170171
cleancloud scan --provider gcp --category ai # Vertex AI endpoints + Workbench + training jobs + Cloud TPU + Feature Stores
171172
cleancloud scan --provider aws --category all # hygiene + AI/ML together
@@ -432,7 +433,7 @@ Yes. CleanCloud only needs network access to your cloud provider's API endpoints
432433

433434
## What CleanCloud Detects
434435

435-
46 rules across AWS, Azure, and GCP — conservative, high-signal, designed to avoid false positives in IaC environments.
436+
47 rules across AWS, Azure, and GCP — conservative, high-signal, designed to avoid false positives in IaC environments.
436437

437438
**AWS:**
438439
- Compute: stopped instances 30+ days (EBS charges continue)
@@ -441,7 +442,7 @@ Yes. CleanCloud only needs network access to your cloud provider's API endpoints
441442
- Platform: idle RDS instances (HIGH)
442443
- Observability: infinite retention CloudWatch Logs
443444
- Governance: untagged resources, unused security groups
444-
- AI/ML *(opt-in: `--category ai`)*: idle Bedrock Provisioned Throughput (Model Units) with zero invocations 7+ days; idle SageMaker endpoints with no observed `InvokeEndpoint` traffic 14+ days; SageMaker Notebook Instances with stale control-plane timestamps 14+ days; SageMaker Studio apps (`KernelGateway`/`JupyterLab`/`CodeEditor`) with no usable recent activity signal 7+ days; SageMaker training jobs still `InProgress` beyond the 24h threshold
445+
- AI/ML *(opt-in: `--category ai`)*: idle Bedrock Provisioned Throughput (Model Units) with zero invocations 7+ days; idle SageMaker endpoints with no observed `InvokeEndpoint` traffic 14+ days; SageMaker Notebook Instances with stale control-plane timestamps 14+ days; SageMaker Domains with no running apps across all user profiles and spaces 30+ days (continuous EFS storage cost); SageMaker Studio apps (`KernelGateway`/`JupyterLab`/`CodeEditor`) with no usable recent activity signal 7+ days; SageMaker training jobs still `InProgress` beyond the 24h threshold
445446

446447
**Azure:**
447448
- Compute: stopped (not deallocated) VMs (HIGH)

cleancloud/doctor/aws.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,30 @@ def run_aws_ai_doctor(profile: Optional[str], region: Optional[str] = None) -> N
751751
permissions_failed.append(("sagemaker:DescribeNotebookInstance", str(e)))
752752
warn(f"sagemaker:DescribeNotebookInstance - {e}")
753753

754-
# --- sagemaker:ListApps (aws.sagemaker.studio_app.idle) ---
754+
# --- sagemaker:ListDomains + sagemaker:DescribeDomain (aws.sagemaker.domain.idle) ---
755+
try:
756+
sagemaker.list_domains(MaxResults=1)
757+
permissions_tested.append("sagemaker:ListDomains")
758+
success("sagemaker:ListDomains")
759+
except Exception as e:
760+
permissions_failed.append(("sagemaker:ListDomains", str(e)))
761+
warn(f"sagemaker:ListDomains - {e}")
762+
763+
try:
764+
# DescribeDomain — attempt only if a domain exists to avoid a spurious miss
765+
_domains = sagemaker.list_domains(MaxResults=1)
766+
_domain_list = _domains.get("Domains", [])
767+
if _domain_list:
768+
sagemaker.describe_domain(DomainId=_domain_list[0]["DomainId"])
769+
permissions_tested.append("sagemaker:DescribeDomain")
770+
success("sagemaker:DescribeDomain")
771+
else:
772+
info("sagemaker:DescribeDomain - not tested (no SageMaker domain found to probe)")
773+
except Exception as e:
774+
permissions_failed.append(("sagemaker:DescribeDomain", str(e)))
775+
warn(f"sagemaker:DescribeDomain - {e}")
776+
777+
# --- sagemaker:ListApps (aws.sagemaker.studio_app.idle + aws.sagemaker.domain.idle) ---
755778
try:
756779
sagemaker.list_apps(MaxResults=1)
757780
permissions_tested.append("sagemaker:ListApps")

0 commit comments

Comments
 (0)