Python snapshots: Add workerd cli options to save memory snapshots to disk - #1878
Conversation
6787e25 to
829315b
Compare
fac0b35 to
1761852
Compare
829315b to
8d2fe64
Compare
1761852 to
d5cd1a0
Compare
8d2fe64 to
84687f2
Compare
a0f220b to
9b718f6
Compare
|
Since this doesn't affect production, is an autogate actually necessary? Autogates exist for the purpose of rolling things out to production. Maybe this behavior should be enabled by something in workerd/server/server.c++ instead? |
|
@kentonv This makes sense, are there other development-only features that I could look at for inspiration? |
Perhaps |
84687f2 to
34da5ba
Compare
|
Seems like there's some overlap with #1851. Can you take a look? Specifically, is there a possibility to reuse the |
Yeah, this would make a lot of sense. |
9b718f6 to
a1da8c7
Compare
a1da8c7 to
9ef85a6
Compare
| if (ArtifactBundler.isEwValidating()) { | ||
| ArtifactBundler.storeMemorySnapshot(getMemoryToUpload()); | ||
| } else if (SHOULD_SNAPSHOT_TO_DISK) { | ||
| DiskCache.put("snapshot.bin", getMemoryToUpload()); |
There was a problem hiding this comment.
Not blocking, but I think we should name the snapshot something different for each worker, since eventually we want to load the snapshot from disk cache in addition to storing it. I think it may make sense to turn the python-save-snapshot flag into a string where the string is the file name, or use some other unique identifier for the worker.
There was a problem hiding this comment.
Yeah for now I just want some way to get snapshots onto disk that I can use for tests. Note that this doesn't even implement a way to load the snapshot in workerd, only to save it. Which is probably much higher priority than giving the files distinct names...
49ed68f to
a51eff5
Compare
18eb328 to
b965d89
Compare
No description provided.