-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial WASM/Cross build factory code #322
Conversation
How many tests are skipped? Does the test suite pass? |
What is the goal of this work? Do you plan to add a buidbot worker? Which WASM target would it use? A browser? Node? Something else? |
Hi Victor! I am working with Brett and Christian (and several others) to make WebAssembly a supported platform for CPython eventually. Currently we run a nightly build and test job here: https://github.com/ethanhs/python-wasm/runs/6151353583?check_suite_focus=true Of course, to be supported we need to add a buildbot, so these changes are to set up a nodejs based worker. The current summary of the tests (just running
I believe that Microsoft has offered to donate a buildbot worker (if not I can likely donate one), and we will likely start with a nodejs based worker, since running the test suite in the browser would be difficult. I also factored out the cross build code because I figured it could come in handy in future for other buildbots. As I mention in my earlier comment, the WebAssembly buildbot will require a few tweaks to CPython itself. For example, some instances of calling |
At first we are going to use Node.JS with NODERAWFS for testing to ensure that Python compiles and works to wasm32-emscripten. Browser tests may follow in the future. The entire test suite was passing on Node.JS. Last time I tried one |
Please make sure that test.pythoninfo collects all versions useful to debug, like the Node.js version. The bare minimum would be to log the newly added sys._emscripten_info attribute: python/cpython#91781 Is the |
Is it possible to log Node.js options somehow in test.pythoninfo? It seems like there are many implementation for the filesystem: NODERAWFS, MEMFS, BrowserFS, IDB, etc. (depending on the target) Also please write a documentation somewhere explaining how to replicate the buildbot worker configuration, to reproduce the issue locally. For example, I expect that the Node.js version will matter, and how Node.js is run (options). |
The Node.JS version is not that useful. The relevant version is emsdk version. Since we are using node from emsdk, the emsdk version encodes all other relevant bits and pieces. |
So please log it into test.pythoninfo ;-) |
This is already documented in the |
|
Co-authored-by: Zachary Ware <[email protected]> Co-authored-by: Zachary Ware <[email protected]>
Co-authored-by: Ethan Smith <[email protected]>
Rebase, improve WASM code
Fix pkg-config cross build, add suffix to create unique workers
Hey @pablogsal I think this is ready for review, huge thanks to @tiran for making some needed fixes to push this forward :) |
This change adds bcannon-wasm worker. Is it owned by Brett Cannon? Do you have a password for this worker? |
@brettcannon has acquired a buildbot host for WASM. |
python/cpython#93844 adds documentation how to set up the SDKs and dependencies locally without a container. |
No password yet as I haven't asked for one. I've been waiting to be given the go-head from @tiran and @ethanhs that everything is in-place, then I'm going to acquire the appropriate Azure credits to set up a buildbot for this. |
You are good to go! I was able to run WASI and Emscripten Node tests with a local buildbot instance inside my EMSDK container. python/cpython#93844 adds documentation how to set up EMSDK, WASI-SDK and other dependencies on an Ubuntu VM for your buildbot. |
I'm going to be given a chunk of credits to use every month, so I've been asked to budget what we need. Is 8 GB RAM enough? 16 GB? How many CPUs to keep up with merges? @pablogsal @vstinner any ideas/suggestions? People can play with https://azure.microsoft.com/en-us/pricing/calculator/ if you're curious or have specific input to provide since I will be getting credits which means we can use whatever Azure services we want, I just need to give them an estimate. |
The instance will be testing Emscripten Node, Emscripten Browser (build-only, no tests yet), and WASI for 3.11 and main branch. I would go for at least 4 vCPUs. 8 vCPUs would be better, though. RAM wise, we are effectively testing 32bit programs. The extra memory consumption of NodeJS and wasmtime should not make a bit difference. So 8 GB RAM might be enough, 16 GB would not hurt, though. IMHO the smallest useful instance is B4ms (4 vCPU, 16 GB RAM) + 64 GiB SSD for persistent data ($150 USD/month or ~$1000 USD/year upfront). This should be good enough until we have more branches with WASM support. I would not object F8sv2 instances (8 vCPU, 16 GB RAM, optimized for computational load). It's twice as expensive as the B4ms instance. |
A B4ms instance runs the Emscripten Node tests with |
8GB is enough but if we plan to have a bunch of builders it uses parallel tests (we should because otherwise the worker will be quite behind on tests on busy days) I would recommend 2 or 4 cores if that's possible. |
I sent you a password in private. About the hardware, I would say that https://devguide.python.org/buildworker/#required-resources is outdated: a worker should have at least 1 GB. 4 GB should be better. More is good to have, but I don't think that it's required. In my experience, 50 GB of disk is short if you want to have multiple configs (like regular, LTO, PGO, clang, etc.). 100 GB of disk should be more comfortable. A single build takes around 600 MB of disk (on sub-directory in /home/buildbot/buildarea). Example with a RHEL8 worker:
On this RHEL8 machine, /tmp is part of /: it's mounted as ext4, not tmpfs. |
Thanks for the suggestions, everyone! I will play with the proposed amounts and see what I can get funding for. |
I have test instance running on an Azure VM using some free credits that will expire in a couple of weeks. Could you please merge the PR so we can give it a try?
|
Merged, thanks. @tiran: @brettcannon sent you the buildbot worker password? |
Yes, Brett sent me the password |
This is able to successfully cross compile Python on WASM, but fails on the
make pythoninfo
stage of the build, there need to be some fixes to CPython before this will work fully.I figured that a general cross-compiler factory would probably be useful in future, so I tried to make the code a bit more generic.
Things I still want to do:
make pythoninfo
works gh-84461: Add HOSTRUNNER for program to run Python executable cpython#91931make buildbottest
works gh-84461: Add ability for multiprocessed libregrtest to use a different Python executable cpython#91930Check that uploading results works?