Code Monkey home page Code Monkey logo

ansible-jupyterhub's Introduction

This role installs Jupyter (previously ipython notebook), JupyterHub and sudospawner using Python 3.

It was developed and tested with Ubuntu 15.04, but should work on any recent Ubuntu or Debian. As of 2017-02 it has been tested with Ubuntu 16.04LTS Xenial as well.

This was tested on Scaleways (scaleway.com) and Digital Ocean. So it does work on ARM!

JupyterHub is installed as per instructions, with node.js and configurable-http-proxy.

To add a user, login to the server as root:

adduser <username>
addgroup <username> jupyter

Then connect via web browser

http://<ip address>:8000

To run, install ansible, configure your ssh/config file for a host "jupyterhub" and use one of the following:

ansible-playbook ansible-jupyterhub/playbook/no_ssl.yml -i <hostfile>
ansible-playbook ansible-jupyterhub/playbook/with_ssl.yml -i <hostfile>

Note: During testing on linode I ran into IPV6 issues. Nothing to do with jupyterhub or ansible, but apt wouldn't work with IPV6 enabled on Xenial. I disabled IPV6 according to these instructions and apt (and ansible) began to work. If it hangs on installing packages this is probably your issue.

http://www.techrepublic.com/article/how-to-disable-ipv6-on-linux/

Also on Ubuntu 16.10 I had to do a "apt install python-minimal" to get python 2 for ansible.

When everything has finished you should be able to point your browser at:

http://ip.add:8000

And then login as jupyter with the password you entered at the start.

ansible-jupyterhub's People

Contributors

jenkstom avatar patpicos avatar

Stargazers

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

Watchers

 avatar  avatar

ansible-jupyterhub's Issues

Having trouble installing nodejs, npm, & nodejs-legacy on Debian Jessie

nodejs is terrible. This isn't this repo's fault...it's Node's. >:[

I cannot figure out a course-of-action to remediate this, neither via editing the playbook, nor by manually trying to install nodejs-legacy via ssh.

Please help!!!

Here's a snapshot of my life right now:

~$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

The following information may help to resolve the situation:

The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
      Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
      Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
      Depends: node-ansi-color-table but it is not going to be installed
      Depends: node-archy but it is not going to be installed
      Depends: node-block-stream but it is not going to be installed
      Depends: node-fstream (>= 0.1.22) but it is not going to be installed
      Depends: node-fstream-ignore but it is not going to be installed
      Depends: node-github-url-from-git but it is not going to be installed
      Depends: node-glob (>= 3.1.21) but it is not going to be installed
      Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
      Depends: node-inherits but it is not going to be installed
      Depends: node-ini (>= 1.1.0) but it is not going to be installed
      Depends: node-lockfile but it is not going to be installed
      Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
      Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
      Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
      Depends: node-gyp (>= 0.10.9) but it is not going to be installed
      Depends: node-nopt (>= 3.0.1) but it is not going to be installed
      Depends: node-npmlog but it is not going to be installed
      Depends: node-once but it is not going to be installed
      Depends: node-osenv but it is not going to be installed
      Depends: node-read but it is not going to be installed
      Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
      Depends: node-request (>= 2.25.0) but it is not going to be installed
      Depends: node-retry but it is not going to be installed
      Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
      Depends: node-semver (>= 2.1.0) but it is not going to be installed
      Depends: node-sha but it is not going to be installed
      Depends: node-slide but it is not going to be installed
      Depends: node-tar (>= 0.1.18) but it is not going to be installed
      Depends: node-underscore but it is not going to be installed
      Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Ok fine. I'll try to install node first.

~$ sudo apt-get install nodejs npm nodejs-legacy
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nodejs : Conflicts: nodejs-legacy
         Conflicts: npm
E: Unable to correct problems, you have held broken packages.

Conflicts?!?!?! what conflicts?!

~$ sudo dpkg -l | grep npm
~$ sudo dpkg -l | grep nodejs

Nothing. The internet says not to use apt to install npm or nodejs which does not help.

NodeJS Still Not Working on Debian

This is my 3rd time having serious issues with installing

  • nodejs
  • npm
  • nodejs-legacy
    on on a fresh Debian box. This brings me to a question that I'll explain more below.

My Question:

Is nodejs-legacy absolutely necessary to install jupyterhub?

Potential fixes:

Unlike on Debian 8 ("jessie,") installing nodejs & nodejs-legacy on Debian 9 actually works out of the box. However, things get tricky when you try to install npm with apt-get. The internet says you can either:

  1. compile everything from source (not fun)
  2. use nvm (Node Version Manager, which doesn't pass the apt: name={{item}} state=present check.)
  3. add the Node LTS PPA & corresponding gpg key, then install with apt. (looks like the best option)

Number 3 seems like the best shot:

Upgrading to Debian 9 ("stretch") with backports, & adding the current Node LTS PPA has gotten me the farthest, but this route is still giving me trouble with nodejs-legacy. Mind you, I haven't even run the playbook yet, I'm trying to figure out what tasks to add.

Here's the shell code to install the PPA for the most current Node LTS Repo:

~$ curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -

npm has now become installible with apt! However nodejs-legacy is now throwing the ol' "you have held broken packages" error.

So with that, here's my question again:

Is nodejs-legacy absolutely necessary to install jupyterhub with this playbook?

Assorted issues trying to use this playbook

Some issues I noticed with this playbook that made it hard to use:

The role has a preconfigured password that's not configurable with a variable; At first I added a command to change the password after this role had run, but this is suboptimal.

I tried to use this straight from galaxy and it refused to run without the --no-ssl flag, giving me this error:

[E 2016-06-29 20:47:15.142 JupyterHub app:963] Refusing to run JuptyterHub without SSL. If you are terminating SSL in another layer, pass --no-ssl to tell JupyterHub to allow the proxy to listen on HTTP.

At this point I had to grab the role from github and make changes to the init file.

After making changes to the init file and running the role again, I got this error:

FAILED! => {"changed": false, "cmd": "/usr/bin/easy_install --dry-run pip", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

I'm guessing something in the role is removing this file making this role unable to run twice by default, but if this file is expected to be removed there should be some check to skip this command if so. Commenting out that line from the role let it run.

test directory does not exist

In the readme you write ansible-playbook ansible-jupyterhub/test/test.yml -i ansible-jupyterhub/test/hosts should be used to run the playbook.
The test-directory does not exist.

openssl

openssl req -new -nodes -x509 -subj "/C=NoCountry/ST=NoState/L=NoCity/O=IT*

Fails because C= is expected to have a 2 char value such as US

Moving the values to prompts may be useful so that consumers dont have to edit the role

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.