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

Visualizations in NBViewer Version of Notebook

Open haydenfree opened this issue 6 years ago • 17 comments

The visualizations do not show up in the NBViewer version of the notebooks. A WebIO not detected error is given. One solution might be to render the visualization as an image?

haydenfree avatar Aug 28 '19 23:08 haydenfree

Here’s an example of where the error shows up: https://nbviewer.jupyter.org/github/CurricularAnalytics/CA-Notebooks/blob/master/GaTech%20Curricula/GaTech-curricula.ipynb

The error links to some troubleshooting tips: https://juliagizmos.github.io/WebIO.jl/latest/providers/ijulia/

We use WebIO for the visualization functionality of the toolbox. src/Visualization.jl

haydenfree avatar Nov 13 '19 20:11 haydenfree

@aka334 Don't be discouraged if you can't solve this issue (it's something we've tried to fix but not dedicated the time towards), but it would be great if you could. Give it a shot if you have time.

haydenfree avatar Jan 31 '20 19:01 haydenfree

The right way to fix this issue might be to set up JupyterHub on an EC2 instance (Amazon's virtual server service).

Documentation for JupyterHub can be found here: https://github.com/jupyterhub/jupyterhub

haydenfree avatar Feb 07 '20 21:02 haydenfree

The right way to fix this issue might be to set up JupyterHub on an EC2 instance (Amazon's virtual server service).

Documentation for JupyterHub can be found here: https://github.com/jupyterhub/jupyterhub

I set up JupyterHub on a EC2 (t2,micro/1GB Ram/16GB storage/Ubuntu Server 18.04 LTS), CurricularAnalytics is add to the Pkg, but when using CurricularAnalytics, it throws error,

ERROR: could not load library "/home/ubuntu/julia-1.3.1/lib/julia/sys.so" /home/ubuntu/julia-1.3.1/lib/julia/sys.so: failed to map segment from shared object ERROR: LoadError: LoadError: Failed to precompile WebSockets [104b5d7c-a370-577a-8038-80a2059c5097] to /home/ubuntu/.julia/compiled/v1.3/WebSockets/SeUn1_lOBhQ.ji. Stacktrace: [1] error(::String) at ./error.jl:33 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283 [3] _require(::Base.PkgId) at ./loading.jl:1024 [4] require(::Base.PkgId) at ./loading.jl:922 [5] require(::Module, ::Symbol) at ./loading.jl:917 [6] include at ./boot.jl:328 [inlined] [7] include_relative(::Module, ::String) at ./loading.jl:1105 [8] include at ./Base.jl:31 [inlined] [9] include(::String) at /home/ubuntu/.julia/packages/Mux/8p2lQ/src/Mux.jl:1 [10] top-level scope at /home/ubuntu/.julia/packages/Mux/8p2lQ/src/Mux.jl:24 [11] include at ./boot.jl:328 [inlined] [12] include_relative(::Module, ::String) at ./loading.jl:1105 [13] include(::Module, ::String) at ./Base.jl:31 [14] top-level scope at none:2 [15] eval at ./boot.jl:330 [inlined] [16] eval(::Expr) at ./client.jl:425 [17] top-level scope at ./none:3 in expression starting at /home/ubuntu/.julia/packages/Mux/8p2lQ/src/server.jl:5 in expression starting at /home/ubuntu/.julia/packages/Mux/8p2lQ/src/Mux.jl:24 ERROR: LoadError: LoadError: Failed to precompile Mux [a975b10e-0019-58db-a62f-e48ff68538c9] to /home/ubuntu/.julia/compiled/v1.3/Mux/cs9xb_lOBhQ.ji. Stacktrace:

.... (The rest is a bunch of precompile errors as previous ones)

The same "could not load library "/home/ubuntu/julia-1.3.1/lib/julia/sys.so" error is thrown when I run the notebook on the JupyterHub but I have "sys.so" under the path and it everyone has permission to read and execute it, so I'm a bit confuse here.

Other packages work fine though.

JupyterHub link is here, username is ubuntu pwd is test.

I'll keep looking and fixing this, but I'm glad to know if you have any idea about the error

jiachengzhang1 avatar Feb 09 '20 02:02 jiachengzhang1

Update: Libraries can be used now, here's the new JupyterHub link (same username and pwd). The visualization is still not showing up but no errors (good news). It may need to change the "localhost" to "0.0.0.0" since everything runs on ec2 and "localhost connect refuse" (open in Chrome, the error is shown in the iframe). I may be wrong here. I'll clone the repo and add it to the library locally to Julia and give it a shot. https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15

jiachengzhang1 avatar Feb 12 '20 21:02 jiachengzhang1

Jiacheng,

Do I need login/password to access the JupyterHyb site?

Thanks, -Greg

On Feb 12, 2020, at 2:35 PM, Jiacheng Zhang [email protected] wrote:

Update: Libraries can be used now, here http://ec2-54-80-253-105.compute-1.amazonaws.com:8000/'s the new JupyterHub link. The visualization is still not showing up but no errors (good news). It may need to change the "localhost" to "0.0.0.0" since everything runs on ec2 and localhost connect refuse. I may be wrong here. I'll clone the repo and add it to the library locally to Julia and give it a shot.https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15 https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AAB5I54G3WFN5C7MVZ22XF3RCRTT5A5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSPE3I#issuecomment-585429613, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I53S3A6FIOASI4LCTIDRCRTT5ANCNFSM4IRWQ2CQ.

heileman avatar Feb 12 '20 22:02 heileman

Yes, username is “ubuntu” password is “test”

On Wed, Feb 12, 2020 at 15:40 Greg Heileman [email protected] wrote:

Jiacheng,

Do I need login/password to access the JupyterHyb site?

Thanks, -Greg

On Feb 12, 2020, at 2:35 PM, Jiacheng Zhang [email protected] wrote:

Update: Libraries can be used now, here < http://ec2-54-80-253-105.compute-1.amazonaws.com:8000/>'s the new JupyterHub link. The visualization is still not showing up but no errors (good news). It may need to change the "localhost" to "0.0.0.0" since everything runs on ec2 and localhost connect refuse. I may be wrong here. I'll clone the repo and add it to the library locally to Julia and give it a shot. https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15 < https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AAB5I54G3WFN5C7MVZ22XF3RCRTT5A5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSPE3I#issuecomment-585429613>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAB5I53S3A6FIOASI4LCTIDRCRTT5ANCNFSM4IRWQ2CQ .

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AG64P4DNPR7NDFDYMQNCUMDRCR3GXA5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSVJ7Y#issuecomment-585454847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG64P4ELL4STYWFOUNUHI3DRCR3GXANCNFSM4IRWQ2CQ .

jiachengzhang1 avatar Feb 12 '20 22:02 jiachengzhang1

Thanks

On Feb 12, 2020, at 3:46 PM, Jiacheng Zhang [email protected] wrote:

Yes, username is “ubuntu” password is “test”

On Wed, Feb 12, 2020 at 15:40 Greg Heileman [email protected] wrote:

Jiacheng,

Do I need login/password to access the JupyterHyb site?

Thanks, -Greg

On Feb 12, 2020, at 2:35 PM, Jiacheng Zhang [email protected] wrote:

Update: Libraries can be used now, here < http://ec2-54-80-253-105.compute-1.amazonaws.com:8000/>'s the new JupyterHub link. The visualization is still not showing up but no errors (good news). It may need to change the "localhost" to "0.0.0.0" since everything runs on ec2 and localhost connect refuse. I may be wrong here. I'll clone the repo and add it to the library locally to Julia and give it a shot. https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15 < https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AAB5I54G3WFN5C7MVZ22XF3RCRTT5A5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSPE3I#issuecomment-585429613>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAB5I53S3A6FIOASI4LCTIDRCRTT5ANCNFSM4IRWQ2CQ .

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AG64P4DNPR7NDFDYMQNCUMDRCR3GXA5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSVJ7Y#issuecomment-585454847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG64P4ELL4STYWFOUNUHI3DRCR3GXANCNFSM4IRWQ2CQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AAB5I56MNOVFRYIC26JJYM3RCR35PA5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELSV2GY#issuecomment-585456923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I54I44D4EJE2762GNRDRCR35PANCNFSM4IRWQ2CQ.

heileman avatar Feb 12 '20 22:02 heileman

Update: Libraries can be used now, here's the new JupyterHub link (same username and pwd). The visualization is still not showing up but no errors (good news). It may need to change the "localhost" to "0.0.0.0" since everything runs on ec2 and "localhost connect refuse" (open in Chrome, the error is shown in the iframe). I may be wrong here. I'll clone the repo and add it to the library locally to Julia and give it a shot.

https://github.com/CurricularAnalytics/CurricularAnalytics.jl/blob/ae9d1dbb6767464df945511c3d295cb00fa7b10c/src/Visualization.jl#L15

Is that the correct link? I'm having trouble getting it to work

haydenfree avatar Feb 12 '20 22:02 haydenfree

I forget to start the server, it's fixed now

jiachengzhang1 avatar Feb 12 '20 22:02 jiachengzhang1

Update: The Jupyterhub is working on port 8000 with local Authenticator and local Spawner now, the visualization is showing. Same link.

username: ubuntu, password: test

Working on Gurobi installation issue for the optimization part

jiachengzhang1 avatar Feb 13 '20 19:02 jiachengzhang1

Jiacheng,

Gurobi requires a license — that might be the problem. You can require a free academic license.

-Greg

On Feb 13, 2020, at 12:48 PM, Jiacheng Zhang [email protected] wrote:

Update: The Jupyterhub is working on port 8000 with local Authenticator and local Spawner now, the visualization is showing. Same link http://ec2-54-80-253-105.compute-1.amazonaws.com:8000/.

username: ubuntu, password: test

Working on Gurobi installation issue for the optimization part

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/64?email_source=notifications&email_token=AAB5I57ZDKMLRDFXJTKYDVTRCWPZVA5CNFSM4IRWQ2C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELWL3ZY#issuecomment-585940455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I54UAAWQJ5AD6MHHROLRCWPZVANCNFSM4IRWQ2CQ.

heileman avatar Feb 13 '20 20:02 heileman

@jiachengzhang1 Great work! As Dr. Heileman said that may be why Gurobi is not working.

The intended use of the website is that each user will receive their own "instance" of notebooks. I believe this can be achieved quite easily if you require users to sign up, but I was wondering if it's possible for guests to also receive their own instance of the notebooks as well?

This would allow users to execute and modify the notebooks without impacting others. If we must require users to sign up, I don't think that's too much of a problem.

haydenfree avatar Feb 13 '20 20:02 haydenfree

@jiachengzhang1 Great work! As Dr. Heileman said that may be why Gurobi is not working.

The intended use of the website is that each user will receive their own "instance" of notebooks. I believe this can be achieved quite easily if you require users to sign up, but I was wondering if it's possible for guests to also receive their own instance of the notebooks as well?

This would allow users to execute and modify the notebooks without impacting others. If we must require users to sign up, I don't think that's too much of a problem.

Thank you, Hayden!

JupyterHub is supporting multiple users (I tested with 2 different users) now. One concern is that it can't make the Julia packages system wide (packages are only installed to current user). I could make Julia system wide though but it seems to have issue of loading sys.so again (it may be some permission issue). Every time add a new user to the system, the new user need to install Julia and add packages manually.

Link is here, current working users jack and test, password is test for both of them.

What do you mean by guest? Like without login? Haven't found a solution for that yet (authentication is a part of the hub), one alternative could be having an universal account with restrictions(read, execute only)

jiachengzhang1 avatar Feb 14 '20 19:02 jiachengzhang1

Thank you, Hayden!

JupyterHub is supporting multiple users (I tested with 2 different users) now. One concern is that it can't make the Julia packages system wide (packages are only installed to current user). I could make Julia system wide though but it seems to have issue of loading sys.so again (it may be some permission issue). Every time add a new user to the system, the new user need to install Julia and add packages manually.

Link is here, current working users jack and test, password is test for both of them.

What do you mean by guest? Like without login? Haven't found a solution for that yet (authentication is a part of the hub), one alternative could be having an universal account with restrictions(read, execute only)

A universal account with read and execute permissions could be just the solution we are looking for! Is it possible for you to set up an account like that?

haydenfree avatar Feb 14 '20 22:02 haydenfree

Thank you, Hayden! JupyterHub is supporting multiple users (I tested with 2 different users) now. One concern is that it can't make the Julia packages system wide (packages are only installed to current user). I could make Julia system wide though but it seems to have issue of loading sys.so again (it may be some permission issue). Every time add a new user to the system, the new user need to install Julia and add packages manually. Link is here, current working users jack and test, password is test for both of them. What do you mean by guest? Like without login? Haven't found a solution for that yet (authentication is a part of the hub), one alternative could be having an universal account with restrictions(read, execute only)

A universal account with read and execute permissions could be just the solution we are looking for! Is it possible for you to set up an account like that?

For the universal account, I think the hub only spawns the server for that user who is linked to the account (not copies of the same user), so eventually people who use the account are accessing the same server.

Since aim of the server is to solve nbviewer issue, we could just host a jupyter notebook server as a showcase instead. There's a way to work around the login part. Then if only allow user to see and run the code in the notebook folders, and restrict its access to other directories then it could have the job done. What do you think?

jiachengzhang1 avatar Feb 15 '20 08:02 jiachengzhang1

It seems that we could use mybinder to present the notebooks. mybinder fetches the GitHub repo and utilizes JupyterHub to spawn instances, and there's no login required. Users can run, modify, download and create notebooks and it wouldn't effect other users. The limitation is that, based on their site, "the maximum number of simultaneous users for a given repo is 100." But I don't think this would be an issue for now, or would it?

"WebIO Not Detected" issue can be resolved by this approach, but the visualization is not shown. iframe is drawn which means WebIO is working. The embedded url for visualization is "localhost" which doesn't have a server to render the embedded html. This could be resolved by this way, https://github.com/CurricularAnalytics/CurricularAnalytics.jl/issues/87#issuecomment-586637687

Here's a sample repo I built, test-binder-julia. Or through the badge Binder.

jiachengzhang1 avatar Feb 20 '20 05:02 jiachengzhang1