Giter Club home page Giter Club logo

ipython-notebook-cookbook's Introduction

IPython Notebook Cookbook

Sets up an IPython Notebook server using Chef.

This cookbook targets Jupyter/IPython 4.x environment.

CAUTION: This cookbook now (Jan, 2017) defaults to using Jupyter and IPython versus the old monolithic IPython stack. While testing has been performed, if you are dependent on the old behavior, you should use the V1.1.1 tagged release of this cookbook.

Requirements

This cookbook uses Chef 12.1+.

Usage

Include this cookbook

This cookbook isn't on supermarket (yet), so for now you'll have to use Berkshelf and point to it in your Berksfile

cookbook 'ipynb', github: 'rgbkrk/ipynb-cookbook'

Bootstrap VirtualBox

You can also try it out using test-kitchen.

test-kitchen converge ubuntu-16

Once finished, the IPython notebook can be accessed from your host machine (through port forwarding) on 127.0.0.1:9999.

Attributes

See attributes/default.rb for default values. Most values including :linux_user, :linux_group, and :service_name default to 'ipynb'.

Particularly important parameters for configuration of the notebook are located in node[:ipynb][:NotebookApp].

  • node[:ipynb][:NotebookApp][:password] - Password to use when accessing the notebook. (Please use an encrypted data bag to set this attribute in a real deployment).

If you're using the virtualenv recipe, you can either install more to the same virtualenv (node[:ipynb][:virtenv]) or add additional packages to node[:ipynb][:extra_packages].

Recipes

The default recipe simply installs (using system packages) IPython Notebook, numpy, Pandas, matplotlib, and all the dependencies for these.

The virtenv_launch recipe creates user and group ipynb, creates a spot to store notebooks, and sets up ipython notebook as a service using supervisord.

The proxy recipe adds an nginx proxy to the notebook and requires you to set the certificate and key attributes.

  • node[:ipynb][:ssl_certificate] - Location to install the SSL certificate (e.g. /etc/nginx/ssl.crt)
  • node[:ipynb][:ssl_certificate_text] - Text for the SSL Certificate
  • node[:ipynb][:ssl_certificate_key] - Location to install the SSL private key (e.g. /etc/nginx/ssl.key)
  • node[:ipynb][:ssl_certificate_key_text] - Text for the SSL private key

On a real deployment, these should be set using an encrypted data bag.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b feature1)
  3. Commit your changes (git commit -am 'Added new provider to ...')
  4. Push to the branch (git push origin feature1)
  5. Create a new Pull Request

Future Directions

This cookbook satisfies the needs of the current collaborators. To do items include:

  • Supporting non-Ubuntu platforms (Amazon, Centos, etc.)
  • Support for non-IPython kernels (Rstats)
  • Submission to Supermarket
  • CI testing

Contributions are most welcome!

Author

Author:: Kyle Kelley ([email protected])

Copyright 2013, Rackspace Hosting

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

ipython-notebook-cookbook's People

Contributors

bcombourieu avatar brint avatar davidski avatar rgbkrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ipython-notebook-cookbook's Issues

Can't find ipynb_profile resource while launching ipython-notebook::virtenv_launch

Hi,

I get some compilation errors while trying to run the virtenv_launch recipe (below the stacktrace) => it cannot find the ipynb_profile resource.

==> default: ================================================================================
==> default: 
==> default: 
==> default: NameError
==> default: ---------
==> default: Cannot find a resource for ipynb_profile on ubuntu version 14.04
==> default: 
==> default: 
==> default: Cookbook Trace:
==> default: ---------------
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/ipython-notebook/recipes/virtenv_launch.rb:36:in `from_file'
==> default:   /tmp/vagrant-chef-3/chef-solo-1/cookbooks/w4-dev-haproxy/recipes/notebook_server.rb:15:in `from_file'
==> default: 
==> default: 
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/ipython-notebook/recipes/virtenv_launch.rb:
==> default: 
==> default:  29:     owner node[:ipynb][:linux_user]
==> default:  30:     group node[:ipynb][:linux_group]
==> default:  31:     mode '0775'
==> default:  32:     action :create
==> default:  33:  end
==> default:  34:  
==> default:  35:  # Make sure the default profile exists, to deal with IPython bugs/strangeness
==> default:  36>> ipynb_profile 'default' do
==> default:  37:     action :create
==> default:  38:     owner node[:ipynb][:linux_user]
==> default:  39:     ipython_path "#{node[:ipynb][:virtenv]}/bin/ipython"
==> default:  40:     ipython_settings_dir ipython_settings_dir
==> default:  41:  end
==> default:  42:  
==> default:  43:  ipynb_profile node[:ipynb][:profile_name] do
==> default:  44:     action :create
==> default:  45:     owner node[:ipynb][:linux_user]

Do you have any idea how I can solve this? I've followed the steps you've mentionned in the Readme, and I'm trying to deploy this (as a test) on a Vagrant machine (Ubuntu 14.04).

Thanks!

PS: I had the same bug with Ubuntu 12.04

Support for Ubuntu12.04?

Hi! I'm trying to install ipynb on Ubuntu 12.04 using your cookbook. However, I'm running into the following error:

================================================================================       
Error executing action `install` on resource 'package[libhdf5-7]'       
================================================================================       


Chef::Exceptions::Package       
-------------------------       
No version specified, and no candidate version available for libhdf5-7       


Resource Declaration:       
---------------------       
# In /tmp/kitchen/cache/cookbooks/ipynb/recipes/default.rb       

 29:    package pkg do       
        30:       action :install
        31:    end
        32: end



       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/ipynb/recipes/default.rb:29:in `block in from_file'

       package("libhdf5-7") do
         action [:install]
         retries 0
         retry_delay 2
         guard_interpreter :default
         package_name "libhdf5-7"
         cookbook_name "ipynb"
         recipe_name "default"
       end

Looks like libhdf5-7 is not available on Ubuntu 12.04. I can add a fix in my own wrapper cookbook but would be nice to have this work out of the box. Can I request support for Ubuntu 12.04? I'm happy to submit a PR if needed.

Thanks!

Websocket issue when using nginx proxy

After loading iPython notebook using the default attributes from the Vagrantfile I was getting the following error:

WebSocket connection failed: A WebSocket connection to could not be established. You will NOT be able to run code. Check your network connection or notebook server configuration.

I found this stackoverflow post that describes the issue: http://stackoverflow.com/questions/22665809/how-to-configure-ipython-behind-nginx-in-a-subpath

And based on that post this nginx config seems to address the issue: proxy_set_header Origin "";

I'll be submitting a PR to fix this.

Possible to pin versions installed via extra_packages?

Is it possible to use extra_packages to install specific versions of packages into the ipython virtualenv? I was recently bit when a fresh environment I spun up grabbed a newer version of a client lib with different behavior. I'd like to ensure that I'm getting specific versions in the ipython virtual env.

Tag 1.1 Release?

Hey there, do you have any plans on tagging a 1.1 release? You've had a lot of commits since November when you bumped the cookbook version to 1.0.

dependency ntlk install fails with setuptools>=10.0

There's an open issue for ntlk:

nltk/nltk#824

Looks like the only workaround is to use setuptools<10.0

If we drop the ntlk requirement, what does that cost us?

I'm able to install ipython[notebook]==2.2.0 without it, it seems.

Guessing the ntlk 3.0.1 release will fix this, but no ETA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.