Opened 11 years ago

Last modified 6 years ago

#11080 closed enhancement

move notebook to flask/wsgi-based notebook — at Version 43

Reported by: jason Owned by: jason, mpatel, was
Priority: blocker Milestone: sage-5.2
Component: notebook Keywords: sd31 sd35.5
Cc: ddrake, jason, kcrisman, mhansen, rkirov, timdumol, iandrus, strogdon Merged in:
Authors: Mike Hansen, Rado Kirov, William Stein, Jason Grout Reviewers: Rado Kirov, Dan Drake, Jason Grout
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #11078, #11874 Stopgaps:

Status badges

Description (last modified by jdemeyer)

This ticket tracks the progress to move the notebook to a flask/wsgi-based notebook.

Relevant code repository: http://code.google.com/r/jasongrout-flask-sagenb/

Explicit instructions including dependencies (replace $SAGE_ROOT with the root sage directory):

cd $SAGE_ROOT
./sage -f http://sage.math.washington.edu/home/jason/twisted-11.0.0.spkg
./sage -f http://sage.math.washington.edu/home/jason/sagenb-0.9.0.spkg
cd devel/sage
../../sage -hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11078/trac_11078.patch
../../sage -hg qpush
cd ../../
./sage -br

spkg: http://sage.math.washington.edu/home/jason/sagenb-0.9.0.spkg (this includes all dependencies not already in Sage)

Change History (43)

comment:1 Changed 11 years ago by jason

  • Cc ddrake added

comment:2 Changed 11 years ago by gutow

  • Description modified (diff)

comment:3 Changed 11 years ago by gutow

  • Description modified (diff)
  • Keywords sd31 added

comment:4 Changed 11 years ago by gutow

  • Description modified (diff)

comment:5 Changed 11 years ago by gutow

  • Description modified (diff)

comment:6 Changed 11 years ago by gutow

  • Description modified (diff)

removed #11078 from list as the fix is included in the 11503 command line patch.

comment:7 Changed 11 years ago by jason

  • Authors changed from Mike Hansen, Rado Kirov to Mike Hansen, Rado Kirov, William Stein, Jason Grout
  • Dependencies set to #11078
  • Description modified (diff)

comment:8 Changed 11 years ago by jason

  • Description modified (diff)

comment:9 Changed 11 years ago by jason

  • Description modified (diff)

comment:10 Changed 11 years ago by jason

  • Dependencies changed from #11078 to #11078, #11874

comment:11 Changed 11 years ago by jason

  • Status changed from new to needs_review

comment:12 Changed 11 years ago by jason

(for future reference, after this is merged, jmol is a high priority. These two tickets deal with these changes:

  • #11496 (update jmol script in local/bin to reflect move of jmol directory to local)
  • #11503 (updated spkg and paths for move of jmol directory)
  • #9238 (for reference -original Jmol enhancement ticket but heavily laden with pre-flask notebook stuff)

Again, this is only FYI and for further reference.

comment:13 Changed 11 years ago by jason

  • Description modified (diff)

comment:14 Changed 11 years ago by gutow

I get the following error when I try to apply the spkg dependencies patch. Everything else seems to work. I'm still checking functionality...

applying /home/jonathan/.sage/temp/VB_Ubuntu_11/26614/tmp_0.patch
unable to find 'spkg/install' for patching
1 out of 1 hunks FAILED -- saving rejects to file spkg/install.rej
unable to find 'spkg/standard/deps' for patching
4 out of 4 hunks FAILED -- saving rejects to file spkg/standard/deps.rej
spkg/install: No such file or directory
spkg/standard/deps: No such file or directory
abort: patch failed to apply

comment:15 Changed 11 years ago by gutow

With 4.8.alpha4, what is described here does not work. I redid everything. The .spkgs seem to install without error. The patch for this ticket does not work and the notebook fails to launch with the error:

/home/jonathan/Documents/sage-4.8.alpha4/<ipython console> in <module>()

/home/jonathan/Documents/sage-4.8.alpha4/devel/sagenb/sagenb/notebook/notebook_object.py in __call__(self, *args, **kwds)
    202     """
    203     def __call__(self, *args, **kwds):
--> 204         return self.notebook(*args, **kwds)
    205 
    206     notebook = run_notebook.notebook_twisted

/home/jonathan/Documents/sage-4.8.alpha4/devel/sagenb/sagenb/notebook/run_notebook.py in notebook_twisted(self, directory, port, interface, address, port_tries, secure, reset, require_login, accounts, openid, server_pool, ulimit, timeout, open_viewer, sagetex_path, start_path, fork, quiet, subnets)
    442     if open_viewer:
    443         "Open viewer automatically isn't fully implemented.  You have to manually open your web browser to the above URL."
--> 444     return run(port)
    445 
    446 def get_admin_passwd():

/home/jonathan/Documents/sage-4.8.alpha4/devel/sagenb/sagenb/notebook/run_notebook.py in run(port)
    427         os.chdir(cwd)
    428         if e == 256:
--> 429             raise socket.error
    430 
    431         return True

comment:16 Changed 11 years ago by jason

It's possible that the SAGE_ROOT patch needs to be rebased to 4.8.alpha4. Let me check. Thanks for the test

comment:17 Changed 11 years ago by jason

  • Description modified (diff)

Jonathan,

I think the problem is that you didn't apply the patch here to the SAGE_ROOT repository. I've updated the instructions above with explicit commands.

comment:18 Changed 11 years ago by jason

I'm checking now into the error you posted in your second. It appears that there is indeed a problem with the sagenb spkg not overwriting the old notebook.

comment:19 follow-up: Changed 11 years ago by jason

  • Description modified (diff)

For future reference, here are the instructions if we had a sagenb_dependencies spkg. DON'T USE THESE--use the instructions in the description of the ticket.

cd $SAGE_ROOT
./sage -hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11080/trac-11080-sagenb_dependencies-spkg.patch
./sage -hg qpush
./sage -f http://sage.math.washington.edu/home/jason/sagenb_dependencies-20111216.spkg
./sage -f http://sage.math.washington.edu/home/jason/twisted-11.0.0.spkg
./sage -f http://sage.math.washington.edu/home/jason/sagenb-0.9.0.spkg
cd devel/sage
../../sage -hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11078/trac_11078.patch
../../sage -hg qpush
cd ../../
./sage -br

comment:20 Changed 11 years ago by jason

  • Description modified (diff)

comment:21 in reply to: ↑ 19 Changed 11 years ago by gutow

OK, with the changed instructions and this explicit instruction set, I get a running sage-4.8.alpha4. The notebook launches and everything I tried other than 3-D plotting worked in the notebook. 3-D plotting does not work because Jmol seems to be gone. Is #11503 supposed to be included as well? That would install the new Jmol in the $SAGE_ROOT/local/shared directory rather than in the sagenb/data directory. I note that there is no sagenb/data/jmol directory in the notebook created by this ticket, while there is in the old 4.8.alpha4 notebook.

I think it's almost there. Jonathan Replying to jason:

For future reference, here are the instructions if we had a sagenb_dependencies spkg. DON'T USE THESE--use the instructions in the description of the ticket.

cd $SAGE_ROOT
./sage -hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11080/trac-11080-sagenb_dependencies-spkg.patch
./sage -hg qpush
./sage -f http://sage.math.washington.edu/home/jason/sagenb_dependencies-20111216.spkg
./sage -f http://sage.math.washington.edu/home/jason/twisted-11.0.0.spkg
./sage -f http://sage.math.washington.edu/home/jason/sagenb-0.9.0.spkg
cd devel/sage
../../sage -hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11078/trac_11078.patch
../../sage -hg qpush
cd ../../
./sage -br

comment:22 Changed 11 years ago by jason

Jonathan: the problem was that my spkg-making sagenb install had a symbolic link to jmol, rather than the actual directory, and the symbolic link was not followed when making the spkg.

I've updated the 0.9.0 spkg (tagged as 0.9.0.rc2 in the repository google code). Can you try again? I just tried installing in a clean 4.8.alpha4, and 3d plots worked fine.

Thanks, Jason

comment:23 Changed 11 years ago by gutow

Jason:  I think everything is OK.  It all seemed to work on my Ubuntu Linux distro.  I would vote for a positive review, if we can get one other person to verify.  Comment...anybody using Chrome on Linux, OpenJDK/IceTea don't play very well with Chrome and this old version of Jmol.

comment:24 Changed 11 years ago by jason

Thanks! Jmol is certainly a top priority, along with mathjax, after we get this merged into sage. Lucky for us, most of the work has already been done, so hopefully it's just rebasing the patches that are already there.

comment:25 Changed 11 years ago by jason

  • Description modified (diff)

Deleting the dependency spkg instructions, since we aren't going that route.

comment:26 Changed 11 years ago by dimpase

  • Status changed from needs_review to needs_info

I checked that all this appears to work on MacOSX 10.6 just fine, including Jmol and text fields with LaTeX.

I do not like that this build does not incorporate the sass update by Tim Dumol in Sept. 2011 Without it, hacking the CSS stuff won't be possible on some platforms, at least not on MacOSX 10.6.

Is it possible to merge this, and the related readme update, into the sagenb spkg?

comment:27 Changed 11 years ago by jason

It should be easy to incorporate that. Let me try. I don't think I edited anything in those directories.

comment:28 follow-up: Changed 11 years ago by jason

I've incorporated the sass patches, but there are some very small changes in the css, which worries me. How much have these patches been tested?

comment:29 in reply to: ↑ 28 Changed 11 years ago by dimpase

  • Cc timdumol added

Replying to jason:

I've incorporated the sass patches, but there are some very small changes in the css, which worries me. How much have these patches been tested?

These are changes in the generated CSS files. The only changes in main.css are in the comments; these certainly can be ignored.

There are few other changes in the other css, called test_report.css. (I don't even know if this file is used at all, is it?) But these changes are indeed very, very minor, like a different way to encode the colour, or a change of a constant from 2.0em to 2em. I worked a bit with these modified CSS files, no issues noted. IMHO it is totally safe to update.

I cc this to Tim Dumol, just in case.

comment:30 Changed 11 years ago by timdumol

The changes made were all automated, via the sass-convert tool made by the developers of SASS/SCSS themselves, with the exception of the moving of the Accounts page scss to a separate partial, which was a cut-paste into a new file; thus, there shouldn't be any regressions.

comment:31 follow-ups: Changed 11 years ago by jason

For example, line 614 of ../../../../sass/src/jquery-plugins/_ui.achtung.scss now generates this line in main.css:

.achtung .ui-icon.achtung-close-button { overflow: hidden; float: right; position: relative; top: -8px; right: -8px; cursor: pointer; background-image: url(/javascript/jqueryui/css/sage/images/ui-icons_cccccc_256x240.png); }

However, that background image URL doesn't exist (but the old background image URL does exist).

comment:32 in reply to: ↑ 31 Changed 11 years ago by timdumol

Replying to jason:

For example, line 614 of ../../../../sass/src/jquery-plugins/_ui.achtung.scss now generates this line in main.css:

.achtung .ui-icon.achtung-close-button { overflow: hidden; float: right; position: relative; top: -8px; right: -8px; cursor: pointer; background-image: url(/javascript/jqueryui/css/sage/images/ui-icons_cccccc_256x240.png); }

However, that background image URL doesn't exist (but the old background image URL does exist).

Sorry about that. From what I can tell, I must have used another copy of Achtung to update the Achtung CSS, which was configured to another jQuery UI theme. I'll push a fix in a minute.

comment:33 in reply to: ↑ 31 Changed 11 years ago by dimpase

Replying to jason:

For example, line 614 of ../../../../sass/src/jquery-plugins/_ui.achtung.scss now generates this line in main.css:

.achtung .ui-icon.achtung-close-button { overflow: hidden; float: right; position: relative; top: -8px; right: -8px; cursor: pointer; background-image: url(/javascript/jqueryui/css/sage/images/ui-icons_cccccc_256x240.png); }

However, that background image URL doesn't exist (but the old background image URL does exist).

my fault that I didn't notice these on the diff. I just looked again, and this, and one more, images at the very bottom had changed filenames. The rest are completely innocent changes (comments, #d vs #D, "..." vs '...').

comment:35 in reply to: ↑ 34 Changed 11 years ago by timdumol

Replying to jason:

I think I just fixed it: https://github.com/sagemath/sagenb/commit/624dddb228bf3ebfdc02e161d2a5646b8c32a31f

Yep, that should do the trick. Once again, sorry.

comment:36 Changed 11 years ago by jason

No problem. Things have certainly slipped by me often enough. Okay, positive review to these patches from me too.

comment:37 follow-up: Changed 11 years ago by jason

  • Status changed from needs_info to needs_review

comment:38 in reply to: ↑ 37 Changed 11 years ago by dimpase

  • Status changed from needs_review to positive_review

Replying to jason:

OK, with these changes in the spkg, all good to go!

comment:39 Changed 11 years ago by jason

  • Status changed from positive_review to needs_work

I've updated the spkg. Can someone confirm that it still installs and has these last changes? I also added a few changes to deal with using hg-git to mirror a git repository.

I'm setting this back to needs-review so someone can give it one final +1, after all has been said and done.

comment:40 follow-up: Changed 11 years ago by jason

  • Status changed from needs_work to needs_review

comment:41 in reply to: ↑ 40 Changed 11 years ago by dimpase

  • Status changed from needs_review to positive_review

Replying to jason:

the updated sagenb-0.9.0 installs and works on MacOSX 10.6. And the sass changes are there. I do not know how to test the CSS properly, though, i.e. when these Achtung images come into play, but perhaps it's a good day and I should give it a positive review, still.

comment:42 Changed 11 years ago by jdemeyer

  • Milestone changed from sage-4.8 to sage-5.0

comment:43 Changed 11 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.