cronjob_creation.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # 模块 A + B 创建子系统 cronjob(P0-D,2026-06-09)
  2. # 与调控子系统(cronjob.yaml,02:00 UTC)错开 30 分钟运行,避免争抢腾讯/飞书 API
  3. # 流程:
  4. # Phase 0 模块 A 建广告(每账户 ADS_PER_ACCOUNT 条)
  5. # Phase 1 模块 B 给所有广告补创意(每广告 TARGET_CREATIVES_PER_AD 条)
  6. # 都走"先审后挂"飞书审批,审批通过才真 POST 腾讯
  7. apiVersion: batch/v1
  8. kind: CronJob
  9. metadata:
  10. name: auto-put-ad-mini-creation
  11. namespace: ad-automation
  12. labels:
  13. app: auto-put-ad-mini
  14. component: creation
  15. spec:
  16. schedule: "30 2 * * *" # 每天 02:30 UTC,与调控 02:00 UTC 错开 30 分钟
  17. concurrencyPolicy: Forbid # 不允许并发运行(主循环含 120 分钟轮询)
  18. successfulJobsHistoryLimit: 3
  19. failedJobsHistoryLimit: 3
  20. jobTemplate:
  21. spec:
  22. backoffLimit: 2
  23. # 4 小时超时(覆盖 120 分钟审批 × 2 phase + 余量)
  24. activeDeadlineSeconds: 14400
  25. template:
  26. metadata:
  27. labels:
  28. app: auto-put-ad-mini
  29. component: creation
  30. spec:
  31. restartPolicy: Never
  32. containers:
  33. - name: creation-engine
  34. image: your-registry/auto-put-ad-mini:latest
  35. imagePullPolicy: Always
  36. command: ["python", "execute_creation_once.py"]
  37. envFrom:
  38. - configMapRef:
  39. name: ad-config
  40. - secretRef:
  41. name: ad-secrets
  42. volumeMounts:
  43. - name: outputs
  44. mountPath: /app/outputs
  45. resources:
  46. requests:
  47. memory: "1Gi"
  48. cpu: "500m"
  49. limits:
  50. memory: "2Gi"
  51. cpu: "1"
  52. securityContext:
  53. runAsNonRoot: true
  54. runAsUser: 1000
  55. allowPrivilegeEscalation: false
  56. volumes:
  57. - name: outputs
  58. persistentVolumeClaim:
  59. claimName: ad-outputs-pvc