From ab18705f4d2298a2abd18b73680e3318efb09371 Mon Sep 17 00:00:00 2001 From: smirko-dev Date: Tue, 9 Nov 2021 13:01:18 +0100 Subject: [PATCH 01/12] Add R to Dockerfile --- CHANGELOG.md | 8 ++++++++ Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 939c158..5cb6aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Version 0.2 + +### Added +- R 3.6.3 to Dockerfile + +### Changed +- switched from 'pip3 install' to 'python -m pip install' commands + ## Version 0.1 ### Added diff --git a/Dockerfile b/Dockerfile index f7a16fa..94b23ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +#FROM arm32v7/ubuntu:bionic FROM arm32v7/debian:buster USER root @@ -10,14 +11,22 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ gfortran \ libatlas-base-dev \ libc-ares-dev \ + libcurl4-openssl-dev \ + libbz2-dev \ libeigen3-dev \ libffi-dev \ libfreetype6-dev \ + libgit2-dev \ libhdf5-103 \ libhdf5-dev \ libhdf5-serial-dev \ + liblzma-dev \ libopenmpi-dev \ libpng-dev \ + libpcre3 \ + libpcre3-dev \ + libreadline-dev \ + libxml2-dev \ openmpi-bin \ openssl \ python3 \ @@ -73,6 +82,23 @@ RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /r && sed -i "/c.NotebookApp.password/c c.NotebookApp.password = '`cat password`'" /root/.jupyter/jupyter_notebook_config.py \ && rm -f password +# Install R +ENV R_VERSION 3.6.3 +ADD https://ftp.fau.de/cran/src/base/R-3/R-${R_VERSION}.tar.gz . +RUN apt-get remove r-base +RUN tar -xvf R-${R_VERSION}.tar.gz \ + && rm R-${R_VERSION}.tar.gz \ + && cd R-${R_VERSION} \ + && ./configure --with-x=no --disable-java --with-pcre1 --prefix=/root/R \ + && make && make install \ + && cd .. \ + && rm -rf R-${R_VERSION} \ + && ln -s /root/R/bin/R /usr/bin/R \ + && ln -s /root/R/bin/Rscript /usr/bin/Rscript + +COPY ./install.R /root +RUN Rscript /root/install.R + # Add volume for notebooks VOLUME /root/notebooks diff --git a/README.md b/README.md index 8852a38..a131010 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Machine Learning with JupyterLab on a Raspberry Pi ![platform](https://img.shields.io/badge/platforms-RaspberryPi-silver) -[![version](https://img.shields.io/badge/version-%200.1.0-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/CHANGELOG.md) +[![version](https://img.shields.io/badge/version-%200.2.0-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/CHANGELOG.md) [![](https://img.shields.io/badge/license-MIT-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/LICENSE) [![](https://img.shields.io/badge/dockerhub-smirko%2Fmachine--learning--rpi-blue?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi) ![](https://img.shields.io/docker/pulls/smirko/machine-learning-rpi?logo=docker) From 8f2acb97445ff18c5dbfc5086f597ff952c1989c Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:06:47 +0100 Subject: [PATCH 02/12] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 94b23ba..a936542 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,7 +83,7 @@ RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /r && rm -f password # Install R -ENV R_VERSION 3.6.3 +ENV R_VERSION 3.3.3 ADD https://ftp.fau.de/cran/src/base/R-3/R-${R_VERSION}.tar.gz . RUN apt-get remove r-base RUN tar -xvf R-${R_VERSION}.tar.gz \ From f5c295f830e2d16996593e1a21f97a9554c4bb91 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:07:20 +0100 Subject: [PATCH 03/12] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb6aac..f22fdf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Version 0.2 ### Added -- R 3.6.3 to Dockerfile +- R 3.3.3 to Dockerfile ### Changed - switched from 'pip3 install' to 'python -m pip install' commands From 816b7053cba987d8ec0298de01bb42d0319e5680 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:13:07 +0100 Subject: [PATCH 04/12] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a936542..d3efb2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,7 +84,7 @@ RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /r # Install R ENV R_VERSION 3.3.3 -ADD https://ftp.fau.de/cran/src/base/R-3/R-${R_VERSION}.tar.gz . +ADD https://ftp.fau.de/cran/src/base/R-${R_VERSION:0:1}/R-${R_VERSION}.tar.gz . RUN apt-get remove r-base RUN tar -xvf R-${R_VERSION}.tar.gz \ && rm R-${R_VERSION}.tar.gz \ From f2a00ebe7cee641219dead940221c5c881efa3e7 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:13:38 +0100 Subject: [PATCH 05/12] Update docker-compose.yml --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 43399ed..f3d071d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: # - JUPYTER_PASSWORD=jupyter # - TINI_VERSION=0.19.0 # - TENSORFLOW_VERSION=2.4.0 +# - R_VERSION=3.3.3 ports: - 8881:8888 volumes: From 09a92503eb622bf12ebfa067441cc82dd7400135 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:15:46 +0100 Subject: [PATCH 06/12] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a131010..507f8ac 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ If the status command shows "active (running)" the Jupyter Lab should be reachab The docker container is based on [Debian Buster](https://hub.docker.com/r/arm32v7/debian/) for arm32v7 and installs - [TensorFlow](https://www.tensorflow.org/) from [tensorflow-on-arm](https://github.com/lhelontra/tensorflow-on-arm) or [tensorflow-arm-bin](https://github.com/bitsy-ai/tensorflow-arm-bin) - [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), [Scikit-learn](https://scikit-learn.org/stable/index.html), [Matplotlib](https://matplotlib.org) and [Pandas](https://pandas.pydata.org/) + - [R Project ](https://www.r-project.org/) - [Tini](https://github.com/krallin/tini) which operates as a process subreaper for jupyter to prevent kernel crashes - [Jupyter Notebook](https://jupyter.org/) with [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/) as a simple [notebook server](https://jupyter-notebook.readthedocs.io/en/stable/public_server.html) with password protection @@ -251,6 +252,7 @@ The docker container is based on [Debian Buster](https://hub.docker.com/r/arm32v - JUPYTER_PASSWORD = jupyter - TINI_VERSION = 0.19.0 (used for build only) - TENSORFLOW_VERSION = 2.4.0 (used for build only) +- R_VERSION = 3.3.3 (used for build only) ### Install packages From e1d3d16b5363bce8ae622144c03c2ae0e3ba5aec Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:16:32 +0100 Subject: [PATCH 07/12] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 507f8ac..b88d5d6 100644 --- a/README.md +++ b/README.md @@ -185,14 +185,14 @@ sudo apt-get install -y --no-install-recommends \ ### Build and install binaries ```sh -wget https://ftp.fau.de/cran/src/base/R-4/R-4.1.1.tar.gz -tar -xvf R-4.1.1.tar.gz -rm R-4.1.1.tar.gz -cd R-4.1.1 +wget https://ftp.fau.de/cran/src/base/R-3/R-3.3.3.tar.gz +tar -xvf R-3.3.3.tar.gz +rm R-3.3.3.tar.gz +cd R-3.3.3 ./configure --with-x=no --disable-java --with-pcre1 --prefix= make && make install cd .. -rm R-4.1.1 +rm R-3.3.3 ``` ### Create soft links From e7974519931a487f864b6aa67ca82c8d7a3016d9 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:18:58 +0100 Subject: [PATCH 08/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b88d5d6..2edb256 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ If the status command shows "active (running)" the Jupyter Lab should be reachab The docker container is based on [Debian Buster](https://hub.docker.com/r/arm32v7/debian/) for arm32v7 and installs - [TensorFlow](https://www.tensorflow.org/) from [tensorflow-on-arm](https://github.com/lhelontra/tensorflow-on-arm) or [tensorflow-arm-bin](https://github.com/bitsy-ai/tensorflow-arm-bin) - [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/), [Scikit-learn](https://scikit-learn.org/stable/index.html), [Matplotlib](https://matplotlib.org) and [Pandas](https://pandas.pydata.org/) - - [R Project ](https://www.r-project.org/) + - [The R Project for Statistical Computing](https://www.r-project.org/) - [Tini](https://github.com/krallin/tini) which operates as a process subreaper for jupyter to prevent kernel crashes - [Jupyter Notebook](https://jupyter.org/) with [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/) as a simple [notebook server](https://jupyter-notebook.readthedocs.io/en/stable/public_server.html) with password protection From 31d0a35b16ab54a4f36fb22e016fea4eb18362b2 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:26:28 +0100 Subject: [PATCH 09/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2edb256..01e540c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![](https://img.shields.io/badge/license-MIT-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/LICENSE) [![](https://img.shields.io/badge/dockerhub-smirko%2Fmachine--learning--rpi-blue?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi) ![](https://img.shields.io/docker/pulls/smirko/machine-learning-rpi?logo=docker) +![](https://img.shields.io/docker/image-size/smirko/machine-learning-rpi/latest?logo=docker) Run [Jupyter Lab](https://jupyter.org) with [Tensorflow](https://www.tensorflow.org) on a [Raspberry Pi](https://www.raspberrypi.org) as a service or within a docker container. From 48cd17901e9959c2249e9930c296d3e48545df81 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:27:32 +0100 Subject: [PATCH 10/12] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01e540c..67a16c2 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![version](https://img.shields.io/badge/version-%200.2.0-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/CHANGELOG.md) [![](https://img.shields.io/badge/license-MIT-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/LICENSE) [![](https://img.shields.io/badge/dockerhub-smirko%2Fmachine--learning--rpi-blue?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi) -![](https://img.shields.io/docker/pulls/smirko/machine-learning-rpi?logo=docker) -![](https://img.shields.io/docker/image-size/smirko/machine-learning-rpi/latest?logo=docker) +[![](https://img.shields.io/docker/pulls/smirko/machine-learning-rpi?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi) +[![](https://img.shields.io/docker/image-size/smirko/machine-learning-rpi/latest?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi) Run [Jupyter Lab](https://jupyter.org) with [Tensorflow](https://www.tensorflow.org) on a [Raspberry Pi](https://www.raspberrypi.org) as a service or within a docker container. From 3487f3a3c0a5a8a72a8563fa66d07ed130758c26 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:32:04 +0100 Subject: [PATCH 11/12] Create install.R --- install.R | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 install.R diff --git a/install.R b/install.R new file mode 100644 index 0000000..60bc329 --- /dev/null +++ b/install.R @@ -0,0 +1,2 @@ +install.packages('IRkernel', repos='http://cran.rstudio.com/') +IRkernel::installspec(name = 'ir', displayname = 'R 3.3') From e4bff30dc7de1d6563da2e8617497f46b1d74c42 Mon Sep 17 00:00:00 2001 From: smirko-dev <64351017+smirko-dev@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:39:28 +0100 Subject: [PATCH 12/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67a16c2..09c569e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Machine Learning with JupyterLab on a Raspberry Pi -![platform](https://img.shields.io/badge/platforms-RaspberryPi-silver) +![platform](https://img.shields.io/badge/platforms-linux/arm-silver) [![version](https://img.shields.io/badge/version-%200.2.0-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/CHANGELOG.md) [![](https://img.shields.io/badge/license-MIT-blue)](https://github.com/smirko-dev/machine-learning-rpi/blob/main/LICENSE) [![](https://img.shields.io/badge/dockerhub-smirko%2Fmachine--learning--rpi-blue?logo=docker)](https://hub.docker.com/r/smirko/machine-learning-rpi)