All Projects → felipenoris → math-server-docker

felipenoris / math-server-docker

Licence: MIT license
The ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages.

Programming Languages

Dockerfile
14818 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to math-server-docker

Best Of Jupyter
🏆 A ranked list of awesome Jupyter Notebook, Hub and Lab projects (extensions, kernels, tools). Updated weekly.
Stars: ✭ 200 (+185.71%)
Mutual labels:  jupyter-kernels, jupyterhub, jupyterlab
rk
The remote Jupyter kernel/kernels administration utility
Stars: ✭ 53 (-24.29%)
Mutual labels:  jupyter-kernels, jupyterhub, jupyterlab
Jupyterlab Hub
Deprecated: JupyterLab extension for running JupyterLab with JupyterHub
Stars: ✭ 181 (+158.57%)
Mutual labels:  jupyterhub, jupyterlab
docker-stacks
Ready-to-run Docker images containing Jupyter applications
Stars: ✭ 6,573 (+9290%)
Mutual labels:  jupyterhub, jupyterlab
Awesome Jupyter
A curated list of awesome Jupyter projects, libraries and resources
Stars: ✭ 2,523 (+3504.29%)
Mutual labels:  jupyterhub, jupyterlab
workshops-setup cloud analytics machine
Tips and Tricks to setup a cloud machine for Analytics and Data Science with R, RStudio and Shiny Servers, Python and JupyterLab
Stars: ✭ 12 (-82.86%)
Mutual labels:  shiny-server, jupyterlab
ReinforcementLearningZoo.jl
juliareinforcementlearning.org/
Stars: ✭ 46 (-34.29%)
Mutual labels:  julia-language
Tectonic.jl
Tectonic typesetting for Julia.
Stars: ✭ 21 (-70%)
Mutual labels:  julia-language
julia-NotepadPlusPlus
Julia language support for Notepad++
Stars: ✭ 34 (-51.43%)
Mutual labels:  julia-language
ARCHModels.jl
A Julia package for estimating ARMA-GARCH models.
Stars: ✭ 63 (-10%)
Mutual labels:  julia-language
robotkernel
Robot Framework IPython kernel for Jupyter Notebook and JupyterLab
Stars: ✭ 69 (-1.43%)
Mutual labels:  jupyterlab
18s191
Course 18.S191 at MIT, Spring 2021 - Introduction to computational thinking with Julia:
Stars: ✭ 2,094 (+2891.43%)
Mutual labels:  julia-language
KittyTerminalImages.jl
A package that allows Julia to display images in the kitty terminal editor
Stars: ✭ 57 (-18.57%)
Mutual labels:  julia-language
julia-workshop
"Integrating Julia in real-world, distributed pipelines" for JuliaCon 2017
Stars: ✭ 39 (-44.29%)
Mutual labels:  julia-language
PartialLeastSquaresRegressor.jl
Implementation of a Partial Least Squares Regressor
Stars: ✭ 31 (-55.71%)
Mutual labels:  julia-language
LocalCoverage.jl
Trivial functions for working with coverage for packages locally.
Stars: ✭ 55 (-21.43%)
Mutual labels:  julia-language
GlobalSensitivity.jl
Robust, Fast, and Parallel Global Sensitivity Analysis (GSA) in Julia
Stars: ✭ 30 (-57.14%)
Mutual labels:  julia-language
CFD-Julia-12-steps--o-Navier-Stokes-Equations
This is a replication of "CFD Python: 12 steps to Navier-Stokes" in Julia
Stars: ✭ 33 (-52.86%)
Mutual labels:  julia-language
EmbracingUncertainty
Material for AMLD 2020 workshop "Bayesian Inference: embracing uncertainty"
Stars: ✭ 23 (-67.14%)
Mutual labels:  julia-language
Gen.jl
A general-purpose probabilistic programming system with programmable inference
Stars: ✭ 1,595 (+2178.57%)
Mutual labels:  julia-language

math-server-docker

License

Dockerfile to build the ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages.

It's based on CentOS 7 image, which is a very stable Linux distribution, compatible with Red Hat (widely used in Corporations), but often offers outdated packages. In order to provide up-to-date tools, this Dockerfile builds most tools from source.

List of tools

There's also a number of utilities under the hood:

Usage

To build the image, run the following comand:

# docker build -t math-server .

Be patient. It may take up to 8 hours to complete.

After the build is complete, you can start the server with:

# docker run -d -p 8787:8787 -p 8000:8000 --name ms1 math-server

With a running container, you can go ahead and create users:

# docker exec ms1 useradd myuser

# docker exec -it ms1 passwd myuser

The default ports are:

  • 8787 for RStudio

  • 8000 for Jupyter

Requirements

Docker.

Application specific notes

The last command in the Dockerfile starts Jupyterhub and RStudio:

CMD /usr/lib/rstudio-server/bin/rserver \
	&& jupyterhub --no-ssl -f jupyterhub_config.py

Jupyter

Data files are at /usr/local/share/jupyter/hub.

By default, Jupyter will be accessible on the following link: http://localhost:8000, and will create state files (jupyterhub_cookie_secret, jupyterhub.sqlite) on current directory, and use default configuration.

You can generate a sample configuration file with:

# jupyterhub --generate-config

To start the server using a configuration file, use:

# jupyterhub -f jupyterhub_config.py

To set IP and port, use:

# jupyterhub --ip=192.168.1.2 --port=443

You may have to open port for external access:

# /sbin/iptables -I INPUT -p tcp -m tcp --dport 8000 -j ACCEPT
# /sbin/service iptables save

For https support, add the following lines to the config file:

c.JupyterHub.port = 443
c.JupyterHub.ssl_cert = '/root/.ssh/sample-cert.pem'
c.JupyterHub.ssl_key = '/root/.ssh/sample-key.pem'

443 is the default port for https. So the server will be accessible using https://localhost.

sample-cert.pem is the signed certificate file, and sample-key.pem is the private ssl key.

You can generate self signed certificate file by running the code below, but be aware that your browser will not recognize the certificate as trusted.

# mkdir ~/.ssh
# openssl req -x509 -newkey rsa:2048 -keyout ~/.ssh/sample-key.pem -out ~/.ssh/sample-cert.pem -days 9999 -nodes -subj "/C=BR/ST=Rio de Janeiro/L=Rio de Janeiro/O=org/OU=unit/CN=website"
# chmod 400 sample*.pem

This project provides a minimal jupyter_config.py configuration file that sets a few important environment variables that should be passed to child spawned processes, namely: 'PATH', 'LD_LIBRARY_PATH', 'JAVA_HOME', 'CPATH', 'CMAKE_ROOT', 'http_proxy', 'https_proxy'.

Jupyterlab

Jupyterlab is the default user interface. This behavior is set by the following line in the provided jupyterhub_config.py file:

c.Spawner.default_url = '/lab'

To revert to old Jupyter user interface, you can either access manually the /tree url (as in http://localhost:8000/user/username/tree) or edit jupyterhub_config.py deleting the c.Spawner.default_url line.

See Jupyterlab documentation for more information.

RStudio

Configuration files are at /etc/rstudio. There's also the Server Options file at /usr/lib/rstudio-server/R/ServerOptions.R.

Default port is 8787.

Change the default port by editing rserver.conf. The following will change to port 80:

# echo -e "www-port=80" | tee /etc/rstudio/rserver.conf
# rstudio-server restart
# rstudio-server verify-installation

auth-pam-sessions-profile directive on /etc/rstudio.rserver.conf may not work. If that happens, RStudio will look at /etc/pam.d/rstudio.

Proxy settings are not configured in RStudio by default. If you're running behind proxy, you should update ServerOptions.R file.

RUN echo "options(download.file.method = 'wget')" >> /usr/lib/rstudio-server/R/ServerOptions.R
RUN echo "Sys.setenv(http_proxy = 'my-proxy-url')" >> /usr/lib/rstudio-server/R/ServerOptions.R
RUN echo "Sys.setenv(https_proxy = 'my-proxy-url')" >> /usr/lib/rstudio-server/R/ServerOptions.R

Packages

Python

Users can packages with conda or pip command line.

With pip, users can install local packages for Python2 using:

$ source activate py2

$ pip install --user pkgname

And also for Python3 using:

$ source activate py3

$ pip install --user pkgname

Refer to conda documentation to install packages using conda utility.

R

Check package locations with $ R -e '.libPaths()'.

System packages will be installed at /usr/lib64/R/library.

Each user can have a local package dir, automatically created under ~/R.

root user will add packages with R -e 'install.packages("pkg-name")' command.

Julia

Since Julia v1.0, system packages are disabled. Only user-level packages are supported.

To install IJulia kernel, open a terminal and use the following commands:

julia> using Pkg

julia> pkg"add IJulia"

Restart your Jupyter session. After that, a Julia notebook option should show up.

LaTeX

The Docker image comes with a LaTeX distribution that is installed using texlive tool. TeX packages can me managed using tlmgr.

System-wide packages can be installed using:

# tlmgr install [pkgname]

Users can also install local packages. To do that, a user must initialize a ~/texmf tree:

$ tlmgr init-usertree

After that, the user can install local packages using:

$ tlmgr --usermode install [pkgname]

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].