does handin-server really need racket/gui/base?

39 views
Skip to first unread message

Wayne Harris

unread,
Aug 16, 2019, 10:00:49 PM8/16/19
to racket users
I tried the handin-server on a Windows computer and it worked just
fine.  Now I'm trying it on a headless UNIX system and, upon first run,
I got:

$ racket -l handin-server
Unable to init server: Could not connect: Connection refused
Gtk initialization failed for display ":0"
  context...:
   "/usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   do-dynamic-require5
   "/usr/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   ...

Then taking a peek at

  ~/.racket/7.2/pkgs/handin/handin-server/main.rkt

I saw

  (require ...
         ;; workaround for a confusing problem: without this, the gui
         ;; gets initialized in a handler (since checks use it, and
         ;; they're being required dynamically), and further handlers
         ;; will fail with "queue-callback: eventspace is shutdown",
         ;; requiring it here makes it avoids killing the eventspace
         racket/gui/base)

Just to see what happens, I commented out the racket/gui/base
requirement and the server ran, but the comment says there'll be a
confusing problem.

$ racket -l handin-server
[-|2019-08-17T01:52:22] *** embedded web server started
[-|2019-08-17T01:52:22] Cleaning up all submission directories
[-|2019-08-17T01:52:22] *** handin server started on port 7979

Why does the server need anything GUI-related?  How do you run this
server in production?

John Clements

unread,
Aug 19, 2019, 9:40:22 PM8/19/19
to Wayne Harris, racket users
I’m not looking at the code here, but I believe the issue here is that the handin-server receives user code in a serialized-could-contain-images-format that can’t be decoded properly without importing the gui libraries.

It seems not implausible to me that you could special-case all-text submissions to build a handin-server that doesn’t require the gui pieces.

BUT,

I’m here to tell you that I also run the handin server on a headless UNIX system (currently Debian 9) with no problems.

Specifically, I use tigervnc to create an x session, then connect to it remotely (using a local vnc client) and start the handin server with an active X connection.

Let me know if you need more clues on this setup; there are a whole bunch of things that can go wrong.

John
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/RxyC6B4i7HgNSuVjlatCo9H-fgEEC2x2L38zkodCjrx8FqWGGkkBEIhW-ndhGc-ieeByffOnG81S9kvYd-PHt1J5wfO1cTvZko8OgqCdXL8%3D%40protonmail.com.



Wayne Harris

unread,
Aug 21, 2019, 1:37:44 PM8/21/19
to John Clements, racket users
On Monday, August 19, 2019 10:40 PM, John Clements <clem...@brinckerhoff.org> wrote:

> I’m not looking at the code here, but I believe the issue here is that the handin-server receives user code in a serialized-could-contain-images-format that can’t be decoded properly without importing the gui libraries.

That makes sense.

> It seems not implausible to me that you could special-case all-text submissions to build a handin-server that doesn’t require the gui pieces.

That'd be an interesting addition to handin-server. I'd love to contribute that, but I need to see if I can understand enough to make it. Thanks for the idea!

> BUT,
>
> I’m here to tell you that I also run the handin server on a headless UNIX system (currently Debian 9) with no problems.
>
> Specifically, I use tigervnc to create an x session, then connect to it remotely (using a local vnc client) and start the handin server with an active X connection.
>
> Let me know if you need more clues on this setup; there are a whole bunch of things that can go wrong.

Thanks a lot! I did make it: I installed Xming on my Windows system and used PuTTY's X11-configuration. The server ran fine! (Now I'm free to study how to implement a checker!) Thanks for your help!
Reply all
Reply to author
Forward
0 new messages