Skip to content

Commit 2a1fc86

Browse files
os-zhuanghotlongCopilot
authored
chore: remove apps/cloud (split to objectstack-ai/cloud) (#1257)
* chore: remove apps/cloud (split to objectstack-ai/cloud repo) The cloud control plane (cloud.objectos.app) is now built and deployed from the private split repo objectstack-ai/cloud as part of the public core / private cloud split (ADR planning ref: §1 of session plan.md). Changes: - Delete apps/cloud entirely (32 files, ~2.7K LOC removed). - Drop "dev:cloud" script from root package.json. - Slim .github/workflows/deploy.yml to objectos-only: - Workflow renamed to 'Deploy ObjectOS to Cloudflare Containers'. - Removed cloud job + plan-target input + deploy-cloud-* / deploy-all-* tag triggers. - Cloud deploy now lives in objectstack-ai/cloud's own workflow. What remains coupled (separate follow-up): - packages/services/service-cloud still re-exported by framework packages/runtime + packages/cli. Decoupling is tracked separately (todo id: framework-decouple-service-cloud). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(runtime): align with sys_project → sys_environment rename Pre-existing test drift from ADR-0006 project→environment rename: production code reads sys_environment / sys_environment_member with environment_id columns, but four tests still expected the old names. This commit only renames in tests; no production code changes. Fixes 4 failing tests in: - packages/runtime/src/http-dispatcher.test.ts (RBAC membership lookup) - packages/runtime/src/cloud/platform-sso.test.ts (backfill scanning) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(cli): graceful failure when service-cloud is unavailable The cloud/runtime boot mode dispatch dynamically imports @objectstack/service-cloud. Previously a missing/broken install would fail with an opaque ERR_MODULE_NOT_FOUND stack trace. Wrap the import in try/catch and surface a clear, actionable error that tells the user to either install the package or switch to bootMode= 'standalone'. This is the only remaining hard dependency surface between the CLI and service-cloud — the other framework packages (runtime, rest, adapters/hono) already use structural / 'any'-typed interfaces. Decoupling note: physically moving service-cloud out of the framework workspace into the private cloud repo is a separate design decision (would break cli's monorepo build of cloud-aware boot modes). Tracked as a follow-up; not in scope here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove packages/services/service-cloud (split to objectstack-ai/cloud repo) The control-plane service-cloud package now lives in the private cloud repo (objectstack-ai/cloud) alongside apps/cloud. Framework consumers already use only the structural `KernelManager` / `EnvironmentDriverRegistry` interfaces (any-typed) or dynamic `await import('@objectstack/service-cloud')` with try/catch fallbacks. No real imports remained — only doc comments. Changes: - packages/services/service-cloud/ deleted (~10k LOC, 56 files). - packages/cli/package.json: drop "@objectstack/service-cloud":"workspace:*" dependency. CLI's serve.ts already handles missing module gracefully via dynamic import + try/catch (commit e69da73). - packages/cli/src/types/service-cloud.d.ts retained as ambient stub so TS still compiles the optional dynamic import path. - pnpm-lock.yaml refreshed (-89 lines). Verified: `pnpm turbo run test` → 108/108 tasks green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Jack Zhuang <50353452+hotlong@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 64875c0 commit 2a1fc86

93 files changed

Lines changed: 35 additions & 13866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 16 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
name: Deploy to Cloudflare Containers
1+
name: Deploy ObjectOS to Cloudflare Containers
22

33
# ─────────────────────────────────────────────────────────────────────────
4-
# Build + push Docker images for cloud (cloud.objectos.app) and/or
5-
# objectos (single-project runtime per env), then `wrangler deploy` the
4+
# Build + push Docker image for the objectos runtime (single-project
5+
# per-env containers fronting *.objectos.app), then `wrangler deploy` the
66
# matching Worker so the new image is pinned.
77
#
8+
# NOTE: Cloud (cloud.objectos.app) deployment lives in the split private
9+
# repo objectstack-ai/cloud and is NOT triggered from this workflow.
10+
#
811
# Triggers:
9-
# 1. Manual: Actions → "Deploy to Cloudflare Containers" → Run
10-
# (choose `target` = cloud | objectos | both, and optionally
11-
# the commit SHA to deploy; defaults to the workflow ref).
12-
# 2. Tag: push a tag matching `deploy-cloud-*`, `deploy-objectos-*`,
13-
# or `deploy-all-*`. The tag suffix is informational; the
14-
# image tag = the resolved commit SHA (short, 8 chars) so a
15-
# redeploy of the same SHA is idempotent.
12+
# 1. Manual: Actions → "Deploy ObjectOS to Cloudflare Containers" → Run
13+
# (optionally provide commit SHA; defaults to workflow ref).
14+
# 2. Tag: push a tag matching `deploy-objectos-*`. The tag suffix is
15+
# informational; the image tag = the resolved commit SHA
16+
# (short, 8 chars) so a redeploy of the same SHA is idempotent.
1617
#
1718
# Image naming:
18-
# registry.cloudflare.com/<ACCOUNT_ID>/objectstack-cloud:<sha8>
1919
# registry.cloudflare.com/<ACCOUNT_ID>/objectos:<sha8>
2020
#
21-
# The corresponding `apps/<target>/wrangler.toml` is rewritten in-place to
22-
# pin `image = "<registry>:<sha8>"` and committed back to `main` so the
23-
# repo always tracks what is actually deployed.
21+
# `apps/objectos/wrangler.toml` is rewritten in-place to pin
22+
# `image = "<registry>:<sha8>"` and committed back to `main` so the repo
23+
# always tracks what is actually deployed.
2424
#
2525
# Required secrets (Repository → Settings → Secrets and variables → Actions):
2626
# CLOUDFLARE_API_TOKEN — token with Containers:Edit + Workers:Edit perms
@@ -30,37 +30,22 @@ name: Deploy to Cloudflare Containers
3030
on:
3131
workflow_dispatch:
3232
inputs:
33-
target:
34-
description: 'Which app(s) to deploy'
35-
required: true
36-
default: 'both'
37-
type: choice
38-
options:
39-
- cloud
40-
- objectos
41-
- both
4233
ref:
4334
description: 'Commit SHA or branch to deploy (default: workflow ref)'
4435
required: false
4536
default: ''
4637
push:
4738
tags:
48-
- 'deploy-cloud-*'
4939
- 'deploy-objectos-*'
50-
- 'deploy-all-*'
5140

5241
concurrency:
53-
# Serialize deploys per-target so two pushes don't race on `wrangler deploy`.
54-
group: deploy-${{ github.event.inputs.target || github.ref_name }}
42+
group: deploy-objectos-${{ github.ref_name }}
5543
cancel-in-progress: false
5644

5745
jobs:
58-
# ── Resolve which targets to build based on the trigger ──
5946
plan:
6047
runs-on: ubuntu-latest
6148
outputs:
62-
deploy_cloud: ${{ steps.plan.outputs.deploy_cloud }}
63-
deploy_objectos: ${{ steps.plan.outputs.deploy_objectos }}
6449
sha: ${{ steps.plan.outputs.sha }}
6550
sha8: ${{ steps.plan.outputs.sha8 }}
6651
steps:
@@ -71,143 +56,20 @@ jobs:
7156
fetch-depth: 1
7257

7358
- id: plan
74-
name: Plan targets + resolve SHA
59+
name: Resolve SHA
7560
run: |
7661
set -euo pipefail
7762
SHA="$(git rev-parse HEAD)"
7863
SHA8="$(git rev-parse --short=8 HEAD)"
7964
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
8065
echo "sha8=$SHA8" >> "$GITHUB_OUTPUT"
81-
82-
DEPLOY_CLOUD=false
83-
DEPLOY_OBJECTOS=false
84-
case "${{ github.event_name }}" in
85-
workflow_dispatch)
86-
T="${{ github.event.inputs.target }}"
87-
[[ "$T" == "cloud" || "$T" == "both" ]] && DEPLOY_CLOUD=true
88-
[[ "$T" == "objectos" || "$T" == "both" ]] && DEPLOY_OBJECTOS=true
89-
;;
90-
push)
91-
REF="${{ github.ref_name }}"
92-
[[ "$REF" == deploy-cloud-* || "$REF" == deploy-all-* ]] && DEPLOY_CLOUD=true
93-
[[ "$REF" == deploy-objectos-* || "$REF" == deploy-all-* ]] && DEPLOY_OBJECTOS=true
94-
;;
95-
esac
96-
97-
echo "deploy_cloud=$DEPLOY_CLOUD" >> "$GITHUB_OUTPUT"
98-
echo "deploy_objectos=$DEPLOY_OBJECTOS" >> "$GITHUB_OUTPUT"
9966
echo "─────────────────────────────────"
10067
echo "Trigger: ${{ github.event_name }}"
10168
echo "SHA: $SHA"
10269
echo "Image tag: $SHA8"
103-
echo "Cloud: $DEPLOY_CLOUD"
104-
echo "ObjectOS: $DEPLOY_OBJECTOS"
105-
106-
# ── Build + push cloud image; pin tag in wrangler.toml; wrangler deploy ──
107-
cloud:
108-
needs: plan
109-
if: needs.plan.outputs.deploy_cloud == 'true'
110-
runs-on: ubuntu-latest
111-
permissions:
112-
contents: write # to commit the wrangler.toml tag bump back to main
113-
env:
114-
ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
115-
IMAGE_NAME: objectstack-cloud
116-
SHA8: ${{ needs.plan.outputs.sha8 }}
117-
steps:
118-
- uses: actions/checkout@v5
119-
with:
120-
ref: ${{ needs.plan.outputs.sha }}
121-
# Need full history so we can push back the tag-bump commit.
122-
fetch-depth: 0
123-
token: ${{ secrets.GITHUB_TOKEN }}
124-
125-
- name: Set up pnpm
126-
uses: pnpm/action-setup@v4
127-
128-
- name: Set up Node
129-
uses: actions/setup-node@v4
130-
with:
131-
node-version: 22
132-
cache: pnpm
133-
134-
- name: Install workspace deps (for wrangler bundle)
135-
run: pnpm install --frozen-lockfile --prefer-offline
136-
137-
- name: Set up Docker Buildx
138-
uses: docker/setup-buildx-action@v3
139-
140-
- name: Build cloud image (local)
141-
uses: docker/build-push-action@v6
142-
with:
143-
context: .
144-
file: apps/cloud/Dockerfile
145-
platforms: linux/amd64
146-
# Load to the local daemon — `wrangler containers push` reads from
147-
# the local daemon and re-pushes with Cloudflare-issued temporary
148-
# registry credentials (the registry rejects plain docker login).
149-
load: true
150-
tags: registry.cloudflare.com/${{ env.ACCOUNT_ID }}/${{ env.IMAGE_NAME }}:${{ env.SHA8 }}
151-
# GitHub Actions cache — drops cloud rebuild from ~20m to ~3-6m
152-
# after the first run.
153-
cache-from: type=gha,scope=cloud
154-
cache-to: type=gha,scope=cloud,mode=max
155-
156-
- name: Push image via wrangler (handles CF registry auth)
157-
env:
158-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
159-
CLOUDFLARE_ACCOUNT_ID: ${{ env.ACCOUNT_ID }}
160-
run: |
161-
npx --yes wrangler@4 containers push \
162-
"registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}"
163-
164-
- name: Pin image tag in wrangler.toml
165-
run: |
166-
set -euo pipefail
167-
NEW="registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}"
168-
sed -i -E "s#^image = .*${IMAGE_NAME}:.*#image = \"${NEW}\"#" apps/cloud/wrangler.toml
169-
echo "Pinned to: $NEW"
170-
grep '^image' apps/cloud/wrangler.toml
171-
172-
- name: Wrangler deploy (cloud)
173-
working-directory: apps/cloud
174-
env:
175-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
176-
CLOUDFLARE_ACCOUNT_ID: ${{ env.ACCOUNT_ID }}
177-
run: npx --yes wrangler@4 deploy --config wrangler.toml
178-
179-
- name: Commit pinned tag back to main
180-
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
181-
run: |
182-
set -euo pipefail
183-
if git diff --quiet apps/cloud/wrangler.toml; then
184-
echo "No tag change to commit."
185-
exit 0
186-
fi
187-
git config user.name "github-actions[bot]"
188-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
189-
git checkout -B deploy/cloud-${SHA8}
190-
git add apps/cloud/wrangler.toml
191-
git commit -m "chore(deploy): pin cloud image tag to ${SHA8}
192-
193-
Auto-bumped by .github/workflows/deploy.yml after successful Cloudflare
194-
Containers deploy of registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}.
195-
196-
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
197-
# Fast-forward push to main if possible; otherwise leave the branch
198-
# for a human to PR. We never force-push main.
199-
git fetch origin main
200-
if git merge-base --is-ancestor origin/main HEAD; then
201-
git push origin HEAD:main
202-
else
203-
git push origin HEAD
204-
echo "::warning::Could not fast-forward main; pushed branch deploy/cloud-${SHA8} instead. Open a PR."
205-
fi
20670
207-
# ── Build + push objectos image; pin tag; wrangler deploy ──
20871
objectos:
20972
needs: plan
210-
if: needs.plan.outputs.deploy_objectos == 'true'
21173
runs-on: ubuntu-latest
21274
permissions:
21375
contents: write

apps/cloud/.dockerignore

Lines changed: 0 additions & 49 deletions
This file was deleted.

apps/cloud/.env.cloudflare.example

Lines changed: 0 additions & 13 deletions
This file was deleted.

apps/cloud/.env.cloudflare.secrets.example

Lines changed: 0 additions & 42 deletions
This file was deleted.

apps/cloud/.gitignore

Lines changed: 0 additions & 27 deletions
This file was deleted.

apps/cloud/CHANGELOG.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)