-
Notifications
You must be signed in to change notification settings - Fork 83
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
Allow the user to specify a range of ports to use for child processes (Commit included) #73
Comments
Have you tried adding ruby from your container via remote interpreter integration? It will require only one open port for SSH connection and will push all required connections via SSH tunnel |
@denofevil I haven't. I saw that that was a thing, but didn't quite understand it. So I would have to add SSH to my container and then use RubyMine to launch my Unicorn server (using the remote ruby) and it would just do the right thing? Would that mean I wouldn't need this gem? |
@caleb, yes, you'll need just SSH to your container. The gem will be installed automatically and you won't need to specify port settings manually |
Cool! I'll give that a whirl. Thanks! UPDATE: This is very cool once I got it set up! |
I'm facing a very similar problem of debugging against a Rails application in a container. I appreciate that there is a workaround using SSH (and will investigate that path), but I also think the ability to control which ports are used for child process debugging could be a useful feature. Is that firmly not the direction you want to take ruby-debug-ide, or would you consider the the proposed solution @caleb presented in his commit? Container development often has a philosophy of minimal containers with minimal services, so having an SSH service readily available is not as much as a given as it would be for typical remote server integrations. |
I agree, this would be useful option - I actually figured out the same solution even before I ran into this issue. There was a problem with debugging session hanging and I tracked it down to this subprocess spawning and opening a random port, to which RubyMine had no access (because I'm also using Docker container with only certain ports being forwarded). I'm looking into SSH solution, but I don't really understand how it works with ruby-debug-ide - @caleb since you figured it out could you share some tips? Having a list of ports supplied to ruby-debug-ide instead of picking random port wouldn't hurt as an additional functionality though. It can fallback to random ports once the pool is exhausted, and it will probably require returning ports to the pool if process exits, so it may require a bit more work to be robust and bullet-proof. PS. Actually setting SSHD connection to Docker container is not that trivial either :( |
I posted a potential workaround that does not involve setting up SSH in your Docker container in issue #107: |
Hi,
First, I wanted to thank you for this cool gem. I'm moving over to RubyMine and the ability to do debugging easily in the IDE is very cool, even when I'm running my app in a docker container.
The only problem I have is that I am using an application server (Unicorn) that spawns multiple children, and the way
ruby-debug-ide
works now is that it picks a random port from the ephemeral port range for each child process and I don't really want to open all the possible ports to my docker container.I made a branch where I added a flag (--child-process-ports MIN-MAX) that lets the user specify a port range to use and whenever a child process is created it will pick a random port from that range that is open and use that instead. This way I can open up a few ports in docker and use that range for
ruby-debug-ide
, knowing that my unicorn will only ever have a few child processes.Here's the commit:
https://github.com/caleb/ruby-debug-ide/commit/4dcbef9962c1c67fc0b36717cd97594ca5e0c946
I didn't make a PR because I wanted to get your opinion on this feature.
Thanks again, I'm using this gem now by simply using a single process web server in development, but I'd like to use my production setup(-ish) in development if possible.
-Caleb
The text was updated successfully, but these errors were encountered: