Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Jupyter Notebook Support

    Gitea
    2
    6
    7611
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ocelotsloth
      ocelotsloth last edited by ocelotsloth

      I'd like to have jupyter notebook support baked into the container image shipped by Cloudron. I can get it working as-is, but I'd really prefer the jupyter python code be shipped in the read-only filesystem and also updated whenever the gitea app is updated.

      Gitea has some good docs on how to do this:

      https://docs.gitea.io/en-us/external-renderers/#installing-external-binaries

      I was able to get this working on my existing instance by:

      mkdir /app/data/python_packages
      cd /app/data/python_packages
      python3 -m virtualenv .
      source bin/activate
      pip3 install jupyter
      

      And then adding the following to my /app/data/app.ini file:

      [markup.jupyter]
      ENABLED = true
      FILE_EXTENSIONS = .ipynb
      RENDER_COMMAND = "/app/data/python_packages/bin/jupyter nbconvert --stdin --stdout --to html --template basic"
      IS_INPUT_FILE = false
      
      [markup.sanitizer.jupyter.img]
      ALLOW_DATA_URI_IMAGES = true
      

      I think all you'd have to add to the Dockerfile is something like:

      RUN pip3 install jupyter
      

      And then make the changes to the app.ini.template (without the path prefix on the render command, since it would be in the path now).


      I'd be happy to submit and test a pull request against the repository if that would be easiest.

      While at it...could probably also add pandoc so that we can add our own custom markup types for anything pandoc supports.

      girish 1 Reply Last reply Reply Quote 1
      • girish
        girish Staff @ocelotsloth last edited by

        @ocelotsloth yes, please, if you create a PR, we can get it merged. The repo is at https://git.cloudron.io/cloudron/gitea-app

        ocelotsloth 1 Reply Last reply Reply Quote 0
        • ocelotsloth
          ocelotsloth @girish last edited by ocelotsloth

          @girish looks like I need permissions to create at least 1 repository in order to do that.

          If you can make that change for me I'll work on this tomorrow night.

          girish 1 Reply Last reply Reply Quote 0
          • girish
            girish Staff @ocelotsloth last edited by

            @ocelotsloth done! you should have permissions to create many repos now.

            ocelotsloth 1 Reply Last reply Reply Quote 0
            • ocelotsloth
              ocelotsloth @girish last edited by

              @girish ok merge request here: https://git.cloudron.io/cloudron/gitea-app/-/merge_requests/6

              This app install is running that code: https://testgitea.markstenglein.com/ocelotsloth/test/src/branch/master/test.ipynb

              girish 1 Reply Last reply Reply Quote 2
              • girish
                girish Staff @ocelotsloth last edited by

                @ocelotsloth thanks, merged! will publish shortly.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Powered by NodeBB