-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from kobotoolbox/upgrades-2021
Major upgrades 2021
- Loading branch information
Showing
139 changed files
with
23,468 additions
and
19,307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
data | ||
**/node_modules | ||
**/*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Build and push *base* image to Docker Hub | ||
|
||
on: | ||
push: | ||
# Don't waste time building every push: consider only tags, which are | ||
# usually releases | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker-base-image-build-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: mr-smithers-excellent/docker-build-push@v5 | ||
with: | ||
image: kobotoolbox/reports_base | ||
tags: latest | ||
registry: docker.io | ||
dockerfile: Dockerfile.base | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ koboreports/static/assets | |
/media/ | ||
/koboreports/static/login.css | ||
node_modules | ||
huey.db* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,53 @@ | ||
FROM ubuntu:xenial | ||
|
||
########### | ||
# apt-get # | ||
########### | ||
|
||
ADD https://deb.nodesource.com/setup_6.x /tmp/setup_6.x.bash | ||
|
||
RUN bash /tmp/setup_6.x.bash && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
libgmp10 \ | ||
libpq-dev \ | ||
libxrender1 \ | ||
nodejs \ | ||
texlive-full \ | ||
wget | ||
FROM node:14 | ||
|
||
# Docker default of `/bin/sh` doesn't support `source` | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Add Conda repository | ||
# https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html | ||
RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \ | ||
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \ | ||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list | ||
|
||
# Install Conda and other OS-level dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
conda \ | ||
pandoc \ | ||
libgmp10 \ | ||
libpq-dev \ | ||
libxrender1 \ | ||
texlive-full | ||
|
||
# Work around a font rendering problem; see | ||
# https://github.com/kobotoolbox/reports/issues/136 | ||
# FIXME: figure out what subset of `texlive-full` is actually needed | ||
# Do not `apt-get autoremove` after this(!) since it would remove necessary | ||
# packages | ||
RUN apt-get remove -y tex-gyre | ||
|
||
########## | ||
# pandoc # | ||
########## | ||
|
||
# TODO: Remove --no-check-certificate | ||
RUN wget --no-check-certificate https://github.com/jgm/pandoc/releases/download/1.15.0.6/pandoc-1.15.0.6-1-amd64.deb -O pandoc.deb && \ | ||
dpkg -i pandoc.deb && \ | ||
rm pandoc.deb | ||
|
||
############################## | ||
# conda install Python and R # | ||
############################## | ||
|
||
RUN wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh && \ | ||
chmod +x miniconda.sh && \ | ||
./miniconda.sh -b && \ | ||
rm miniconda.sh | ||
ENV PATH /root/miniconda2/bin:$PATH | ||
# `apt-get install conda` does not actually put Conda on the PATH | ||
ENV PATH /opt/conda/bin:$PATH | ||
RUN conda update --yes conda | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
# https://www.continuum.io/content/conda-data-science | ||
# Copy only the files that define dependencies, not all the source files, to | ||
# avoid unnecessarily invalidating the Docker layer cache | ||
COPY environment.yml /app/ | ||
RUN conda env create | ||
COPY jsapp/package.json jsapp/package-lock.json /app/jsapp/ | ||
|
||
# http://stackoverflow.com/a/25423366/3756632 | ||
# need this for "source activate" commands | ||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
# Install Python and R dependencies | ||
RUN conda env create | ||
|
||
# R libraries not available through conda | ||
# Install R libraries not available through Conda | ||
RUN source activate koboreports && \ | ||
Rscript -e "install.packages('pander', repos='http://cran.rstudio.com/', type='source')" -e "library(pander)" | ||
Rscript -e "install.packages('pander', repos='http://cran.rstudio.com/', type='source')" \ | ||
-e "library(pander)" | ||
|
||
############################# | ||
# install node dependencies # | ||
############################# | ||
# At this time, the `node:14` image includes npm 6, but npm pesters us about | ||
# upgrading to 7. Oblige it: | ||
RUN npm install -g npm@7 | ||
|
||
RUN npm install -g grunt-cli | ||
COPY demo/package.json /tmp/package.json | ||
RUN cd /tmp && npm install && mkdir /app/demo && \ | ||
cp -a /tmp/node_modules /app/demo/ | ||
# Install Node.js dependencies | ||
RUN cd jsapp && npm install |
Oops, something went wrong.