-
Notifications
You must be signed in to change notification settings - Fork 234
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
Issues with writing the Lock file on the WASM runtime #2152
Comments
I "think" that the issue appeared when compiling with |
@andreaTP is this still an issue or can it be closed at this time? |
related #2149 |
@baywet I do believe that this is still an issue. Let me give you some context, on the Maven Plugin for Kiota I'm currently simply downloading and running the Kiota CLI as an external process. Unfortunately, looking at this discussion it looks unlikely to have support for File System operations any time soon from .NET. An option to support this use case would be to pass the utilities that are performing IO and system calls through interfaces to |
Thanks for the additional context here. It's strange those APIs don't work in your context, because it's exactly what we're doing with kiota web but maybe this is one of the subtle differences between blazor wasm and blazor web (I suspect the latter, being used by kiota web, adds additional layers under the hood) |
The root issue here is the lack of a File System API when targeting That said if I(ever) get the time to try to solve this, would you accept a PR doing the heavy lifting to decouple |
I'm on the fence for this aspect. First off, it's strange that wasi-wasm doesn't have file and http since it has multithreading and browser-wasm doesn't have it. My understanding was that wasi-wasm was leading the charge in terms of innovation and implementation and browser-wasm followed closely behind. If we were to make these changes let's try to dive into the details FileThere are a couple of places where file APIs are being used:
It should be fairly easy to identify all places and design interfaces to add levels or indirections, the question remains, what is the API surface of kiota builder going to look like? HttpThere are a couple of places where http client is being used:
The API surface is already requesting the http client to avoid the classical port exhaustion issue in dotnet for long lived processes. |
Thanks for reverting back!
this is not actually "strange" as FileAs far as I understand it, the WASI FS API is closer in semantics to a "sandboxed FS, hence it makes for a good in-browser experience but it doesn't have a semantic matching to a real File System implementation (explained in this discussion
this would be the starting point to prototype how changes will impact the codebase. As I already mentioned this issue has been opened mostly for tracking purposes and for gathering better context but is definitely not at the top of my current priorities. |
I've seen some pictures of the Red Hat summit, it looks pretty cool! Maybe next year we can present a joint session about Kiota and our collaboration? Not a top priority on our side as well at the moment, but I appreciate the open discussion here. One aspect is it'd represent a major breaking change in the API surface and would mandate a major version bump of the Kiota builder lib. I don't believe it's a big deal, but something to keep in mind. I guess that at this point the next step would be to design the interfaces and inventory the impact. |
This is actually JFokus, we had a session about something very different, but is an amazing conference(this year about 2000 ppl joining the event!) in the Java landscape.
I'll be honored to contribute to spreading this amazing project with you @baywet and the collaboration that is happening.
Amazing interaction as always 🙏 You are correct about the fact that it's going to be a breaking change and we would need to carefully handle the situation.
Agreed, but keeping it low in priorities as things might get easier over time given that both WASI and the |
I've been poking around that space for the last couple of hours. My take away is that even using a wasmconsole project, which is supposed to support node, the dotnet.js still has dependencies on browser functions (namely window, and the way it requires submodules). It does feel like all that space is super edgy at the moment and the team didn't have node/interoperability with other runtimes in mind when they started out. Browsers seem to be working great as we've demonstrated for kiota web and API curio. In conclusion I believe we should let this tech grow before investing too much in wasm portability for kiota and maintaining a npm package. That's unless I missed something and additional evidence comes along. |
another idea I'm currently exploring is using JSON-RPC. Effectively the vs code integration, spawns the process, interops with it using JSON RPC on stdin/out everytime it needs kiota. works like a charm. It might be a good alternative for your project as well. And we might want to consider maintaining an "official" kiota json RPC server. |
Thanks for sharing the process @baywet , in the Maven plugin, I'm already spawning the kiota cli as a separate process, in the context of this issue I was looking for a tighter integration/embedding. But, an interesting homework might be to support machine-readable output (e.g. |
If you want to have visibility over what I'm doing, check the feature/vscode-magic branch. Ignore the wasm part |
Update 21/07/2023 TLDR
MotivationI found this repository: https://github.com/lambdageek/sample-dotnet-wasi-vscode and it should be very much aligned with what @baywet attempted to do with the Kiota VS-Code extension. GoalVerify the current status of compiling Kiota to ExperimentHere you can find a super-hacked version of Kiota that actually runs on a WASI target(tested with Take-awaysA few useful considerations from the experiment:
NextI'm going on PTO tomorrow(so I might be slower in replies), but I can eventually work on those things.
ThanksThis spike could not have been done without the demo repositories of @lambdageek and @SteveSandersonMS , thanks a lot for the hard work! ❤️ |
Thanks for sharing your learnings with us. On our side this has become less of a priority because:
|
Thanks for the feedback @baywet !
Does this have any implications for the project? E.g. is the Blazor app going to be still tested or should I set up alternative infrastructure for the Apicurio integration? Or do you have any additional recommendations?
That's cool and I can't wait to see a demo 🙂 Regarding the WASI integration itself, would you be up to discussing possible steps forwards and eventually accepting PRs or is it a closed effort at all? |
Repo has already been cleared of any "web" aspects (blazor project, playwright, etc...)
that'd really depend on the scope. If we're talking about minor changes that don't impact the CLI experience to facilitate the wasm aspects, yes. If we're talking about major refactor efforts, or things that are detrimental to the CLI experience, we'll probably need to see a strong justification. |
Thanks for the clarification, I'll get back when I have a more consistent plan in mind and/or when technology catch up 🙂 |
Please open issues for the runtime repo. While That said, right now the workaround is, sadly, to do everything in a fully sync way. I am currently exploring that with my WIP MSBuild Log Viewer VS Code extension (https://github.com/lambdageek/MSBuildStructuredLog/tree/wasi-single-thread - send me an email inside MS, I'll share a brief demo video from last week) building on VS Code's recent WASI host work (https://code.visualstudio.com/blogs/2023/06/05/vscode-wasm-wasi). Interestingly, it's easier if you're starting from a legacy codebase that hadn't bought into |
Thanks for reaching out. We sunset our webapp and we setup a JSON RPC server for other integrations (outside of the browser). One of the reasons for that was the performance aspect. Another was the lack of some APIs (file access, http client, etc...) That would have required significant refactoring. Closing. |
I'm unable to reproduce locally, but this does happen with the output of a CI:
The text was updated successfully, but these errors were encountered: