* moving cmake installation later in docker so it is available for all versions, also switching to just use aptitude

* updating setup instructions for xlearn cmake dependency

* reverting vscode auto-formatting of setup.md table of contents
This commit is contained in:
Scott Graham 2020-07-19 14:04:35 -04:00 коммит произвёл GitHub
Родитель e855674f08
Коммит b170c8459d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 21 добавлений и 30 удалений

Просмотреть файл

@ -9,19 +9,20 @@ This document describes how to setup all the dependencies to run the notebooks i
## Table of Contents
* [Compute environments](#compute-environments)
* [Setup guide for Local or DSVM](#setup-guide-for-local-or-dsvm)
* [Requirements](#requirements)
* [Dependencies setup](#dependencies-setup)
* [Register the conda environment as a kernel in Jupyter](#Register-the-conda-environment-as-a-kernel-in-Jupyter)
* [Troubleshooting for the DSVM](#troubleshooting-for-the-dsvm)
* [Setup guide for Azure Databricks](#setup-guide-for-azure-databricks)
* [Requirements of Azure Databricks](#requirements-of-azure-databricks)
* [Repository installation](#repository-installation)
* [Troubleshooting Installation on Azure Databricks](#Troubleshooting-Installation-on-Azure-Databricks)
* [Prepare Azure Databricks for Operationalization](#prepare-azure-databricks-for-operationalization)
* [Install the utilities via PIP](#install-the-utilities-via-pip)
* [Setup guide for Docker](#setup-guide-for-docker)
- [Compute environments](#compute-environments)
- [Setup guide for Local or DSVM](#setup-guide-for-local-or-dsvm)
- [Requirements](#requirements)
- [Dependencies setup](#dependencies-setup)
- [Register the conda environment as a kernel in Jupyter](#register-the-conda-environment-as-a-kernel-in-jupyter)
- [Troubleshooting for the DSVM](#troubleshooting-for-the-dsvm)
- [Setup guide for Azure Databricks](#setup-guide-for-azure-databricks)
- [Requirements of Azure Databricks](#requirements-of-azure-databricks)
- [Repository installation](#repository-installation)
- [Confirm Installation](#confirm-installation)
- [Troubleshooting Installation on Azure Databricks](#troubleshooting-installation-on-azure-databricks)
- [Prepare Azure Databricks for Operationalization](#prepare-azure-databricks-for-operationalization)
- [Install the utilities via PIP](#install-the-utilities-via-pip)
- [Setup guide for Docker](#setup-guide-for-docker)
## Compute environments
@ -50,7 +51,7 @@ conda update anaconda # use 'conda install anaconda' if the package is no
We provide a script, [generate_conda_file.py](tools/generate_conda_file.py), to generate a conda-environment yaml file
which you can use to create the target environment using the Python version 3.6 with all the correct dependencies.
**NOTE** the `xlearn` package has dependency on `cmake`. If one uses the `xlearn` related notebooks or scripts, make sure `cmake` is installed in the system. Detailed instructions for installing `cmake` can be found [here](https://vitux.com/how-to-install-cmake-on-ubuntu-18-04/). The default version of `cmake` is 3.15.2. One can specify a different version by configuring the argument of `CMAKE` in building the Docker image.
**NOTE** the `xlearn` package has dependency on `cmake`. If one uses the `xlearn` related notebooks or scripts, make sure `cmake` is installed in the system. The easiest way to install on Linux is with apt-get: `sudo apt-get install -y build-essential cmake`. Detailed instructions for installing `cmake` from source can be found [here](https://cmake.org/install/).
Assuming the repo is cloned as `Recommenders` in the local system, to install **a default (Python CPU) environment**:

Просмотреть файл

@ -14,20 +14,7 @@ WORKDIR ${HOME}
# Install base dependencies
RUN apt-get update && \
apt-get install -y curl git wget build-essential
# Install cmake which is a requirement by xlearn
ARG CMAKE="https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz"
RUN wget ${CMAKE} -O cmake.tgz && \
mkdir cmake && \
tar xzf cmake.tgz --strip-components=1 -C cmake && \
cd cmake && \
./bootstrap && \
make && \
make install && \
cd .. && \
rm cmake.tgz && \
rm -rf cmake
apt-get install -y curl git
# Install Anaconda
ARG ANACONDA="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
@ -114,7 +101,11 @@ ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
# Final Stage
FROM $ENV AS final
# Install Conda dependencies
# Install XLearn dependencies
RUN apt-get update && \
apt-get install -y build-essential cmake
# Install Conda packages
RUN conda env update -f base.yaml && \
conda clean -fay && \
python -m ipykernel install --user --name 'python3' --display-name 'python3'
@ -124,4 +115,3 @@ WORKDIR ${HOME}/recommenders
EXPOSE 8888
CMD ["jupyter", "notebook"]