26Y02m3

Young-Kyoo Kim·4일 전
# ... [기존 로컬 저장 구역] ...
            cluster_partition_dir = MERGED_DIR / cluster_chunk
            cluster_partition_dir.mkdir(parents=True, exist_ok=True)
            
            target_output_file = cluster_partition_dir / f"daily_enriched_{cluster_chunk}_{date_chunk}.parquet"
            ns_output_file     = cluster_partition_dir / f"daily_ns_usage_{cluster_chunk}_{date_chunk}.parquet"
            pareto_output_file = cluster_partition_dir / f"pareto_ns_{cluster_chunk}_{date_chunk}.parquet"
            
            # (로컬 쓰기 집행 완료 상태)
            # df_pod.to_parquet(target_output_file, index=False)
            # ...

            # ─── 📡 [신규 추가] AIStor(MinIO) 테이블 레이어로 즉시 슈팅 (Sync-Up) ───
            print(f"     📤 [AIStor 적재] 정산 완료본 오브젝트 스토리지로 업로드 중...")
            try:
                # 1. 상세 원부 업로드 -> s3://devops-test/merged/STORAGE/daily_enriched_STORAGE_20260630.parquet
                s3_client.upload_file(
                    str(target_output_file), bucket_name, 
                    f"merged/{cluster_chunk}/{target_output_file.name}"
                )
                # 2. 일별 사용량 요약 업로드
                s3_client.upload_file(
                    str(ns_output_file), bucket_name, 
                    f"merged/{cluster_chunk}/{ns_output_file.name}"
                )
                # 3. 파레토 지분 원부 업로드
                s3_client.upload_file(
                    str(pareto_output_file), bucket_name, 
                    f"merged/{cluster_chunk}/{pareto_output_file.name}"
                )
                print(f"     ✅ [업로드 완수] AIStor Table 동기화 완료.")
                
            except Exception as e:
                print(f"     ❌ [업로드 실패] AIStor 네트워크 통신 장애: {str(e)}")
            # ──────────────────────────────────────────────────────────────────────

0개의 댓글