Commit Graph

1393 Commits

Author SHA1 Message Date
yuvipanda
3f0c8942cc Preserve PATH when using sudo -E
jupyterhub admins should be able to run `sudo -E pip install numpy`
and install numpy into the user environment. However, since pip
is in the PATH we explicitly set in jupyterhub_config.py and
sudo doesn't preserve PATH, this won't work.

We exempt jupyterhub-admins groups from the PATH restriction,
so sudo -E works. This has some security costs, but we are already
allowing passwordless roots for them with unrestricted paths...
2018-06-28 01:22:27 -07:00
yuvipanda
dd53176889 Start JupyterHub / CHP when system starts 2018-06-28 00:49:36 -07:00
yuvipanda
30486963d7 Fix rST syntax errors 2018-06-28 00:46:22 -07:00
yuvipanda
aa01225b0a Switch to sphinx+rtd for documentation
- mkdocs doesn't support GFMD, so is a different dialect
- recommonmark seems abandoned
- Couldn't get m2r to work

So RST + Sphinx it is!
2018-06-28 00:39:55 -07:00
yuvipanda
8401012ab6 Start / Restart JupyterHub / CHP as required 2018-06-28 00:06:11 -07:00
yuvipanda
893c54b79e Mark systemd dependencies between chp / jupyterhub
- Requires= makes success of CHP a hard dependency for JupyterHub
- After= waits for CHP to start before jupyterhub starts
- Start CHP after networking is ready (properly)
2018-06-28 00:04:46 -07:00
yuvipanda
582ef74a61 Restart JupyterHub after each install
Restarting JupyterHub should be non-disruptive, and helps
make the config changes come true ASAP.
2018-06-27 18:07:59 -07:00
yuvipanda
8a19b02864 Install conda & jupyterlab explicitly
conda was not installed in the user environment explicitly,
so users can't install conda packages themselves.

Also install JupyterLab while we're at it :)
2018-06-27 18:05:20 -07:00
yuvipanda
1a4cf5673b Use high ports for CHP API + JupyterHub
This makes it easier to test this distro out on machines
with JupyterHub running already
2018-06-27 17:38:42 -07:00
yuvipanda
fc30523867 Add docs on admin access 2018-06-27 17:19:54 -07:00
yuvipanda
6f073e25bc Add docs with mkdocs
There isn't going to be much code generation here, so let's
start with mkdocs and see if it is good enough for us!
2018-06-27 16:33:14 -07:00
yuvipanda
47ef27af96 Read yaml config from config.yaml, not jupyterhub.yaml
Consistent with z2jh's nomenclature of config.yaml
2018-06-27 16:04:35 -07:00
yuvipanda
5b92cd5e72 Use miniconda3 directly, do not use conda constructor
Conda constructor wasn't providing enough use to justify its
restrictions:

1. It doesn't work with most of conda-forge due to
   https://github.com/conda/constructor/issues/86#issuecomment-330863531.
   Almost all the packages we want to ship are in conda-forge.
2. There is no way to pass environment variables to the post-install
   script, which makes customization super hard.
3. Can't bundle pip packages, so we need internet access to install
   packages anyway. This negates the 'offline installable' aspect of
   conda constructor.
4. We need an installer script that users can curl into bash regardless.

Downloading & installing miniconda straight up seems simple enough
for now, and has a reasonable upgrade pathway. I think it'll work out ok!
2018-06-27 15:41:34 -07:00
yuvipanda
bfd2a8bca3 Store hub state inside install_prefix
rm -rf'ing the prefix should get rid of almost everything
2018-06-27 14:21:08 -07:00
yuvipanda
cd38386d25 Set PATH properly when starting configurable-http-proxy 2018-06-27 03:24:28 -07:00
yuvipanda
c1fcf414d5 Handle config.yaml file missing 2018-06-27 03:20:02 -07:00
yuvipanda
12698a20ed Move all config files inside INSTALL_PREFIX
Makes cleanup easier!
2018-06-27 03:17:01 -07:00
yuvipanda
de7fda47db Install conda packages from conda-forge explicitly
I don't think the default channel fields in construct.yaml are
working.
2018-06-27 03:05:24 -07:00
yuvipanda
82a440d46c Install tljh from github 2018-06-27 02:56:47 -07:00
yuvipanda
7c1e0b612d Include conda channels in hub environment 2018-06-27 02:56:09 -07:00
yuvipanda
f03e093b90 Explicitly tell JupyterHub it is running on port 80
Because it is!
2018-06-27 02:27:37 -07:00
yuvipanda
ac7bd88105 Hide stdout from pip installs 2018-06-27 02:14:20 -07:00
yuvipanda
aa522faf7f Don't use tee to write service unit files
We are running as root now directly, no need to tee
2018-06-27 02:10:26 -07:00
yuvipanda
e957fc3bf0 Don't use sudo for everything
We are running as root, and will rely on dropping privs via
systemd rather than sudo
2018-06-27 02:07:49 -07:00
yuvipanda
cf4bd7e36e Separate jupyterhub & chp services
Allows restarting hub for config changes without disrupting user
service!
2018-06-27 02:03:08 -07:00
yuvipanda
6fcc5cd357 Support user resource limits
Set default limit to 1G. Possibly controversial!
2018-06-27 01:30:34 -07:00
yuvipanda
459b985a19 Load user lists & auth config from a YAML file
- Load config only once at startup.
  A lot of jupyterhub config (like user lists) take effect only at
  startup, so live reload is not super useful. It will make the
  software more complex, so let's not do it.
- Add pyyaml as a dependency of tljh.
- Remove escapism dependency since it is not actually used
2018-06-27 01:19:10 -07:00
yuvipanda
4bfc04c225 Add escapism as a package dependency 2018-06-27 00:35:17 -07:00
yuvipanda
9f35602d42 Remove sudo rights from admins when they are no longer admins 2018-06-27 00:33:41 -07:00
yuvipanda
f90a0fa540 Use classic unix users rather than systemd dynamic users
Dynamic Users are neat and probably very useful for a tmpnb
style situation. However, for regular use they have the following
problems:

1. Can't set ProtectHome=no, so you can never apt install or
   similar from inside admin accounts.
2. Dynamic uid / gid makes it hard to write sudo rules. We want
   admin users to have sudo.
3. Persistent uids / gids are very useful for ad-hoc ACLs between
   users. gid sharing isn't the most flexible sharing mechanism,
   but it is well known & quite useful.
4. /etc/skel is pretty useful!
2018-06-26 23:50:07 -07:00
yuvipanda
335ba3c8a6 Remove unused old conda package leftovers 2018-06-26 21:21:18 -07:00
yuvipanda
8a2b6f608c Add base conda constructor files 2018-06-26 18:37:57 -07:00
yuvipanda
5f4aed5b4b Add a simple installer!
Sortof re-invents what debian packages do a little bit.
2018-06-26 18:37:24 -07:00
yuvipanda
4042288e91 Move jupyterhub_config.py inside the package
This is where it's referred to from the systemd package
2018-06-26 18:36:53 -07:00
yuvipanda
4ec145f9b8 Strip out random null bytes better in output fron conda
WAT
2018-06-26 18:36:20 -07:00
yuvipanda
303d2d0e88 Call conda more resiliently 2018-06-26 18:35:58 -07:00
yuvipanda
95a2f1987a Add setup.py 2018-06-26 18:35:19 -07:00
yuvipanda
f7813a9385 Add function to install packages from pip too 2018-06-26 17:38:56 -07:00
yuvipanda
92558e913e Add unit test for conda environment management
- Also fix a bug caught by unit test!
2018-06-26 04:40:39 -07:00
yuvipanda
6dc68210c2 Move conda wrappers to their own module 2018-06-26 04:14:29 -07:00
yuvipanda
56c5e21824 Manage user conda environments from JupyterHub 2018-06-15 16:56:02 -07:00
yuvipanda
f04bf9bdfb Initial commit 2018-06-15 16:17:07 -07:00
Yuvi Panda
4a74ad17a1 Initial commit 2018-06-15 15:37:13 -07:00