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
describe remote scenariuos #3505
Conversation
describe remote scenarious
|
In order to get more concrete in my use case, I would come up with some ssh and shell magic. In my remote devcontainer scenario I use a shell comand such as this to start a nrepl in the remote container and forward the port to local: This requires as well a "appPort": [
"12345:12345", // for cider
],Now I can connect a local Cider to port 12345 and edit the files over TRAMP on MY_REMOTE_SERVER,( not in container, but they are mounted by I think this is a very comfortable way to use a remote host+container together with a local graphical Emacs |
|
It sounds like a reasonable and small snippet to include. (I assume that there's no 'native' option? I see that there's https://github.com/devcontainers/cli) |
The later 3 are using docker behind the scenes But I can change the text to point out, that devcontainer-cli is one potential way to manage containers on a remote / localhost host |
|
If the ssh approach is a generic one, it SGTM to put it first, and mention other possibilities below. |
addressed review comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After applying the suggestions please give it one additional proofread
Thanks much!
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
Co-authored-by: vemv <vemv@users.noreply.github.com>
proofreading done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
| Using containers means that the JVM in which the nREPL server process is running runs inside a container (Docker or otherwise). | ||
| The files which we edit might / might not be edited using TRAMP. They could as well be mounted inside the container, so appear as local. | ||
|
|
||
| So CIDER can hardly detect if it's dealing with remote files, so it is better to not rely on `cider-jack-in` and its remote support described above, but to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're gonna say that the above section is possibly incorrect, better to improve it upfront - mind to give it a go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to say that CIDERs approach to try to infer the "host to run the jack-in command" when doing cider-jack-in from the file location / path of the edited file / folder cannot work in complex remote scenarios like "docker on remote host"
So the sentence You can safely run cider-jack-in- while working with remote files over TRAMP. from the docu is not correct in some (most ?) remote + docker scenarios.
It is not even required that the source code is at all on the remote machine. I could start a remote nREPL, tunnel the port locally, and have all my files locally. (and be aware that "(load-file ..)" will not work, But all cider-eval-.. commands do work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked as well the open issues for this and found:
#2703 (comment)
I share your comment that cider-jack-in cannot work reliable ever for all remote situations and should therefore be discouraged for any remote scenario in favor of "cider-connect"
It does work for the "simplest" remote scenario, namely having files on a given ssh accessible server and wanting to start the nREPL process on that machine as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my concrete szenario, CIDER would need to be able to infer this
ssh -t -L 12345:localhost:12345 dsvm devcontainer exec --workspace-folder /media/xfs/repos/foodfraudproject/ "clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.8.3\"} cider/cider-nrepl {:mvn/version \"0.25.5\"}}}' -A:dev -m nrepl.cmdline -p 12345 -b 0.0.0.0 --middleware '[\"cider.nrepl/cider-middleware\"]' "
How could that work for the first part:
ssh -t -L 12345:localhost:12345 -L 7777:localhost:7777 dsvm devcontainer exec --workspace-folder /media/xfs/repos/foodfraudproject/
by just "knowing" the file name of the file I have open ???
Should I do a PR accordingly to change the text of:
| You can run `cider-jack-in-\*` while working with remote files over TRAMP. CIDER |
?
-> I would propose to not use
jack-in in any but the simplest remote scenario...
|
I applied my last round of feedback directly, preserving attribution. The results are here: https://docs.cider.mx/cider/basics/up_and_running.html#working-with-containers-docker-or-others Feel free to propose a new iteration anytime. Cheers - V |
Give more details and hopeful clarity to the use of Cider in remote / container scenarios.
I left it on purpose very general for now.