quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
148 stars 22 forks source link

Script for running Model builds #3157

Closed OAGr closed 2 months ago

OAGr commented 3 months ago

Run pnpm run build-last-revision, to build the last revision. This will create a "build", that will run the squiggle model, and save the Exports for that revision, if it succeeds. If it fails, it will store a simple string error message.

image
changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: f87b34fa94f45eef23ec1aad7f524a08c489bbe6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview Apr 12, 2024 2:36am
3 Ignored Deployments | Name | Status | Preview | Updated (UTC) | | :--- | :----- | :------ | :------ | | **quri-ui** | ⬜️ Ignored ([Inspect](https://vercel.com/quantified-uncertainty/quri-ui/6wUajD5XpVpCAhvFBcEMUoVKcDBA)) | [Visit Preview](https://quri-ui-git-runner-test-quantified-uncertainty.vercel.app) | Apr 12, 2024 2:36am | | **squiggle-components** | ⬜️ Ignored ([Inspect](https://vercel.com/quantified-uncertainty/squiggle-components/Hgxwb6WutP7JLDx5f1htfwy6uF6y)) | [Visit Preview](https://squiggle-components-git-runner-test-quantified-uncertainty.vercel.app) | Apr 12, 2024 2:36am | | **squiggle-website** | ⬜️ Ignored ([Inspect](https://vercel.com/quantified-uncertainty/squiggle-website/2G6EedsabDy7Woxjtb5HxKEWq26Y)) | [Visit Preview](https://squiggle-website-git-runner-test-quantified-uncertainty.vercel.app) | Apr 12, 2024 2:36am |
OAGr commented 3 months ago

My main concern is that buildRecentModelRevision will get stuck on the first model that will fail because of memory or almost-infinite loops.

Yea, I thought about that too. Wasn't sure how likely it would be.

Seems simple enough to try this, then handle errors when they come, or in future PRs. As you know, I like doing things incrementally.

OAGr commented 3 months ago

So maybe something like buildStatus field should be stored on the DB level? Probably makes more sense in ModelRevisionBuild, not on ModelRevision. Then we could inject the build flagged as pending immediately, and then update it after the job is completed.

It might even make sense to separate "build results" (squiggle output + errors) from "build runs" (jobs for running a build). Then we won't have to worry about null fields on pending builds.

I imagine this is the most critical if we have multiple workers that can build items that are pending - this way they wouldn't conflict with each other. I'm not sure how much of a priority this is though, it might be a while until we have that.