diff --git a/.travis.yml b/.travis.yml index ba118a49..6fdb61c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ services: - mysql + - docker + +sudo: required language: python # this works for Linux but is an error on macOS or Windows @@ -61,6 +64,10 @@ install: script: - bash tests/scripts/run_tests.sh + - docker build -t rapids . + +# after_success: +# need to push built image to appropriate repo in docker hub (to do: encrypt password) branches: only: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..916d326d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# getting base image ubuntu +FROM ubuntu:20.04 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt update && apt install -y \ + libcurl4-openssl-dev \ + libssl-dev \ + libxml2-dev \ + libmysqlclient-dev \ + mysql-server +RUN apt-get update && apt-get install -y gnupg +RUN apt-get update && apt-get install -y software-properties-common +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 +RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' +RUN apt update && apt install -y r-base +RUN apt install -y pandoc +RUN apt install -y git +RUN apt-get update && apt-get install -y vim +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 +ENV PATH /opt/conda/bin:$PATH +RUN apt-get update --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda clean -tipsy && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate base" >> ~/.bashrc +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini +RUN chmod +x /usr/bin/tini +RUN git clone https://github.com/carissalow/rapids +ENTRYPOINT [ "/usr/bin/tini", "--" ] +CMD [ "/bin/bash" ] +RUN conda update -n base -c defaults conda +WORKDIR /rapids +RUN conda env create -f environment.yml -n rapids +RUN R -e 'renv::restore()' +COPY rapids_example.sql ./data/external +RUN echo "source activate rapids" > ~/.bashrc +ENV PATH /opt/conda/envs/rapids/bin:$PATH \ No newline at end of file