Opened 10 years ago

Last modified 5 years ago

#11080 closed enhancement

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

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 jason)

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

spkg:

apply:

  • Apply the patch from #11078 to the normal sage repository

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

Explicit instructions: 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

Change History (25)

comment:1 Changed 10 years ago by jason

  • Cc ddrake added

comment:2 Changed 10 years ago by gutow

  • Description modified (diff)

comment:3 Changed 10 years ago by gutow

  • Description modified (diff)
  • Keywords sd31 added

comment:4 Changed 10 years ago by gutow

  • Description modified (diff)

comment:5 Changed 10 years ago by gutow

  • Description modified (diff)

comment:6 Changed 10 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 10 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 10 years ago by jason

  • Description modified (diff)

comment:9 Changed 10 years ago by jason

  • Description modified (diff)

comment:10 Changed 10 years ago by jason

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

comment:11 Changed 10 years ago by jason

  • Status changed from new to needs_review

comment:12 Changed 10 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 10 years ago by jason

  • Description modified (diff)

comment:14 Changed 10 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 10 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 10 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 10 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 10 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 10 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 10 years ago by jason

  • Description modified (diff)

comment:21 in reply to: ↑ 19 Changed 10 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 10 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 10 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 10 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 10 years ago by jason

  • Description modified (diff)

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

Note: See TracTickets for help on using tickets.