Skip to content

Commit

Permalink
Dev (#45)
Browse files Browse the repository at this point in the history
* Add tdqm python package

* Add mysql python package

* Add lftp ubuntu package

* Fix vcpkg install

* Add quarto vs-code extension

* Add sstudentt python package

* Add numba python package

* Bump ubuntu from `6d7b5d3` to `a6d2b38`

Bumps ubuntu from `6d7b5d3` to `a6d2b38`.

---
updated-dependencies:
- dependency-name: ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump R to 4.4.0

* Add scoringrules python package

* Add python packages for building packages

* Add python3-venv to the list of dependencies

* Add ruff and black python packages

* Bump docker/build-push-action from 5 to 6

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ubuntu from `a6d2b38` to `19478ce`

Bumps ubuntu from `a6d2b38` to `19478ce`.

---
updated-dependencies:
- dependency-name: ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump RSPM snapshot and R to 4.4.1

* Add more recent pandoc version

* Add latex packages for rjtools template

* Add h5py python package

* Bump pandoc version

* Bump ubuntu from `19478ce` to `340d9b0`

Bumps ubuntu from `19478ce` to `340d9b0`.

---
updated-dependencies:
- dependency-name: ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Downgrade pandoc

* Add covr R package and dependencies

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
BerriJ and dependabot[bot] authored Aug 14, 2024
1 parent 963280f commit 3d16d2f
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 87 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
// Live Share
"ms-vsliveshare.vsliveshare",
// Copilot
"GitHub.copilot"
"GitHub.copilot",
// Quarto
"quarto.quarto"
],
// Set *default* container specific settings
// Important for radian and latex
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
echo "IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
echo "IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
echo "IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
-
name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
160 changes: 81 additions & 79 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:jammy@sha256:6d7b5d3317a71adb5e175640150e44b8b9a9401a7dd394f44840626aff9fa94d
FROM ubuntu:jammy@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221

SHELL ["/bin/bash", "-c"]

ENV DISPLAY=:0 \
TZ=Europe/Berlin
TZ=Europe/Berlin

ARG USERNAME=vscode
ARG USER_UID=1000
Expand All @@ -12,53 +12,54 @@ ARG DEBIAN_FRONTEND=noninteractive

# Add non root user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -rm -d /home/$USERNAME -s /bin/bash -g root --uid $USER_UID --gid $USER_GID $USERNAME \
&& addgroup $USERNAME staff
&& useradd -rm -d /home/$USERNAME -s /bin/bash -g root --uid $USER_UID --gid $USER_GID $USERNAME \
&& addgroup $USERNAME staff

# Create folders to mount extensions
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \
/home/$USERNAME/.vscode-server-insiders/extensions \
workspaces \
&& chown -R $USERNAME \
/home/$USERNAME/.vscode-server \
/home/$USERNAME/.vscode-server-insiders \
workspaces
/home/$USERNAME/.vscode-server-insiders/extensions \
workspaces \
&& chown -R $USERNAME \
/home/$USERNAME/.vscode-server \
/home/$USERNAME/.vscode-server-insiders \
workspaces

# Ubuntu Setup
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections &&\
apt-get update &&\
apt-get -y --no-install-recommends install \
ca-certificates \
git \
build-essential \
cmake \
ninja-build \
ccache \
gfortran \
netbase \
zip \
unzip \
xclip \
zsh \
gnupg2 \
nano \
gdb \
ssh-client \
fontconfig \
pkg-config \
default-libmysqlclient-dev \
ttf-mscorefonts-installer \
locales &&\
locale-gen en_US.UTF-8 &&\
locale-gen de_DE.UTF-8 &&\
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 autoclean -y \
&& rm -rf /var/lib/apt/lists/*
apt-get update &&\
apt-get -y --no-install-recommends install \
ca-certificates \
git \
build-essential \
cmake \
ninja-build \
ccache \
gfortran \
netbase \
zip \
unzip \
xclip \
zsh \
lftp \
gnupg2 \
nano \
gdb \
ssh-client \
fontconfig \
pkg-config \
default-libmysqlclient-dev \
ttf-mscorefonts-installer \
locales &&\
locale-gen en_US.UTF-8 &&\
locale-gen de_DE.UTF-8 &&\
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 autoclean -y \
&& rm -rf /var/lib/apt/lists/*

ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
LANG=en_US.UTF-8

# Font config
# "LM Roman 10", "Times New Roman" ... use `showtext` package in R
Expand All @@ -71,53 +72,54 @@ RUN fc-cache -f -v

# Install quarto
ENV QUARTO_VERSION="1.4.551"

COPY install_scripts/install_quarto.sh /install_scripts/install_quarto.sh

RUN chmod +x install_scripts/install_quarto.sh &&\
install_scripts/install_quarto.sh
install_scripts/install_quarto.sh

RUN wget https://github.com/jgm/pandoc/releases/download/3.1.6.2/pandoc-3.1.6.2-1-amd64.deb &&\
dpkg -i pandoc-3.1.6.2-1-amd64.deb

# Install phantomjs
COPY install_scripts/install_phantomjs.sh /install_scripts/install_phantomjs.sh

RUN chmod +x install_scripts/install_phantomjs.sh &&\
install_scripts/install_phantomjs.sh
install_scripts/install_phantomjs.sh

# Install vcpkg C++ dependency manager
RUN git clone --depth=1 https://github.com/Microsoft/vcpkg /usr/local/vcpkg \
&& rm -rf /usr/local/vcpkg/.git \
&& cd /usr/local/vcpkg \
&& ./bootstrap-vcpkg.sh \
&& ./vcpkg integrate install \
&& /usr/local/vcpkg/vcpkg install armadillo \
&& /usr/local/vcpkg/vcpkg install pybind11 \
&& chown --recursive $USERNAME:$USERNAME /usr/local/vcpkg
RUN git clone --depth=1 https://github.com/Microsoft/vcpkg --branch 2024.04.26 /usr/local/vcpkg \
&& rm -rf /usr/local/vcpkg/.git \
&& cd /usr/local/vcpkg \
&& ./bootstrap-vcpkg.sh \
&& ./vcpkg integrate install \
&& /usr/local/vcpkg/vcpkg install armadillo \
&& /usr/local/vcpkg/vcpkg install pybind11 \
&& chown --recursive $USERNAME:$USERNAME /usr/local/vcpkg

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

# Set PATH for user installed python packages
ENV PATH="/home/vscode/.local/bin:${PATH}"
Expand All @@ -127,31 +129,31 @@ COPY install_scripts/install_latex.sh /install_scripts/install_latex.sh
COPY package_lists/latex_packages.txt /package_lists/latex_packages.txt

RUN chmod +x install_scripts/install_latex.sh &&\
install_scripts/install_latex.sh \
&& export PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}" \
&& tlmgr option -- autobackup 0 \
&& tlmgr option -- docfiles 0 \
&& tlmgr option -- srcfiles 0 \
&& tlmgr install \
$(grep -o '^[^#]*' package_lists/latex_packages.txt | tr '\n' ' ') \
&& chown --recursive $USERNAME:$USERNAME /usr/local/texlive
install_scripts/install_latex.sh \
&& export PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}" \
&& tlmgr option -- autobackup 0 \
&& tlmgr option -- docfiles 0 \
&& tlmgr option -- srcfiles 0 \
&& tlmgr install \
$(grep -o '^[^#]*' package_lists/latex_packages.txt | tr '\n' ' ') \
&& chown --recursive $USERNAME:$USERNAME /usr/local/texlive

# Set Latex Path
ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"

# Install R
ENV R_VERSION=4.3.3
ENV R_VERSION=4.4.1

# Set RSPM snapshot see:
# https://packagemanager.posit.co/client/#/repos/cran/setup?r_environment=other&snapshot=2023-10-04&distribution=ubuntu-22.04
ENV R_REPOS=https://packagemanager.posit.co/cran/__linux__/jammy/2024-03-21
ENV R_REPOS=https://packagemanager.posit.co/cran/__linux__/jammy/2024-07-14

COPY install_scripts/install_r.sh /install_scripts/install_r.sh
COPY package_lists/r_packages.txt /package_lists/r_packages.txt
COPY package_lists/r_packages_github.txt /package_lists/r_packages_github.txt

RUN chmod +x install_scripts/install_r.sh &&\
install_scripts/install_r.sh
install_scripts/install_r.sh

COPY --chown=$USERNAME .misc/.zshrc /home/$USERNAME/.

Expand Down
3 changes: 1 addition & 2 deletions install_scripts/install_latex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Install build dependencies
apt-get update
apt-get install -y --no-install-recommends \
wget \
pandoc
wget

# Install Latex
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
Expand Down
1 change: 0 additions & 1 deletion install_scripts/install_r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ RUNDEPS="ca-certificates \
vim-tiny \
wget \
dirmngr \
pandoc \
libmagick++-dev \
libpoppler-cpp-dev \
libudunits2-dev \
Expand Down
4 changes: 4 additions & 0 deletions package_lists/latex_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ ieeetran
ifoddpage
inconsolata
koma-script
l3backend
l3backend-dev
latexindent # Indentation
latexmk
latex-tools-dev
Expand Down Expand Up @@ -99,9 +101,11 @@ textpos
threeparttable
threeparttablex
thumbpdf
titlesec
#! To find packages: tlmgr search --global --file "authblk.sty"
tracklang
ulem
upquote
varwidth
was
wrapfig
Expand Down
10 changes: 10 additions & 0 deletions package_lists/python_packages.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
aiofiles
autopep8
black
bspline
build
celery
fastapi
flower
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
h5py
investiny
investpy
ipykernel
Jinja2
kaleido
matplotlib
meteostat
mysql
mysqlclient
nbclient
nbformat
numba
numdifftools
numpy
pandas
Expand All @@ -28,9 +33,14 @@ pyparsing==2.4.7
pytest
redis
requests
ruff
scikit-learn
scipy
scoringrules
setuptools
sqlalchemy
sstudentt
statsmodels
tdqm
tqdm
uvicorn
3 changes: 3 additions & 0 deletions package_lists/r_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cli
conflicted
copula
corrplot
covr
cowplot
crayon
crosstalk
Expand All @@ -17,6 +18,7 @@ devtools
DiceKriging
doParallel
doSNOW
DT
energy
eurostat
evir
Expand Down Expand Up @@ -47,6 +49,7 @@ gridSVG
grImport2
gt
Hmisc
htmltools
htmlwidgets
igraph
inline
Expand Down

0 comments on commit 3d16d2f

Please sign in to comment.