Skip to content

Commit a28b130

Browse files
authored
Upgrade to R 4.0.5 base image (#161)
http://b/179893188
1 parent ee58c9c commit a28b130

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ADD clean-layer.sh /tmp/clean-layer.sh
66

77
# Default to python3.7
88
RUN apt-get update && \
9-
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 && \
9+
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
1010
update-alternatives --config python && \
1111
apt install -y python3-pip python3-venv && \
1212
/tmp/clean-layer.sh
@@ -20,9 +20,11 @@ RUN apt-get update && \
2020
patch libgit2-dev && \
2121
/tmp/clean-layer.sh
2222

23-
RUN apt-get update && apt-get install -y libatlas-base-dev libopenblas-dev libopencv-dev && \
24-
cd /usr/local/src && git clone --recursive --depth=1 --branch v1.6.x https://github.com/apache/incubator-mxnet.git mxnet && \
25-
cd mxnet && make -j$(nproc) USE_OPENCV=1 USE_BLAS=openblas && make rpkg && \
23+
RUN apt-get update && apt-get install -y build-essential git ninja-build ccache libatlas-base-dev libopenblas-dev libopencv-dev python3-opencv && \
24+
cd /usr/local/share && git clone --recursive --depth=1 --branch v1.8.x https://github.com/apache/incubator-mxnet.git mxnet && \
25+
cd mxnet && cp config/linux.cmake config.cmake && rm -rf build && \
26+
mkdir -p build && cd build && cmake .. && cmake --build . --parallel $(nproc) && \
27+
cd .. && make -f R-package/Makefile rpkg && \
2628
/tmp/clean-layer.sh
2729

2830
# Needed for "h5" library
@@ -33,7 +35,7 @@ RUN apt-get install -y libhdf5-dev && \
3335
apt-get install -y libpoppler-cpp-dev libtesseract-dev tesseract-ocr-eng && \
3436
/tmp/clean-layer.sh
3537

36-
RUN apt-get install -y libzmq3-dev python-pip default-jdk && \
38+
RUN apt-get install -y libzmq3-dev default-jdk && \
3739
apt-get install -y python-dev libcurl4-openssl-dev libssl-dev && \
3840
pip install jupyter pycurl && \
3941
# Install older tornado - https://github.com/jupyter/notebook/issues/4437
@@ -56,11 +58,14 @@ RUN apt-get install -y libzmq3-dev python-pip default-jdk && \
5658
pip install papermill && \
5759
/tmp/clean-layer.sh
5860

61+
# Miniconda
62+
RUN curl -sL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o mconda-install.sh && \
63+
bash -x mconda-install.sh -b -p miniconda && \
64+
rm mconda-install.sh && \
65+
/tmp/clean-layer.sh
66+
5967
# Tensorflow and Keras
60-
# Keras sets up a virtualenv and installs tensorflow
61-
# in the WORKON_HOME directory, so choose an explicit location for it.
62-
ENV WORKON_HOME=/usr/local/share/.virtualenvs
63-
RUN pip install --user virtualenv && R -e 'keras::install_keras(tensorflow = "2.3", extra_packages = c("pandas", "numpy", "pycryptodome"))'
68+
RUN R -e 'keras::install_keras(tensorflow = "2.3", extra_packages = c("pandas", "numpy", "pycryptodome"), method="conda")'
6469

6570
# Install kaggle libraries.
6671
# Do this at the end to avoid rebuilding everything when any change is made.

package_installs.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ install.packages("topicmodels")
4646

4747
install.packages("tesseract")
4848

49+
# Try to reinstall igraph and imager her until fixed in rcran.
50+
install.packages("igraph")
51+
install.packages("imager")
52+
4953
# Torch: install the full package upfront otherwise it will be installed on loading the package which doesn't work for kernels
5054
# without internet (competitions for example).
5155
library(torch)

0 commit comments

Comments
 (0)