DaaS / Products / Data-Pipeline RAG Production Platform

Data-Pipeline RAG Production Platform

A platform team uses Terraform to deploy an MLPS-hardened, auto-scaling production stack (ECS, ESS, SLB, CAS SSL on Alinux), then layers DataWorks-orchestrated ETL pipelines that feed and continuously update an OpenSearch/Elasticsearch-powered RAG semantic search service — combining automated data ingestion with AI search on elastic infrastructure.

Products involved

Scenario

Use this workflow when deploying a production-grade Retrieval-Augmented Generation (RAG) platform that requires MLPS-compliant infrastructure, automated data ingestion, and real-time semantic search. It combines Terraform-provisioned auto-scaling compute with DataWorks ETL pipelines feeding an OpenSearch vector index, ensuring secure, elastic, and continuously updated AI search capabilities.

Integration steps

  1. Provision Core Infrastructure: Initialize Terraform and apply the base stack:
  2. ``hcl resource "alicloud_vpc" "main" { cidr_block = "10.0.0.0/16" } resource "alicloud_ecs_instance" "rag_node" { instance_type = "ecs.g7.xlarge"; image_id = "aliyun_3_x64_20G_alibase_20231115.vhd" } ``

  3. Bind CAS SSL Certificate: Attach your CAS-managed cert to the SLB HTTPS listener:
  4. ``bash aliyun slb CreateLoadBalancerHTTPSListener --LoadBalancerId lb-xxx --BackendPort 8080 --ServerCertificateId cert-xxx --Bandwidth 100 ``

  5. Configure ESS Auto-Scaling: Link the ECS cluster to ESS with dynamic scaling policies:
  6. ``hcl resource "alicloud_ess_scaling_group" "rag_asg" { scaling_group_name = "rag-prod"; min_size = 2; max_size = 10; vswitch_ids = [alicloud_vswitch.main.id] } ``

  7. Deploy DataWorks ETL Pipeline: Create a sync node pulling raw documents into OSS and metadata into RDS:
  8. ``sql INSERT INTO rds_metadata_table (doc_id, content_hash, status) SELECT id, md5(content), 'pending' FROM oss_raw_docs WHERE status = 'new'; ``

  9. Index to OpenSearch: Configure OpenSearch to ingest from RDS/OSS. Set vector mapping:
  10. ``json PUT /rag-index { "mappings": { "properties": { "embedding": { "type": "knn_vector", "dims": 768 } } } } ``

  11. Wire RAG App to OpenSearch: Deploy your semantic search service on ECS, pointing to the OpenSearch endpoint via environment variables:
  12. ``bash export OPENSEARCH_HOST="https://opensearch-cn-shanghai.aliyuncs.com" export OPENSEARCH_INDEX="rag-index" ``

  13. Validate & Monitor: Run curl -k https://<slb-ip>/api/v1/search?q="test" and verify ESS metrics in CloudMonitor.

Architecture

Data flows from external sources into DataWorks, which orchestrates batch/stream ETL jobs to land raw files in OSS and structured metadata in RDS. DataWorks triggers OpenSearch indexing jobs that convert text to embeddings and update the knn_vector index. The RAG application runs on Alinux ECS instances behind an SLB, querying OpenSearch for semantic matches and returning context to LLMs. ESS dynamically scales ECS nodes based on CPU/QPS, while CAS terminates HTTPS traffic at the SLB edge.

Prerequisites

Common pitfalls

Typical questions

FAQ

Q: How do I deploy the MLPS-hardened, auto-scaling Data-Pipeline RAG production platform using Terraform? A: You can deploy the platform by using Terraform to provision an MLPS-hardened, auto-scaling infrastructure stack on Alibaba Cloud Linux, which then integrates DataWorks-orchestrated ETL pipelines with an OpenSearch or Elasticsearch-backed RAG semantic search service. This setup combines automated data ingestion with AI search capabilities on elastic compute resources.