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

How to connect to a remote running Lisp #115

Closed
vindarel opened this issue Sep 30, 2017 · 4 comments
Closed

How to connect to a remote running Lisp #115

vindarel opened this issue Sep 30, 2017 · 4 comments

Comments

@vindarel
Copy link
Contributor

Asked again in https://stackoverflow.com/questions/46499463/hot-debug-and-swap-in-common-lisp/46501704 I agree there should be a tutorial somewhere and it's a good fit for the cookbook.

Some notes I took for myself. I largely agree we should have a tutorial out there. In the CL Cookbook ?

Reading http://readevalprint.tumblr.com/post/101841449553/its-alive-the-path-from-library-to-web-app :

Another option is hot swapping all the changes. For this purpose my hunchentoot server also starts a swank server like this:

(defun start-app (&optional (port 8080))
  (handler-case (swank:create-server :dont-close t)
    (error ()))
    …

Swank is, of course, the server-side component of SLIME. It runs on a port that is not accessible remotely and can only be connected to locally or via SSH tunnel. I use the latter to connect SLIME on my PC to Swank running on my server, which allows me to apply various fixes without restarting, either from the REPL or by using C-c C-c to recompile some function.

Connect to a remote Slime server:

  • Install a Common Lisp implementation on the server. (E.g. sbcl, clisp, etc...)
  • Install quicklisp on the server.
  • Load SWANK with (ql:quickload :swank)
  • Start the server with (swank:create-server). The default port is 4005. [On your local machine] Create a SSH tunnel with ssh -L4005:127.0.0.1:4005 [remote machine]
  • Connect to the running remote swank server with M-x slime-connect.
  • The host should be 127.0.0.1 and the port 4005.

from an old SO doc entry: https://stackoverflow.com/documentation/common-lisp/4097/working-with-slime/25252/setting-up-a-swank-server-over-a-ssh-tunnel

@vindarel
Copy link
Contributor Author

vindarel commented Dec 3, 2017

More resources: https://lisp-journey.gitlab.io/web-dev/#deployment with cvberry's post and Quickutil's example.

@foretspaisibles
Copy link

foretspaisibles commented Jun 14, 2018

That's a good idea. I am currently using a docker setup to connect to a remote lisp (resp. dockerized lisp) Maybe it would be useful to describe this setup? (it's not perfect though, I could not get filename translation working.)

@pnathan
Copy link
Member

pnathan commented Jun 14, 2018 via email

@vindarel
Copy link
Contributor Author

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

No branches or pull requests

3 participants