Navigation Menu

Skip to content
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

Python support #2135

Open
bstrie opened this issue Aug 23, 2022 · 5 comments
Open

Python support #2135

bstrie opened this issue Aug 23, 2022 · 5 comments
Assignees
Labels
external Tracking remote issues in other repositories ux User experience

Comments

@bstrie
Copy link
Contributor

bstrie commented Aug 23, 2022

Python programs need to be well-supported on Enarx. cc #1646

@bstrie bstrie added external Tracking remote issues in other repositories ux User experience labels Aug 23, 2022
@rjzak
Copy link
Member

rjzak commented Aug 23, 2022

This may help: https://github.com/kateinoigakukun/wasi-vfs. Specifically if compiling Python (or something else) with the resulting ./target/wasm32-unknown-unknown/debug/libwasi_vfs.a, then using the wasi-vfs tool.

@rjzak
Copy link
Member

rjzak commented Aug 29, 2022

There's an issue with Python where it needs to get it's current working directory:

enarx run python.wasm 
Exception ignored error evaluating path:
Traceback (most recent call last):
  File "<frozen getpath>", line 353, in <module>
OSError: [Errno 76] Capabilities insufficient
Fatal Python error: error evaluating path
Python runtime state: core initialized

Related: WebAssembly/wasi-filesystem#24

@bstrie
Copy link
Contributor Author

bstrie commented Aug 29, 2022

After reaching out to some of the people involved in improving Python on WASM, they pointed me to two high-priority issues:

  1. In wasmtime CLI, passing --tcplisten argument breaks --dir bytecodealliance/wasmtime#3936
  2. wasmtime run -g fails with 'assertion failed: (left < right) bytecodealliance/wasmtime#4669

The first already has a patch from harald, but the maintainers need convincing that it's the proper fix. The second issue needs some investigation, which I'll be working on next.

@rjzak
Copy link
Member

rjzak commented Oct 18, 2022

LPython is an LLVM-based Python compiler and it supports WebAssembly as a target. Unfortunately, it only supports WebAssembly for the browser at the moment.

@nickvidal
Copy link
Member

Observations from @rjzak:

Nick Vidal, Oct 12, 4:32 PM
Were you able to get it working with Enarx?

Richard Zak, Oct 12, 4:32 PM
Doesn't work with Enarx because Python tries to open its current working directory and is unable to do so due to lacking filesystem support

Nick Vidal, Oct 12, 4:33 PM
Yes, I had trouble with that as well
But the packed wasm creates a VFS that is loaded in memory, right?

Richard Zak, Oct 12, 4:34 PM
Yes, but only for the library directory, not the directory the user is in

Nick Vidal, Oct 12, 4:34 PM
Ah, I see
Thanks for the clarification

Richard Zak, Oct 12, 4:35 PM
Nathaniel says the finished VFS support in Enarx will resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Tracking remote issues in other repositories ux User experience
Projects
Status: Backlog
Development

No branches or pull requests

3 participants