Files
openmotion/deploy/k8s/api-deployment.yaml
open-design-crew[bot] 1765dd0b0b [OPEND-5936] OpenGame Stage 1 Cloud Launch: read-only MCP catalog, cookieless static play, 21-section skill & Game Studio (#1198)
* feat(game-static-play): add 274-template R2 zip packaging, cookieless static play deploy, and verification pipeline

* feat(game-skill): port 21-section OpenGame skill with dual-mode workflow and fast-play path

* feat(onboarding): upgrade Cloud MCP install guide and add shared OpenGame prompt builders

* feat(game-catalog): sync 274 official templates, 4 kits, downloads manifest, and game contract

* feat(cloud-mcp): add read-only game catalog, free asset search, guest catalog API, redirects, and Docker packaging

* feat(opengame): enable Stage 1 Game Studio routing, feature flags, and analytics

* feat(opengame): add Stage 1 market, multi-client modal, Cursor HTTP fix, SuperAgent prompt, and i18n

* fix(opengame): align nullable GameCardWithMeta fields and add opengame-catalog MCP capability

* test(mcp-onboarding): update registered public tool count from 22 to 24 for Stage 1 game tools

* chore(game-catalog): register 26 verified live R2 in-repo template bundles in game-downloads.json

* fix(opengame): address Stage 1 review feedback and failing CI lanes

- Send no play URL when GAME_PLAY_PUBLIC_ORIGIN is unset instead of a main-site
  path that no route serves; Studio falls back to bundled in-repo templates
- Keep legacy-host 301 redirects on the configured origin for network-path inputs
- Correct the BlenderKit page host in the asset search allowlist
- Reuse the shared withdrawn list, TOP earning tag, curated order and comparator in Studio
- Remove the unused shared prompt module; the shipped builders stay covered by Studio tests
- Drop the blurred launch backdrop and the in-dialog copy notices in favour of Toasts
- Describe the shipped read-only Game Studio boundary and 24-tool MCP contract in the architecture
- Schedule the game skill and static play suites in CI and budget the three OpenGame events

* fix(game-static-play): retry stalled template bundle downloads before failing the run

* fix(game-asset-search): size the pagination cursor limit for every supported query

A 200-unit query with non-ASCII, control or lone-surrogate characters produced a
cursor longer than the 512-character limit, so nextCursor was rejected by both
the decoder and the public schema. Share one limit derived from the worst-case
JSON/base64url expansion and add a round-trip test for maximum-length queries.

* fix(game-asset-search): accept BlenderKit pages on www.blendkit.com and guide licence checks

www.blenderkit.com now redirects to www.blendkit.com and the upstream catalog
returns that host, so requiring www.blenderkit.com dropped every BlenderKit
result. Restore the live host, pin a real upstream row in tests, and tell
Agents to confirm the licence on the source page when a source omits it.

* fix(deploy): forward game play origin and legacy redirect hosts to the API

deploy/.env.example and deploy/k8s/configmap.yaml declared GAME_PLAY_PUBLIC_ORIGIN
and APP_REDIRECT_FROM_HOSTS, but neither the compose api service nor the reference
api Deployment passed them to the process. Wire both and assert that every
reference ConfigMap key is read by a workload.

* Address review: keep legacy-host writes, enforce play-origin isolation, share catalog constants

- Legacy-host redirects answer GET/HEAD with 301 and every other method with 308,
  so MCP and API writes keep their method and body.
- parseConfig rejects a GAME_PLAY_PUBLIC_ORIGIN that is not https (loopback http
  excepted), carries a path, or shares or sits under the APP_PUBLIC_ORIGIN host.
- The template id pattern, bundle key prefix, withdrawn set and TOP tag predicate
  live in shared/game-contract.ts; static play, deploy/verify scripts and the
  catalog service reuse them and the shared bundle URL builder.
- Remove unused game-contract and model-catalog exports.
- Update the MCP contract, AGENTS.md, README and docs to the 24-name phase-one
  surface and document the read-only OpenGame tools and guest catalog routes.

* fix(game-static-play): make the full play-site upload resumable

Upload through the S3 SDK instead of one aws CLI process per file, skip
objects whose ETag already matches the local MD5, retry each request with
backoff, and write assets before entry pages and the manifest. Give large
bundle downloads time for a slow link. Record the provisioned bucket,
domain and remaining header rule in the runbook.

* feat(game-static-play): harden live play verification and add manual R2 publish workflow

* fix(opengame): raise prompt/remix maxLength for >4k OG-13 test and reset notes on target change

* fix(mcp): register resources/templates/list handler for Codex MCP compliance

* chore(game-catalog): register uploaded tidebreaker bundle for 274/274 R2 CDN parity

---------

Co-authored-by: heggria <bshengtao@gmail.com>
2026-11-30 23:39:22 -08:00

446 lines
15 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: openmotion-api
namespace: openmotion
labels:
app.kubernetes.io/name: openmotion-api
app.kubernetes.io/component: api
app.kubernetes.io/part-of: openmotion
spec:
replicas: 2
revisionHistoryLimit: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app.kubernetes.io/name: openmotion-api
app.kubernetes.io/component: api
template:
metadata:
labels:
app.kubernetes.io/name: openmotion-api
app.kubernetes.io/component: api
app.kubernetes.io/part-of: openmotion
spec:
serviceAccountName: openmotion-api
automountServiceAccountToken: false
terminationGracePeriodSeconds: 60
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: api
image: ghcr.io/nexu-io/openmotion-api:latest
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 4173
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
env:
- name: WORKER_ROLE
value: "api"
- name: NODE_ENV
valueFrom:
configMapKeyRef:
name: openmotion-config
key: NODE_ENV
- name: APP_PUBLIC_ORIGIN
valueFrom:
configMapKeyRef:
name: openmotion-config
key: APP_PUBLIC_ORIGIN
- name: PREVIEW_PUBLIC_ORIGIN
valueFrom:
configMapKeyRef:
name: openmotion-config
key: PREVIEW_PUBLIC_ORIGIN
optional: true
- name: GAME_PLAY_PUBLIC_ORIGIN
valueFrom:
configMapKeyRef:
name: openmotion-config
key: GAME_PLAY_PUBLIC_ORIGIN
optional: true
- name: APP_REDIRECT_FROM_HOSTS
valueFrom:
configMapKeyRef:
name: openmotion-config
key: APP_REDIRECT_FROM_HOSTS
optional: true
- name: PREVIEW_TOKEN_TTL_SEC
valueFrom:
configMapKeyRef:
name: openmotion-config
key: PREVIEW_TOKEN_TTL_SEC
optional: true
- name: PORT
valueFrom:
configMapKeyRef:
name: openmotion-config
key: PORT
- name: BIND_HOST
valueFrom:
configMapKeyRef:
name: openmotion-config
key: BIND_HOST
- name: LOG_LEVEL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: LOG_LEVEL
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: DATABASE_URL
- name: PG_POOL_MAX
valueFrom:
configMapKeyRef:
name: openmotion-config
key: PG_POOL_MAX
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: REDIS_URL
- name: REDIS_CACHE_URL
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: REDIS_CACHE_URL
optional: true
- name: REDIS_CACHE_TTL_SEC
valueFrom:
configMapKeyRef:
name: openmotion-config
key: REDIS_CACHE_TTL_SEC
- name: S3_ENDPOINT
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_ENDPOINT
optional: true
- name: S3_PUBLIC_ENDPOINT
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_PUBLIC_ENDPOINT
optional: true
- name: S3_REGION
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_REGION
- name: S3_BUCKET
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_BUCKET
- name: S3_FORCE_PATH_STYLE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_FORCE_PATH_STYLE
- name: S3_PRESIGN_PUT_TTL_SEC
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_PRESIGN_PUT_TTL_SEC
- name: S3_PRESIGN_GET_TTL_SEC
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_PRESIGN_GET_TTL_SEC
- name: S3_PRESIGN_CACHE_WINDOW_SEC
valueFrom:
configMapKeyRef:
name: openmotion-config
key: S3_PRESIGN_CACHE_WINDOW_SEC
optional: true
- name: S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: S3_ACCESS_KEY_ID
optional: true
- name: S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: S3_SECRET_ACCESS_KEY
optional: true
- name: AUTH_MODE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: AUTH_MODE
- name: ALLOW_INSECURE_DEV_AUTH
valueFrom:
configMapKeyRef:
name: openmotion-config
key: ALLOW_INSECURE_DEV_AUTH
- name: TRUST_PROXY_HOPS
valueFrom:
configMapKeyRef:
name: openmotion-config
key: TRUST_PROXY_HOPS
- name: SESSION_SECRET
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: SESSION_SECRET
- name: OIDC_ISSUER
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_ISSUER
- name: OIDC_CLIENT_ID
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CLIENT_ID
- name: OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: OIDC_CLIENT_SECRET
optional: true
- name: OIDC_CALLBACK_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CALLBACK_URL
optional: true
- name: OIDC_SCOPES
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_SCOPES
- name: OIDC_CLAIM_SUB
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CLAIM_SUB
- name: OIDC_CLAIM_EMAIL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CLAIM_EMAIL
- name: OIDC_CLAIM_NAME
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CLAIM_NAME
- name: OIDC_CLAIM_WORKSPACE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OIDC_CLAIM_WORKSPACE
optional: true
- name: MCP_OAUTH_MODE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: MCP_OAUTH_MODE
- name: MCP_OAUTH_ISSUER
valueFrom:
configMapKeyRef:
name: openmotion-config
key: MCP_OAUTH_ISSUER
optional: true
- name: MCP_MAX_BODY_BYTES
valueFrom:
configMapKeyRef:
name: openmotion-config
key: MCP_MAX_BODY_BYTES
- name: MODEL_GATEWAY_MODE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: MODEL_GATEWAY_MODE
- name: OPENDESIGN_API_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_API_URL
- name: OPENDESIGN_LINK_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_LINK_URL
- name: OPENDESIGN_CONSOLE_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_CONSOLE_URL
- name: OPENDESIGN_PRICING_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_PRICING_URL
optional: true
- name: OPENDESIGN_ONE_TAP_INTERNAL_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_ONE_TAP_INTERNAL_URL
optional: true
- name: OPENDESIGN_ONE_TAP_INTERNAL_TOKEN
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: OPENDESIGN_ONE_TAP_INTERNAL_TOKEN
optional: true
- name: OPENDESIGN_S2S_API_KEY
valueFrom:
secretKeyRef:
name: openmotion-secrets
key: OPENDESIGN_S2S_API_KEY
- name: OPENDESIGN_ASR_URL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_ASR_URL
optional: true
- name: OPENDESIGN_BILLING_SYNC_ENABLED
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENDESIGN_BILLING_SYNC_ENABLED
- name: ALLOW_DOH_FAKEIP_FALLBACK
valueFrom:
configMapKeyRef:
name: openmotion-config
key: ALLOW_DOH_FAKEIP_FALLBACK
- name: HISTORY_COALESCE_WINDOW_MS
valueFrom:
configMapKeyRef:
name: openmotion-config
key: HISTORY_COALESCE_WINDOW_MS
optional: true
- name: SENTRY_WEB_DSN
valueFrom:
configMapKeyRef:
name: openmotion-config
key: SENTRY_WEB_DSN
optional: true
- name: SENTRY_ENVIRONMENT
valueFrom:
configMapKeyRef:
name: openmotion-config
key: SENTRY_ENVIRONMENT
optional: true
- name: SENTRY_RELEASE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: SENTRY_RELEASE
optional: true
- name: SENTRY_TRACES_SAMPLE_RATE
valueFrom:
configMapKeyRef:
name: openmotion-config
key: SENTRY_TRACES_SAMPLE_RATE
optional: true
- name: OPENMOTION_TRACKING_ENABLED
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_TRACKING_ENABLED
optional: true
- name: OPENMOTION_CLOUD_TRACKING_FULL
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_CLOUD_TRACKING_FULL
optional: true
- name: OPENMOTION_POSTHOG_TOKEN
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_POSTHOG_TOKEN
optional: true
- name: OPENMOTION_POSTHOG_HOST
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_POSTHOG_HOST
optional: true
- name: OPENMOTION_TRACKING_INSTALLATION_ID
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_TRACKING_INSTALLATION_ID
optional: true
- name: OPENMOTION_TRACERT_SPM_A
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_TRACERT_SPM_A
optional: true
- name: OPENMOTION_TRACERT_ENDPOINT
valueFrom:
configMapKeyRef:
name: openmotion-config
key: OPENMOTION_TRACERT_ENDPOINT
optional: true
livenessProbe:
httpGet:
path: /api/health/live
port: http
initialDelaySeconds: 10
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /api/health/ready
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "2000m"
memory: "2Gi"
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir:
sizeLimit: 64Mi
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: openmotion-api
namespace: openmotion
labels:
app.kubernetes.io/name: openmotion-api
app.kubernetes.io/component: api
app.kubernetes.io/part-of: openmotion
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/name: openmotion-api
app.kubernetes.io/component: api