Skip to content

Commit

Permalink
Merge pull request #34 from BerriJ/dev
Browse files Browse the repository at this point in the history
R 4.3.2 + pybind11 + armadillo + carma
  • Loading branch information
BerriJ authored Nov 21, 2023
2 parents 3a055ac + 19e0020 commit 298e5c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
24 changes: 20 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula sele
ca-certificates \
git \
build-essential \
cmake \
ccache \
libboost-all-dev \
libarmadillo-dev \
netbase \
zip \
unzip \
Expand All @@ -49,7 +52,6 @@ RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula sele
update-locale LANG=en_US.UTF-8 &&\
git clone --depth=1 https://github.com/sindresorhus/pure.git /home/$USERNAME/.zsh/pure \
&& rm -rf /home/$USERNAME/.zsh/pure/.git \
&& apt-get autoremove -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -81,15 +83,26 @@ RUN chmod +x install_scripts/install_phantomjs.sh &&\
#
# ENV PATH="/usr/local/vcpkg:${PATH}"

# Install Python CARMA
RUN git clone --depth=1 https://github.com/RUrlus/carma.git /usr/local/carma \
&& rm -rf /usr/local/carma/.git \
&& cd /usr/local/carma \
&& mkdir build \
&& cd build \
&& cmake -DCARMA_INSTALL_LIB=ON .. \
&& cmake --build . --config Release --target install \
&& chown --recursive $USERNAME:$USERNAME /usr/local/carma

# Install Python
COPY package_lists/python_packages.txt /package_lists/python_packages.txt

RUN apt-get update &&\
apt-get -y --no-install-recommends install python3-pip && \
apt-get -y --no-install-recommends install \
python3-pip \
python3-dev && \
# Python packages
pip3 install -U --no-cache-dir \
$(grep -o '^[^#]*' package_lists/python_packages.txt | tr '\n' ' ') \
&& apt-get autoremove -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -114,7 +127,7 @@ RUN chmod +x install_scripts/install_latex.sh &&\
ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"

# Install R
ENV R_VERSION=4.3.1
ENV R_VERSION=4.3.2

# Set RSPM snapshot see:
# https://packagemanager.posit.co/client/#/repos/cran/setup?r_environment=other&snapshot=2023-10-04&distribution=ubuntu-22.04
Expand All @@ -137,6 +150,9 @@ COPY --chown=$USERNAME .misc/Makevars /home/$USERNAME/.R/.
RUN mkdir /home/$USERNAME/.ccache && chown -R $USERNAME /home/$USERNAME/.ccache
COPY --chown=$USERNAME .misc/ccache.conf /home/$USERNAME/.ccache/.

RUN chown -R $USERNAME /usr/local/lib
RUN chown -R $USERNAME /usr/local/include

# Switch to non-root user
USER $USERNAME

Expand Down
1 change: 0 additions & 1 deletion install_scripts/install_latex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ echo "save_size = 7999999" >> /usr/local/texlive/texmf.cnf

rm -r /tmp/*
rm -r /root/.cpan/build/*
apt-get autoremove -y
apt-get autoclean -y
rm -rf /var/lib/apt/lists/*
1 change: 0 additions & 1 deletion install_scripts/install_r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ R -e "Refinitiv::install_eikon()"
chown --recursive $USERNAME:$USERNAME /usr/local/lib/R/site-library

rm -r /tmp/*
apt-get remove --purge -y $BUILDDEPS
apt-get autoclean -y
rm -rf /var/lib/apt/lists/*

2 changes: 2 additions & 0 deletions package_lists/python_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ numpy
pandas
plotly
properscoring
pybind11[global]
pylint
pyparsing==2.4.7
pytest
Expand All @@ -28,4 +29,5 @@ requests
scikit-learn
scipy
statsmodels
tdqm
uvicorn

0 comments on commit 298e5c3

Please sign in to comment.