This project provisions a secure, automated data processing pipeline on AWS using EKS and EFS. It merges COBOL-based legacy processing with modern AI/ML capabilities, showcasing a hybrid architecture capable of transforming, validating, enriching, and analyzing data.
This pipeline:
- Deploys a Kubernetes cluster on AWS using Terraform.
- Mounts EFS for shared, persistent storage.
- Runs a series of microservices and CronJobs:
- Legacy COBOL jobs for ingesting and validating financial CSV data.
- AI/ML components for enrichment, classification, and prediction.
- PostgreSQL storage for verified data.
- Error analysis and daily ML model evaluation.
All infrastructure is provisioned using Terraform:
- VPC:
vpc.tf - EKS Cluster:
eks.tf - EFS Filesystem:
efs.tf - ECR for Docker images:
ecr.tf - SageMaker:
sagemaker.tf - Aurora PostgreSQL:
aurora.tf - Kubernetes Resources:
k8s.tf - State Management:
backend.tf
- EKS hosts all Kubernetes workloads.
- EFS provides persistent storage mounted across pods for sharing CSVs, and COBOL-generated output.
- S3 provides persistent storage mounts for logs, Sagemaker models, and training data.
Managed with ArgoCD and Helm, includes:
- ArgoCD (GitOps deployment engine)
- ExternalDNS (auto-manage Route 53 records)
- AWS Load Balancer Controller
- NVIDIA GPU Device Plugin (for LLM jobs)
- Secrets Store CSI Driver (for secrets)
- Custom StorageClass (for EFS)
- S3 CSI Driver (for error logs and Sagemaker access)
Services deployed:
cobol-0.yaml: Original COBOL transformation job that uses LLM to enhance outputs from COBOL applicationscobol-ml-raw-generator.yaml: Generates raw financial CSVscobol-ml-ingestion.yaml: Validates and ingests raw files and transforms themcobol-ml-postgresql.yaml: Inserts to PostgreSQL and outputs any error logs to S3 mountcobol-ml-logs-preprocess.yaml: Error log preprocessor runs daily to allow ML pipelinellm.yaml: LLM enrichment servicedeepseek.yaml: LLM local modelubuntu-worker.yaml: Utility pod for manual inspections
- Located in
docker/cobol_0: - A Kubernetes CronJob in docker/cobol_0:
- Runs TransformCSV.cbl (COBOL) inside a container.
- Alters a CSV file stored on EFS.
- LLM Enrichment
- The processed CSV is sent to an LLM (process_orders.py).
- Runs inside a container in Kubernetes (docker/llm).
In docker/cobol_ml_cobol_ingestion and cobol_ml_cobol_postgresql:
-
IngestCSV.cblvalidates and prepares records. -
Valid entries are inserted into PostgreSQL.
-
Errors are logged in structured JSON format:
Example:
{ "timestamp": "2025-03-30T23:06:42.127715654Z", "file": "ingested-2025-03-30-22-25-02.tsv", "row": "2022-10-24,Bank Transaction,ATM Withdrawal,-0.0", "reason": "Invalid Amount: -0.0", "classification": "validation_error" }
Located in docker/llm and docker/deepseek:
- Enriches validated records with inferred metadata or classifications.
- Output data is saved for further ML analysis.
-
An ML model is trained using valid vs. error records.
-
SageMaker is used to:
- Train a classifier.
- Evaluate daily model accuracy.
- Output confusion matrices.
- Initialize Terraform:
terraform init
- Plan deployment:
terraform plan -out=plan.out
- Apply infrastructure:
terraform apply plan.out
One-time setup. All infrastructure (EKS, EFS, ECR, Aurora, SageMaker) will be created.
- Point
kubectlto EKS:aws eks update-kubeconfig --name <cluster-name> --region <region>
- Deploy using Helm:
helm template . | kubectl apply -f -
ArgoCD will handle GitOps deployment afterward.
-
COBOL CronJob auto-triggers transformation jobs.
-
LLM & PostgreSQL Pods listen and act on generated data.
-
Logs and metrics can be tracked via:
- ArgoCD dashboards visualize deployment flows.
- EFS logs and PostgreSQL entries give traceability.
- JSON error logs processed daily.
- SageMaker metrics stored and evaluated periodically.
- COBOL applications run on Kubernetes using CronJobs.
- EFS file persistence across pods.
- PostgreSQL integration via containerized COBOL.
- Structured logging of errors for ML training.
- Daily ML model evaluation with SageMaker.
- GitOps-based deploys with ArgoCD.





