Repository navigation
Deploy a starter app to a Pixeltable Cloud trial from a codespace - #10
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An Open in GitHub Codespaces badge in the README, and a short "Try it on Pixeltable Cloud, no account" section.
.devcontainer/cloud.shdeploys an app to Cloud and makes one test call:pxt new(a free 48-hour trial database, no account), immediately prints the claim link, and adds the database topixeltable.tomlpxt db update; if an Anthropic key is supplied for chat-agent, sets the organization secret and restarts the database so its pods read itpxt schema updateandpxt service updatePOST /api/knowledge, then verifies that search returns its text; failed inserts, failed searches, and missing results fail the scriptRerunning it reuses the trial.
bash .devcontainer/cloud.sh video-searchdeploys the other app.bash .devcontainer/cloud.sh chat-agent pxt://org:dbdeploys to a database you already have.devcontainer.jsonaddsANTHROPIC_API_KEYas 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, sincepxt newfirst 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:
pxt db updatepxt newto first 200In the 331 s run:
Checked
ruff check,ruff format --check,pytest tests/(67 passed, 1 skipped), andshellcheckon both scripts.cloud.shend 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
/askwith the secret set.