diff --git a/.github/workflows/build_deploy_latest.yml b/.github/workflows/build_deploy_latest.yml new file mode 100644 index 00000000..1a39b516 --- /dev/null +++ b/.github/workflows/build_deploy_latest.yml @@ -0,0 +1,26 @@ +name: Build and deploy to DockerHub + +on: + push: + branches: + - master + +# Specify jobs +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + config: + - { image_name: ubuntu-build, dockerfile: ubuntu.Dockerfile } + steps: + - uses: actions/checkout@master + - name: Login, build and push image + if: success() + uses: whoan/docker-build-with-cache-action@v4 + with: + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" + image_name: "genrl/${{matrix.config.image_name}}" + dockerfile: "docker/${{matrix.config.dockerfile}}" + push_image_and_stages: true diff --git a/docker/ubuntu.Dockerfile b/docker/ubuntu.Dockerfile new file mode 100644 index 00000000..e4ccc6d3 --- /dev/null +++ b/docker/ubuntu.Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:latest + +# Install baseline required tools +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \ + && apt-get update && \ + apt install -y --no-install-recommends \ + # C++ + build-essential g++ gcc git make wget \ + # Python + python-setuptools python-dev \ + sudo \ + libgtk2.0-dev \ + && apt-get install -y --reinstall ca-certificates \ + # Do this cleanup every time to ensure minimal layer sizes + # TODO: Turn this into a script + && apt-get clean autoclean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/{apt,dpkg,cache,log} + +COPY ./requirements.txt requirements.txt + +RUN wget --no-check-certificate https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh \ + && bash miniconda.sh -b -p /usr/local/miniconda \ + && hash -r \ + && /usr/local/miniconda/bin/conda config --set always_yes yes --set changeps1 no \ + && /usr/local/miniconda/bin/conda update -q conda \ + #&& /usr/local/miniconda/bin/conda install -q conda-env \ + && /usr/local/miniconda/bin/conda create -q -n genrl python=3.6 wheel virtualenv pytest readme_renderer pandas cmake nomkl numpy boost py-boost scipy scikit-learn six joblib \ + && /usr/local/miniconda/bin/conda clean -a \ + && /usr/local/miniconda/bin/conda init \ + && rm miniconda.sh + +ENV PATH="/usr/local/miniconda/bin:${PATH}" +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" + +RUN /usr/local/miniconda/envs/genrl/bin/python -m pip install -r requirements.txt + && /usr/local/miniconda/envs/genrl/bin/python -m pip install black isort==4.3.2 flake8 codecov pytest-cov