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

🌈 Feature: Allow users to Hard Reboot Container Sandboxes #1461

Closed
Saeris opened this issue Jan 11, 2019 · 10 comments · Fixed by #1808
Closed

🌈 Feature: Allow users to Hard Reboot Container Sandboxes #1461

Saeris opened this issue Jan 11, 2019 · 10 comments · Fixed by #1808

Comments

@Saeris
Copy link
Contributor

Saeris commented Jan 11, 2019

I've noticed that in a number of cases, in order for container sandboxes to work properly, I either need to wait for the container to hibernate or I have to fork it. This is due to the current container behavior in which the first port that begins listening for requests on container startup gets locked into the container's configuration for the active lifetime of that container. While you can manually specify a port inside of the sandbox config, that setting will not take effect until the container is restarted.

To give users more control over containers, I'm requesting a new control inside of the Server Control Panel which users can click to hard reset the current container (right now they can only soft-reset, ie: kill the current node script and re-run npm start). This would solve this problem while also having the benefit of wiping the current container environment (ie: if a user used the terminal to make changes to the container's filesystem, manually installed programs, etc).

I'd also suggest adding an "Active Port" input to manually edit the port on which the container routes incoming HTTP requests, but that may be better suited for it's own issue.

@lbogdan
Copy link
Contributor

lbogdan commented Jan 14, 2019

Hey @Saeris ,
While your feature request is spot on (I too wanted to add that for some time), setting the port in sandbox.config.json and then restarting the sandbox by clicking the "Restart Sandbox" button should work, as the sandbox config file is re-read on each restart. At least that's how it should be, if you're seeing a different behavior, then it's probably a bug.

@CompuIves
Copy link
Member

@Saeris and I talked in person about this feature last week. I'll focus on implementing this feature this week!

@Saeris
Copy link
Contributor Author

Saeris commented Jan 14, 2019

Sweet, thanks @CompuIves!

Also, yes for clarification @lbogdan I brought this to Ives' attention specifically because I had to wait for my container to hibernate for the port settings in sandbox.config.json to take effect. If it is a bug, then consider this a bug report! However the other scenarios I mentioned should make implementing this feature request worth it.

@lbogdan
Copy link
Contributor

lbogdan commented Mar 22, 2019

@Saeris I just tested that the port defined in container.port in sandbox.config.json takes effect as soon as restarting the sandbox, although I don't remember specifically fixing this. 🙂

Can you maybe take another shot at it, and let me know if you experience the same behavior?

@Saeris
Copy link
Contributor Author

Saeris commented Apr 1, 2019

Appears to be working as expected now! Haven't run into any problems with it in the last week of working with containers.

@Saeris Saeris closed this as completed Apr 1, 2019
@lbogdan
Copy link
Contributor

lbogdan commented Apr 1, 2019

Reopening, as we still want to get this feature in. 🙂

@BananaAcid
Copy link

BananaAcid commented Sep 9, 2020

Reading this, it appears there is a "Restart Sandbox" button somewhere in the UI? Could you give me a hint where to find it?

@garethx
Copy link
Contributor

garethx commented Sep 10, 2020

@BananaAcid It's in the left-hand action menu (see pic: https://codesandbox.io/static/1d6dfabee25f328747ab5eaf38ff260d/5cc77/secrets-2.png) but it's only shown in container sandboxes (like Node).

@BananaAcid
Copy link

@garethx is there a way to activate those features on a sandbox derived from the "vanilla javascript" sandbox? I had modified the package json a while back to use nodemon instead of parcel and so on, but that did not enable those features (I see them when starting with "node HTTP server")

@garethx
Copy link
Contributor

garethx commented Sep 25, 2020

We're working on a way to enable this in the future, but for now no, sadly not - you'd need to fork from the node template you've seen and make your updates there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants