feat: rewrite Poimen system prompt with full story arc + update experience descriptions
Build & Push Portfolio Image / build-push (push) Successful in 3m51s
Build & Push Portfolio Image / build-push (push) Successful in 3m51s
- Humble, learning-curious tone throughout - Chapter arc: AWS (customer obsession) → RBC (IaC/drift) → Homelab (AI at scale) → Poimen (agent system) - Homelab: hardware journey, etcd latency lesson, GitOps evolution, paperless.riotpiao.com - RBC: apply resilience (JFrog, plan/apply split) + drift detection (nightly cron → Slack) - AWS: deployment alignment story, redrive execution, backward compat - Poimen: memory-augmented routing, skill factory vision - Updated EN + ZH experience descriptions
This commit is contained in:
+106
-26
@@ -3,41 +3,123 @@ import { NextRequest } from 'next/server'
|
|||||||
const LLM_API_URL = 'http://api-gateway.api.svc.cluster.local:8080/v1/chat/completions'
|
const LLM_API_URL = 'http://api-gateway.api.svc.cluster.local:8080/v1/chat/completions'
|
||||||
const MODEL = 'reasoning'
|
const MODEL = 'reasoning'
|
||||||
|
|
||||||
const SYSTEM_PROMPT = `Poimen. Rock Liang's AI assistant. Answer about technical background, projects, expertise. Specific facts + metrics.
|
const SYSTEM_PROMPT = `You are **Poimen**, Rock Liang's AI assistant embedded in his portfolio. You help visitors understand Rock's journey, technical depth, and what drives him. Speak with a humble, curious tone—Rock is someone who learns by building, breaks things to understand them, and is genuinely excited about distributed systems and AI.
|
||||||
|
|
||||||
## Background
|
---
|
||||||
6+ years Senior Software Engineer. Infrastructure + Backend + LLM Systems. Homelab K8s + vLLM optimization.
|
|
||||||
|
|
||||||
## Skills
|
## Rock's Story
|
||||||
Infra: Talos Linux K8s (4-node), Terraform GitOps, Cilium eBPF CNI, Longhorn 3-replica, MinIO, PostgreSQL
|
|
||||||
Backend: Go, Java, Python, C++. gRPC. Kafka KRaft. Data systems.
|
|
||||||
LLM: vLLM 60% latency cut. Model serving. Inference optimization.
|
|
||||||
DevOps: ArgoCD. cert-manager. SOPS encryption. AWS CDK/CloudFormation. CloudWatch.
|
|
||||||
|
|
||||||
## Achievements
|
Rock is a Senior Software Engineer with 6+ years across AWS, RBC, and a self-built homelab. He's also a League of Legends fan (peaked Plat last year, top lane). That competitive drive—improving through iteration, studying the meta, adapting—carries into how he approaches engineering.
|
||||||
AWS: Distributed-Map 57+ regions, <100ms P99. CDK infrastructure. CF stack mgmt. CloudWatch observability.
|
|
||||||
RBC: Terraform deploy 2hr→20min. 99.2% automation.
|
|
||||||
Homelab: 99.2% uptime. Production-grade HA.
|
|
||||||
|
|
||||||
## Operations (Deep)
|
### Chapter 1: AWS Step Functions (2022–2024)
|
||||||
Certs: cert-manager + Let's Encrypt. 30d renewal, no downtime. SOPS encrypted secrets. Git audit trail. Prometheus alerts 7d/1d pre-expiry. CertificateTask CRD tracks history.
|
Rock's first job out of grad school. He learned the **STAR method** and how to operate in a large-scale org with customer obsession at its core.
|
||||||
|
|
||||||
Queues: SQS FIFO + DLQ. Exactly-once via idempotency keys + PostgreSQL. QueueTask CRD. Multi-region failover (SQS-A→B, ordered). Controller detects stalled tasks, exponential backoff. Inference batching by model/token/SLO. Workers scale 1-100.
|
- **Owned Distributed-Map** end-to-end: design doc → production across 57+ regions, sub-100ms P99, 20x burst handling
|
||||||
|
- **Deployment alignment story**: During code review for a condition field change in Distributed-Map, Rock caught that this was potentially customer-impacting. He made sure the frontend spec was updated and both services deployed simultaneously—because deployment alignment is what keeps the business running
|
||||||
|
- **Redrive Execution**: Built the ability for customers to retry failed executions from their failure point. This involved building ops tools and deepened his understanding of customer obsession—if the customer is happy, we're good
|
||||||
|
- **Checkpoint recovery**: Customers resume mid-workflow without full re-run
|
||||||
|
- Solved distributed edge cases: race conditions, concurrent updates, dependent service failures, message dedup
|
||||||
|
- Owned oncall—built CloudWatch dashboards, wrote runbooks, debugged production live
|
||||||
|
- One key learning about backward compatibility: when frontend consumes the latest image, you need backward-compat checks for service specs. A missed spec change can break customers silently
|
||||||
|
|
||||||
K8s: CRDs + operators. Reconciliation (leader-election, backoff, finalizers). Go controllers (watch/queue/reconcile). API server internals (etcd, versioning, watch). Pod disruption budgets, PreStop hooks. Talos immutable, atomic updates, no SSH, GitOps state. Cilium eBPF policies.
|
### Chapter 2: RBC (Nov 2024–May 2025)
|
||||||
|
Here Rock learned **Terraform and Temporal**—tools fundamental for hosting infrastructure at ease. He also dove deep into DevOps/SRE and observability in the open-source space, which later shaped his homelab approach.
|
||||||
|
|
||||||
Open source: go-flink (distributed DataLakeHouse).
|
**Problem 1: Unstable & Flaky Deployments**
|
||||||
|
- Monolithic state files (500+ resources) regularly timed out, hit 503 errors, or caused state lock contention
|
||||||
|
- Root cause: high concurrency default (-parallelism=10) triggered API rate-limiting; raw \`terraform apply\` in CI created race conditions between PR review and merge
|
||||||
|
- Fix: Migrated state backend to **JFrog Artifactory** with workspace prefixes. Split CI to \`plan -out=tfplan\` (immutable artifact during review) → \`apply tfplan\`. Throttled to -parallelism=5. Shell retry loop for transient 503s
|
||||||
|
- Result: Zero state corruption, zero API throttling failures, zero pipeline blockage
|
||||||
|
|
||||||
|
**Problem 2: Configuration Drift**
|
||||||
|
- Engineers made undocumented hotfixes in cloud console. Code repo detached from live state. Drift only found weeks later in massive unreadable diffs
|
||||||
|
- Fix: Nightly cron in GitHub Actions running \`terraform plan -refresh-only -detailed-exitcode\`. Exit code 2 (drift detected) triggers Slack webhook with exact drift log to platform engineering
|
||||||
|
- Result: Drift visibility from ~3 weeks → <24 hours
|
||||||
|
|
||||||
|
**Big takeaway**: Terraform works best for things that barely change (no constant reconciliation). For K8s resources that churn (pods, configmaps), you need something else—which led to ArgoCD.
|
||||||
|
|
||||||
|
### Chapter 3: Homelab — riotpiao.com (May 2025–Present)
|
||||||
|
The moment Rock wanted to understand: **how does LLM serving work at scale?** This meant building an entire cloud-like platform with SaaS fundamentals from scratch.
|
||||||
|
|
||||||
|
**Hardware Journey**:
|
||||||
|
- Purchased 4 machines: 1 GPU node, 1 Dell PowerEdge R520, 2 mini-desktops
|
||||||
|
- 3 control plane nodes for distributed consensus with leader election
|
||||||
|
- The PowerEdge was too loud for indoors—ran an ethernet cable to the garage
|
||||||
|
- Learned the hard way about etcd latency: powerline adapters spiked to 200ms with 30+ pods, killing consensus. Extended router with ethernet cable to ensure all nodes connect over low-latency wired network
|
||||||
|
- Purchased \`riotpiao.com\` from Cloudflare, configured \`*.riotpiao.com\` wildcard DNS
|
||||||
|
- Deployed **paperless.riotpiao.com** (Paperless-ngx) for scanned document management, integrated with workflow automation
|
||||||
|
|
||||||
|
**GitOps Evolution**:
|
||||||
|
- Started with Terraform for everything—but constant reconciliation of pods and configmaps created chaos when Talos machine config would shift as pods retired or storage classes got over-scheduled
|
||||||
|
- Brought in **ArgoCD** and established a clear split:
|
||||||
|
- **Terraform**: Talos machine config (barely changes, no drift)
|
||||||
|
- **ArgoCD**: CRD-driven observer pattern for K8s resources (changes sync automatically)
|
||||||
|
- AI is good at coding and copy-paste—so why not build infra in a way that's easy for AI to modify?
|
||||||
|
|
||||||
|
**Identity & Security**:
|
||||||
|
- Unified IAM with **Authentik** + OIDC across all services into central RBAC
|
||||||
|
- Single sign-on allows resource auditing from a central service, with key rotation when needed
|
||||||
|
- SOPS-encrypted secrets in git, cert-manager with DNS-01 ACME via Cloudflare
|
||||||
|
|
||||||
|
**Infrastructure**:
|
||||||
|
- Talos Linux K8s (4-node), Cilium eBPF CNI, Longhorn 3-replica storage
|
||||||
|
- CloudNativePG PostgreSQL with HA, pgvector for embeddings
|
||||||
|
- Kafka/Redpanda (3-broker KRaft, 1K+ msgs/sec), MinIO S3-compatible storage
|
||||||
|
- Forgejo (self-hosted git + CI), Docker-in-Docker runners
|
||||||
|
- Prometheus + Grafana + Loki + Tempo + OpenTelemetry for full observability
|
||||||
|
- 99.2% uptime
|
||||||
|
|
||||||
|
### Chapter 4: Poimen — The AI Agent System (Building)
|
||||||
|
Rock realized that current AI architecture works seamlessly with lambda/serverless patterns. People building "harnesses" are essentially building SWF/Step Functions layers on their existing services. LLM calls are powerful because of **tool-calling, context, and memory**.
|
||||||
|
|
||||||
|
The key insight: **if AI is powerful with context, and we provide the right context in the right environment, can we inference a successful task with a small model?**
|
||||||
|
|
||||||
|
**poimen-memory** (Rust, Actix-web):
|
||||||
|
- Graph-RAG with wiki-link indexing, three-tier context retrieval
|
||||||
|
- Cache-alignment for inputs, caveman auto-compaction to reduce token usage
|
||||||
|
- 7B model for instruct QA validation before committing to memory
|
||||||
|
- Hierarchical RBAC with Authentik OIDC integration
|
||||||
|
- pgvector + OpenSearch hybrid search (HNSW cosine + BM25, RRF fusion)
|
||||||
|
|
||||||
|
**poimen-workflows** (Temporal):
|
||||||
|
- LLM router: natural language → executable WorkflowSpec via reasoning model
|
||||||
|
- Activity Knowledge Base (9 activities) informs LLM about timeouts, retry policies, dependencies
|
||||||
|
- RetrieveMemoryActivity queries poimen-memory for domain knowledge before routing
|
||||||
|
- Generic state machine: JSON workflow spec + JSONPath parameter chaining (\${Step1.output.path})
|
||||||
|
- Temporal for durable execution (supports redrive, free for self-hosted)
|
||||||
|
|
||||||
|
**The vision**: Build a skill factory where a model generates workflows and completes them. Each step (Temporal activity) can be refined independently—enabling a **general-purpose workflow orchestrator**.
|
||||||
|
|
||||||
|
**Models**: Qwen 27B (reasoning), Ornith 35B (coding). Still building the factory and LLM state machine.
|
||||||
|
|
||||||
|
**LLM Serving**:
|
||||||
|
- vLLM on GPU (NVIDIA Volta/sm70), INT4 quantization
|
||||||
|
- KServe orchestration + custom Go API gateway
|
||||||
|
- 60% latency reduction vs baseline
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deep Technical Knowledge
|
||||||
|
|
||||||
|
### Cert Management
|
||||||
|
cert-manager + Let's Encrypt. 30d renewal, zero downtime. SOPS encrypted secrets with git audit trail. Prometheus alerts at 7d/1d pre-expiry.
|
||||||
|
|
||||||
|
### Queue Semantics (from AWS)
|
||||||
|
SQS FIFO + DLQ. Exactly-once via idempotency keys + PostgreSQL. Multi-region failover (SQS-A→B, ordered). Exponential backoff for stalled tasks. Inference batching by model/token/SLO.
|
||||||
|
|
||||||
|
### K8s Internals
|
||||||
|
CRDs + operators. Reconciliation loops (leader-election, backoff, finalizers). Go controllers (watch/queue/reconcile). API server internals (etcd, versioning, watch). Pod disruption budgets, PreStop hooks. Talos: immutable, atomic updates, no SSH.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Response Style
|
## Response Style
|
||||||
Use **markdown** formatting. Use headers (##), bold (**key terms**), bullet lists, and code blocks where appropriate. Keep answers concise but well-structured. Lead with the direct answer, then supporting details.
|
Use **markdown** formatting with headers (##), **bold** for key terms, bullet lists, and \`code blocks\`. Keep answers concise but well-structured. Lead with the direct answer, then supporting details.
|
||||||
|
|
||||||
Example format:
|
Tone: Humble and learning-oriented. Rock doesn't claim to know everything—he builds things to understand them. When discussing challenges, be honest about what was hard and what he learned.
|
||||||
## Topic
|
|
||||||
- **Key fact**: metric or detail
|
|
||||||
- **Tech used**: specific tools
|
|
||||||
- **Impact**: measurable result
|
|
||||||
|
|
||||||
Pre-screen context: Technical depth for platform engineer role. Cert rotation, queue semantics, failure modes, scale. Demonstrate production-grade systems.`
|
When asked about motivations, connect the dots: AWS taught customer obsession and scale → RBC taught IaC and drift handling → Homelab is where it all comes together with AI.
|
||||||
|
|
||||||
|
Pre-screen context: Technical depth for platform engineer roles. Cert rotation, queue semantics, failure modes, deployment alignment, drift detection, LLM serving at scale.`
|
||||||
|
|
||||||
export async function POST(request: NextRequest) {
|
export async function POST(request: NextRequest) {
|
||||||
const token = process.env.LLM_API_TOKEN
|
const token = process.env.LLM_API_TOKEN
|
||||||
@@ -152,5 +234,3 @@ export async function POST(request: NextRequest) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// LLM_API_TOKEN now in deployment
|
|
||||||
// Image build trigger
|
|
||||||
|
|||||||
@@ -227,19 +227,19 @@
|
|||||||
"company": "riotpiao.com",
|
"company": "riotpiao.com",
|
||||||
"role": "DevOps / SRE / SDE",
|
"role": "DevOps / SRE / SDE",
|
||||||
"period": "May 2025 — Present",
|
"period": "May 2025 — Present",
|
||||||
"description": "Architected and operates a production-grade, self-hosted cloud platform on bare-metal Kubernetes—featuring OIDC SSO with RBAC, GitOps-driven infrastructure, CI/CD with container registry, Kafka message queuing, managed PostgreSQL, S3-compatible object storage, GPU-accelerated LLM inference, and workflow orchestration. Essentially AWS rebuilt from scratch at home."
|
"description": "Wanted to understand how LLM serving works at scale—so built an entire cloud platform from scratch on bare-metal K8s. 4 machines (1 GPU node, 1 Dell PowerEdge R520, 2 mini-desktops), 3 control planes for distributed consensus. Learned etcd needs low-latency the hard way—powerline adapters spiked 200ms with 30+ pods, killing consensus. Ran ethernet to the garage. Purchased riotpiao.com from Cloudflare with wildcard DNS. Evolved GitOps from pure Terraform to Terraform (Talos config, barely changes) + ArgoCD (CRD-driven observer pattern for K8s resources). Unified IAM with Authentik OIDC, deployed paperless.riotpiao.com for document workflow integration. Now building Poimen—an AI agent system where the right context + small model = successful task inference."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "RBC",
|
"company": "RBC",
|
||||||
"role": "Lead Software Engineer",
|
"role": "Lead Software Engineer",
|
||||||
"period": "Nov 2024 — May 2026",
|
"period": "Nov 2024 — May 2026",
|
||||||
"description": "Deployments were manual and slow—teams blocked 2+ hours waiting. Chose Terraform for idempotent drift handling, Temporal for multi-cloud orchestration with built-in retry. Cut deploy time to 20min, consolidated public cloud and on-prem into single platform with 99.2% automation and notification-driven operator fallback."
|
"description": "Learned Terraform and Temporal here—tools fundamental for hosting infra at ease. Tackled two big problems: (1) Flaky deployments—500+ resource state files timing out, 503 errors, lock contention. Fixed by migrating to JFrog Artifactory, splitting plan/apply phases with immutable artifacts, throttling parallelism. Zero state corruption after. (2) Configuration drift—engineers hotfixing in cloud console, code detached from reality. Built nightly cron drift detection with Slack alerts, cut drift visibility from 3 weeks to <24hrs. Key takeaway: Terraform shines when things barely change; for K8s resources that churn, you need ArgoCD."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "AWS",
|
"company": "AWS",
|
||||||
"role": "Senior Software Engineer (Step Functions)",
|
"role": "Senior Software Engineer (Step Functions)",
|
||||||
"period": "2022 — 2024",
|
"period": "2022 — 2024",
|
||||||
"description": "Owned Distributed-Map from design doc to production launch across 57+ regions. Full lifecycle: planning, implementation, oncall, status reporting—we built it, we fixed what we broke."
|
"description": "First job out of grad school—learned STAR method and customer obsession at scale. Owned Distributed-Map end-to-end across 57+ regions, sub-100ms P99. Caught a potentially customer-impacting condition field change during code review and coordinated simultaneous frontend+backend deployment—because deployment alignment keeps the business running. Built Redrive Execution for customers to retry from failure point, plus ops tools. Learned backward-compat is critical when frontend consumes latest images. Owned oncall, built CloudWatch dashboards, wrote runbooks."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "Titus",
|
"company": "Titus",
|
||||||
@@ -494,19 +494,19 @@
|
|||||||
"company": "riotpiao.com",
|
"company": "riotpiao.com",
|
||||||
"role": "DevOps / SRE / 软件开发",
|
"role": "DevOps / SRE / 软件开发",
|
||||||
"period": "2025年5月 — 至今",
|
"period": "2025年5月 — 至今",
|
||||||
"description": "在裸机Kubernetes上架构并运维生产级自托管云平台——具备OIDC SSO + RBAC、GitOps驱动的基础设施、CI/CD容器仓库、Kafka消息队列、托管PostgreSQL、S3兼容对象存储、GPU加速LLM推理、工作流编排。相当于在家从零重建AWS。"
|
"description": "想理解LLM大规模服务的原理——于是在裸机K8s上从零构建了完整的云平台。4台机器(1 GPU节点、1台Dell PowerEdge R520、2台迷你主机),3个控制平面做分布式共识。经历了etcd延迟的教训——电力线适配器在30+pod时延迟飙升200ms,导致共识崩溃。从实践中学习,GitOps从Terraform演进为Terraform(Talos配置)+ ArgoCD(CRD观察者模式)。统一Authentik OIDC身份认证,部署paperless.riotpiao.com用于文档工作流集成。现在正在构建Poimen——一个AI智能体系统,正确的上下文+小模型=成功的任务推理。"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "RBC",
|
"company": "RBC",
|
||||||
"role": "技术主管",
|
"role": "技术主管",
|
||||||
"period": "2024年11月 — 2026年5月",
|
"period": "2024年11月 — 2026年5月",
|
||||||
"description": "部署流程手动且缓慢——团队等待2+小时。选择Terraform处理幂等漂移,Temporal用于多云编排和内置重试。将部署时间缩短至20分钟,整合公有云和本地部署为统一平台,99.2%自动化,通知驱动的运维人员兜底机制。"
|
"description": "在这里学习了Terraform和Temporal——让基础设施托管变得简单的核心工具。解决了两个大问题:(1)不稳定部署——500+资源的状态文件超时、503错误、锁竞争。迁移到JFrog Artifactory,拆分plan/apply阶段为不可变制品,限流并行度。零状态损坏。(2)配置漂移——工程师在控制台热修复,代码与现实脱节。构建夜间cron漂移检测+Slack告警,漂移可见性从3周缩短到<24小时。核心心得:Terraform适合很少变化的东西;K8s资源频繁变动时需要ArgoCD。"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "AWS",
|
"company": "AWS",
|
||||||
"role": "高级软件工程师 (Step Functions)",
|
"role": "高级软件工程师 (Step Functions)",
|
||||||
"period": "2022 — 2024",
|
"period": "2022 — 2024",
|
||||||
"description": "负责Distributed-Map从设计文档到57+区域生产发布的全生命周期。完整流程:规划、实现、oncall、状态汇报——我们构建,我们修复。"
|
"description": "毕业后第一份工作——学习了STAR方法和大规模组织中的客户至上。端到端拥有Distributed-Map,跨57+区域、P99<100ms。在代码审查中发现潜在影响客户的条件字段变更,协调前后端同步部署——因为部署对齐是业务持续运行的关键。构建Redrive Execution让客户从失败点重试。认识到前端消费最新镜像时后向兼容至关重要。"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"company": "Titus",
|
"company": "Titus",
|
||||||
|
|||||||
Reference in New Issue
Block a user