Javis.jl icon indicating copy to clipboard operation
Javis.jl copied to clipboard

Javis on headless servers

Open agerlach opened this issue 4 years ago • 7 comments

Is your feature request related to a problem? Please explain. Javis currently depends on Gtk.jl to support the LiveViewer. This can prove troublesome for headless servers as Gtk requires a display. Also, this is a heavy dependency and is not, as far as I can tell, required for the core function of Javis.jl.

Describe the solution you'd like Place the LiveViewer in a separate package to remove the Gtk dependency

Describe alternatives you've considered Include additional documentation of how to work around this. I was able to get it to work by mirroring how Gtk.jl handles CI (https://github.com/JuliaGraphics/Gtk.jl/blob/master/.travis.yml), i.e., install xvfb and start julia w/ xvfb-run julia

Additional context I frequently use VSCode + Code Spaces to do my dev in the cloud. Everything works as if it was native including displaying the resulting gif. VSCode plugins like Gif Player can then provide the function of the LiveViewer as shown below.

As a side note, VS Code online is being merged into GitHub Codespaces, so I expect others may adopt this sort of workflow soon to ease PRs.

image

agerlach avatar Dec 03 '20 19:12 agerlach

@agerlach - I think this is a very valid proposition. In fact, we tried to work around this heavy dependency with #193 and #225 but were not able to do so. The version of Javis that we are working on (v0.4.0), will include support for Jupyter (#288) and Pluto (#208) notebooks. There was already discussion about moving the support for those modules into another Julia pkg for Javis and I think if we did that, it would make sense to also move the liveviewer around to that repository. Perhaps we could call it JavisView or something.

In the interim, you are welcome to experiment with issue #225 to disable GTK. Otherwise, it may be a month or two before we release version 0.4 with this new functionality as @Wikunia and I are quite busy currently.

However, before anything, what do you think of this @Wikunia ?

TheCedarPrince avatar Dec 03 '20 21:12 TheCedarPrince

By the way @agerlach - two additional questions:

  1. What is it you are trying to use Javis for on a headless server? Always curious about use cases for Javis.

  2. That is an awesome workflow! Could I potentially convince you to make a PR about it for our workflow documentation section? If you are busy, no worries - just thought it looked great!

TheCedarPrince avatar Dec 03 '20 21:12 TheCedarPrince

  1. There is really nothing special about using the headless server. It is actually a work around to a different problem. I have a Mac for work and I don't have admin rights. There are some upstream issues that have put me in artifact hell. Essentially, I get dylib mismatches for some reason. I could fix them by installing the libraries w/ homebrew, but some of them require admin rights to install. This makes using Javis fail. However, I have some cloud accounts with admin rights which leads me here!

I hope to make an animation to illustrate the concept at 2:02. This process can be thought of local expansion/contractions of a state-space.

I do use VSCode + Code Space quite frequently for other work though. E.g. if I need to access a GPU.

  1. I think I can manage something. I went through the tutorials the other day and have some notes for corrections in the docs. Are you OK w/ me just doing a single doc PR and I'll address this too. I'll make an issue 1st to discuss something. Some suggest changes are purely stylistic.

agerlach avatar Dec 03 '20 22:12 agerlach

Hey @agerlach - this is not a perfect fix yet, but I created a branch for you that does not utilize GTK or incorporate usage of the liveviewer. Here is the branch to check out and use for Javis #298

That should hopefully work as a stopgap solution for you for now. @Wikunia and I will need to discuss more about how to handle the live viewer.

Let me know if you have any issues! When you are done with your animation - we'd love to see it as well! Would be happy to include it in our examples section to show how Javis could be used. :)

Regarding the PR, sure! Ping @Wikunia and I when you open the issue. We can chat about it there and go forward with the PR. Thanks!

TheCedarPrince avatar Dec 04 '20 00:12 TheCedarPrince

Thanks for opening up the issue @agerlach . I didn't know about the gif player plugin in vs code. This can be quite helpful. I agree that it makes sense to have a JavisViewers.jl in the future.

Oh and yeah we would love to see documentation PRs or a single documentation pr

Wikunia avatar Dec 04 '20 10:12 Wikunia

Oh btw @agerlach - would you still be willing to open a PR on Javis regarding the workflow you described? Thanks!

TheCedarPrince avatar Dec 15 '20 17:12 TheCedarPrince

Yeah. I am working through a backlog of things that need done before the holidays. It is in the queue though.

agerlach avatar Dec 15 '20 18:12 agerlach