mirror of
https://github.com/mcloh/decision-models-benchmark.git
synced 2026-11-06 06:14:11 +00:00
Proteger dados sensíveis e atualizar andamento do plano
- Caminho do compartimento pai e CIDR do SSH saem do código para .secrets/oci-settings.json (fora do Git), com override por DMB_*. - Relatórios de sanidade deixam de gravar o hostname local. - tests/test_sensitive.py falha se OCIDs, chaves, IPs públicos ou valores de .secrets aparecerem em arquivos versionados. - tools/plan_progress.py gera o bloco de andamento por fase no plano. - Plano: status reais das tarefas de F0, F3 e F6; README e docs/05 com GPU em sa-saopaulo-1, runtime CUDA do Rizzo e pipeline sintético. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,16 +13,17 @@ from datetime import datetime, timezone
|
||||
|
||||
import oci
|
||||
|
||||
from session import CRED_DIR, REGION, load_config
|
||||
from session import CRED_DIR, REGION, load_config, settings
|
||||
|
||||
PARENT_PATH = "root/<compartimento-pai>"
|
||||
# Caminho do compartimento pai e CIDR do SSH ficam fora do Git: .secrets/oci-settings.json
|
||||
PARENT_PATH = settings()["parent_compartment_path"]
|
||||
COMPARTMENT_NAME = "decision-models"
|
||||
TAGS = {"projeto": "benchmark-decisoes-ptbr", "ambiente": "benchmark"} # centro_custo pendente (Q13)
|
||||
BUCKETS = ["entrada", "artefatos", "resultados", "logs-imutaveis"]
|
||||
VCN_CIDR = "10.20.0.0/16"
|
||||
SUBNET_CIDR = "10.20.1.0/24"
|
||||
DEV_SUBNET_CIDR = "10.20.2.0/24"
|
||||
SSH_ALLOWED_CIDR = os.environ.get("DMB_SSH_CIDR", "203.0.113.1/32")
|
||||
SSH_ALLOWED_CIDR = settings()["ssh_allowed_cidr"]
|
||||
# VM de trabalho criada pelo usuário no console (o lançamento via API é negado neste compartment).
|
||||
VM_NAME = "instance-20261007-1206"
|
||||
VM_SSH_KEY = ".secrets/ssh/ssh-key-oci.key"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Sessão OCI do benchmark a partir das credenciais em .secrets/oci-credentials/."""
|
||||
import configparser
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import oci
|
||||
@@ -9,6 +11,16 @@ CRED_DIR = ROOT / ".secrets" / "oci-credentials"
|
||||
REGION = "us-chicago-1"
|
||||
|
||||
|
||||
def settings() -> dict:
|
||||
"""Configuração local fora do Git (.secrets/oci-settings.json); variáveis DMB_* têm precedência."""
|
||||
path = CRED_DIR.parent / "oci-settings.json"
|
||||
data = json.loads(path.read_text()) if path.is_file() else {}
|
||||
return {
|
||||
"parent_compartment_path": os.environ.get("DMB_PARENT_COMPARTMENT", data.get("parent_compartment_path")),
|
||||
"ssh_allowed_cidr": os.environ.get("DMB_SSH_CIDR", data.get("ssh_allowed_cidr")),
|
||||
}
|
||||
|
||||
|
||||
def load_config(region: str = REGION, profile: str = "DEFAULT") -> dict:
|
||||
parser = configparser.ConfigParser()
|
||||
parser.read(CRED_DIR / "profile.config")
|
||||
|
||||
Reference in New Issue
Block a user