-
Notifications
You must be signed in to change notification settings - Fork 64
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 #669 from ucbds-infra/beta
- Loading branch information
Showing
467 changed files
with
5,687 additions
and
8,481 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
This file was deleted.
Oops, something went wrong.
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
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
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
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,56 +1,33 @@ | ||
# Dockerfile forked from https://github.com/jeffheaton/docker-jupyter-python-r/blob/master/Dockerfile | ||
FROM ubuntu:20.04 | ||
|
||
# common packages | ||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y tzdata git vim wget libssl-dev nano && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# miniconda | ||
RUN echo 'export PATH=/opt/conda/bin:$PATH' >> /root/.bashrc && \ | ||
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ | ||
/bin/bash ~/miniconda.sh -b -p /opt/conda && \ | ||
rm ~/miniconda.sh && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
# R pre-reqs | ||
RUN apt-get clean && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends fonts-dejavu gfortran gcc && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# R | ||
RUN apt-get clean && \ | ||
apt-get update && \ | ||
conda install -y "r-base>=4.0.0" r-essentials && \ | ||
conda install -c r r-irkernel r-essentials r-devtools -c conda-forge && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# install wkhtmltopdf for otter export | ||
RUN apt-get clean && \ | ||
apt-get update && \ | ||
apt-get install -y pandoc && \ | ||
apt-get install -y -f texlive-xetex texlive-fonts-recommended texlive-lang-chinese && \ | ||
wget --quiet -O /tmp/wkhtmltopdf.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb && \ | ||
apt-get install -y /tmp/wkhtmltopdf.deb && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the locale to UTF-8 to ensure that Unicode output is encoded correctly | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
|
||
# create dir for autograder | ||
RUN mkdir /autograder | ||
|
||
# Python requirements | ||
ADD requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
RUN pip install otter-grader==4.4.1 | ||
RUN Rscript -e "install.packages('ottr', dependencies=TRUE, repos='http://cran.us.r-project.org')" | ||
# Docker image for setting up a development environment and Otter's automated tests. | ||
|
||
FROM docker/buildx-bin as buildx | ||
|
||
FROM ubuntu:latest | ||
|
||
# Make docker buildx available in the container | ||
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx | ||
|
||
# Install apt packages | ||
RUN apt-get update && apt-get upgrade -y && apt-get install -y wget make build-essential | ||
|
||
# Install mamba | ||
RUN if [ $(uname -p) = "arm" ] || [ $(uname -p) = "aarch64" ] ; \ | ||
then wget -nv https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-aarch64.sh \ | ||
-O /tmp/mamba_install.sh ; \ | ||
else wget -nv https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh \ | ||
-O /tmp/mamba_install.sh ; \ | ||
fi && \ | ||
chmod +x /tmp/mamba_install.sh && \ | ||
/tmp/mamba_install.sh -b | ||
ENV PATH=/root/mambaforge/bin:$PATH | ||
|
||
# Create mamba environment | ||
COPY environment.yml requirements.txt requirements-export.txt requirements-test.txt /tmp/ | ||
RUN mkdir -p /tmp/docs && touch /tmp/docs/requirements.txt | ||
RUN mamba env create -f /tmp/environment.yml | ||
RUN mamba run -n otter-grader Rscript -e 'install.packages("ottr", dependencies=TRUE, repos="https://cran.r-project.org")' | ||
ADD . /root/otter-grader | ||
RUN mamba run -n otter-grader pip install /root/otter-grader | ||
|
||
# Make script executable | ||
RUN chmod +x /root/otter-grader/bin/run_tests |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Runs Otter's tests and copies the resulting coverage.xml file into the /tmp directory. This script | ||
# should only be used inside a Docker container created by /Dockerfile. | ||
|
||
export PATH="/root/mambaforge/bin:$PATH" | ||
source /root/mambaforge/etc/profile.d/conda.sh | ||
source /root/mambaforge/etc/profile.d/mamba.sh | ||
cd /root/otter-grader | ||
mamba activate otter-grader | ||
make testcov PYTESTOPTS="-vv" && coverage xml -i && cp ./coverage.xml /tmp/coverage.xml |
Oops, something went wrong.