-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: support using a shared sandbox instance #71
base: main
Are you sure you want to change the base?
Conversation
This looks like it's going generally in the right direction. There's a couple of things we can change up since we want to switch the defaults to the shared instance. |
Done. I have introduced a Also, I found out that Rust never calls |
70e76e3
to
01a28cd
Compare
Thinking about this again, since we're adding all these structs, it might just be simplest to purely have a single
yeah, multi might not be the best name. How about
Let me know if you hit a snag on this one. It's pretty complicated one to try to solve. Was trying to accomplish similar things on one of the first iterations of workspaces, but at-exit hooks are non-existent in rust |
01a28cd
to
3cc4eb8
Compare
@ChaoticTempest I have managed to resolve the problem in a roundabout way with the You can see a preview of changes I am proposing in this sandbox branch: https://github.com/near/sandbox/tree/daniyar/autocloseable. If you agree with the direction, I will open another PR to sandbox so we can discuss implementation details. Also I collapsed two sandbox implementations into one as you suggested. Personally I think it looks better now. |
@itegulov very interesting approach. I like it, but there's one concern I have with it since we need to make it cross platform, and there needs to be an equivalent way to kill the process for windows as well. I wonder if it would work the same with the equivalent windows kill command |
@ChaoticTempest I have access to a windows PC, so I am going to test it later today. |
Can we just modify the |
@matklad Yeah, the current state of https://github.com/near/sandbox/tree/daniyar/autocloseable is mostly a proof of concept. I just picked the path of least friction for now (otherwise I would have had to make a PR to nearcore). I will open a separate PR in sandbox repo and we can discuss which implementation makes the most sense. I am not 100% sure what kind of implications would be if we made NEAR node kill itself when stdin closes (but I guess we can always make it a configurable behaviour via a CLI parameter). |
@ChaoticTempest so I tried to test this on Windows, but I forgot that sandbox does not support Windows platform right now (probably because we don't publish binaries for it to AWS S3 as I think NEAR node itself does work on Windows). So testing this is not as straightforward. Also, in general is near-sandbox binary release process documented somewhere? I could not trace where you got this link from. |
This is a little more involved, but one way to test this is to compile nearcore sandbox on a windows machine, and have workspaces point to the binary via the
The link is just the aws bucket + nearcore commit hash. So if you get any commit hash from nearcore, and combined it with the AWS part, it would be valid link given enough time has passed for it to be uploaded. You can take a look at how it gets uploaded via: https://github.com/near/nearcore/blob/master/scripts/mac-release.sh |
As per my and @ChaoticTempest investigation, compiling nearcore on Windows is impossible right now due to how older versions (that are still being used by nearcore) of near/wasmer are written. We decided to put this issue on hold until nearcore finishes upgrade to wasmer 2.0 where some of the issues might get resolved. |
I wouldn't do such inference here: the code shouldn't be using sell/kill external command in the first place. |
Fixes #64
Creating this raw draft just to share the direction I am going in. I have tested the shared sandbox in its current state and it seems to be working fine (after I fixed the issue with TLA account creation race condition; see the second commit for more details).