mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
66643a5e6b
This adds a new `GRIST_SANDBOX_FLAVOR=pyodide` option where the version of Python used for the data engine is wasm, and so can be run by node like the rest of the back end. It still runs as a separate process. There are a few small version changes made to packages to avoid various awkwardnesses present in the current versions. All existing tests pass. This is very experimental. To use, you'll need something with a bash shell and make. First do: ``` cd sandbox/pyodide make setup # README.md and Makefile have details cd .. ``` Then running Grist as: ``` GRIST_SANDBOX_FLAVOR=pyodide yarn start ``` should work. Adding a formula with content: ``` import sys; return sys.version ``` should return a different Python version than other sandboxes. The motivation for this work is to have a form of sandboxing that will work on Windows for Grist Electron (for Linux we have gvisor/runsc, for Mac we have sandbox-exec, but I haven't found anything comparable for Windows). It also brings a back-end-free version of Grist a bit closer, for use-cases where that would make sense - such as serving a report (in the form of a Grist document) on a static site.
20 lines
564 B
Makefile
20 lines
564 B
Makefile
default:
|
|
echo "Welcome to the pyodide sandbox"
|
|
echo "make fetch_packages # gets python packages prepared earlier"
|
|
echo "make build_packages # build python packages from scratch"
|
|
echo "make save_packages # upload python packages to fetch later"
|
|
echo "setup # get pyodide node package"
|
|
|
|
fetch_packages:
|
|
node ./packages.js https://s3.amazonaws.com/grist-pynbox/pyodide/packages/ _build/packages/
|
|
|
|
build_packages:
|
|
./build_packages.sh
|
|
|
|
save_packages:
|
|
aws s3 sync _build/packages s3://grist-pynbox/pyodide/packages/
|
|
|
|
setup:
|
|
./setup.sh
|
|
make fetch_packages
|