Skip to content

Deploy a starter app to a Pixeltable Cloud trial from a codespace - #10

Merged
pierrebrunelle merged 3 commits into
mainfrom
codespaces-cloud-deploy
Oct 11, 2026
Merged

pierrebrunelle merged 3 commits into
mainfrom
codespaces-cloud-deploy

Conversation

@pierrebrunelle

@pierrebrunelle pierrebrunelle commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

What

  • An Open in GitHub Codespaces badge in the README, and a short "Try it on Pixeltable Cloud, no account" section.

  • .devcontainer/cloud.sh deploys an app to Cloud and makes one test call:

    • runs pxt new (a free 48-hour trial database, no account), immediately prints the claim link, and adds the database to pixeltable.toml
    • waits until the database finishes provisioning; exits on failure or after a 10-minute timeout
    • runs pxt db update; if an Anthropic key is supplied for chat-agent, sets the organization secret and restarts the database so its pods read it
    • runs pxt schema update and pxt service update
    • inserts one row through POST /api/knowledge, then verifies that search returns its text; failed inserts, failed searches, and missing results fail the script

    Rerunning it reuses the trial. bash .devcontainer/cloud.sh video-search deploys the other app. bash .devcontainer/cloud.sh chat-agent pxt://org:db deploys to a database you already have.

  • devcontainer.json adds ANTHROPIC_API_KEY as an optional secret on the codespace creation page. The script stores it as an organization secret for /ask.

  • Both apps now require pixeltable[serve]>=0.7.16, since pxt new first shipped in 0.7.13.

  • Both apps install CPU-only torch on Linux through a uv source. macOS and Windows keep PyPI's torch.

Why CPU torch

On Linux, PyPI's torch pulls 3 GB of CUDA wheels that these CPU-only apps never use. Cloud builds the database image from this lock, so every deploy paid for them.

Measured on dev, chat-agent, from a fresh trial:

CUDA torch (main) CPU torch (this PR)
x86_64 wheels 3.38 GB 0.58 GB
pxt db update 724 s about 170 s
pxt new to first 200 about 18 min 331 s

In the 331 s run:

  • the trial existed at 6 s and its database was ready at 53 s
  • the image built in 50 s and pushed in 67 s
  • the service was ready at 321 s
  • the search returned the inserted row
  • a wrong key got 401

Checked

  • ruff check, ruff format --check, pytest tests/ (67 passed, 1 skipped), and shellcheck on both scripts.
  • 17 regression cases run the actual shell script with mocked CLI and HTTP responses: secret restarts for new and existing databases, provisioning timeout and terminal failures, readiness on the last poll, claim-link visibility on deployment and smoke failures, and search-content verification. The original script fails 10 of these cases; the fixed script passes all 17.
  • GitHub CI passed on Linux and macOS with Python 3.11 and 3.12, including schema import and schema apply/diff checks.
  • Before this revision: cloud.sh end to end on dev, from a fresh trial and as a rerun on an existing one. No new live Cloud deployment was run for this revision.

Not checked yet

pierrebrunelle and others added 2 commits October 11, 2026 12:54
pxt new, which the Codespaces deploy script uses, first shipped in 0.7.13.

On Linux, PyPI's torch pulls 3 GB of CUDA wheels that these CPU-only apps never use.
Pixeltable Cloud builds a database image from this lock, so a chat-agent deploy on dev
went from 724 s to about 170 s for `pxt db update`, and a fresh trial to a working
route from about 18 minutes to 331 s. macOS and Windows keep PyPI's torch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README gets an Open in Codespaces badge. In the codespace,
`bash .devcontainer/cloud.sh` runs pxt new (a free trial database, no account),
waits for it to provision, uploads the app, creates its tables, starts its service,
calls /api/knowledge once, and prints the claim link. Rerunning it reuses the trial.

The codespace creation page offers ANTHROPIC_API_KEY as an optional secret;
the script stores it as an organization secret for /ask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Devin Review

Comment thread .devcontainer/cloud.sh Resolved
Comment thread .devcontainer/cloud.sh Resolved
Comment thread .devcontainer/cloud.sh Resolved
Comment thread .devcontainer/cloud.sh Resolved
@pierrebrunelle
pierrebrunelle merged commit 15824a3 into main Oct 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant