-
Notifications
You must be signed in to change notification settings - Fork 115
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 #82 from rapidsai/develop
[REVIEW] merge develop to master and release it as 0.4
- Loading branch information
Showing
68 changed files
with
13,576 additions
and
1,311 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 |
---|---|---|
|
@@ -2,55 +2,57 @@ | |
|
||
echo "Building gQuant container..." | ||
|
||
echo -e "Please, select the option which better fits your system configuration:\n" \ | ||
" - '1' for Ubuntu 16.04 + cuda 9.2\n" \ | ||
" - '2' for Ubuntu 16.04 + cuda 10.0\n" \ | ||
" - '3' for Ubuntu 18.04 + cuda 9.2\n" \ | ||
" - '4' for Ubuntu 18.04 + cuda 10.0" | ||
echo -e "\nPlease, select your operating system:\n" \ | ||
" - '1' for Ubuntu 16.04\n" \ | ||
" - '2' for Ubuntu 18.04\n" \ | ||
" - '3' for CentOS" | ||
|
||
read -p "Enter your option and hit return [1]-4: " SYSTEM_CONFIGURATION | ||
read -p "Enter your option and hit return [1]-3: " OPERATING_SYSTEM | ||
|
||
SYSTEM_CONFIGURATION=${SYSTEM_CONFIGURATION:-1} | ||
case $SYSTEM_CONFIGURATION in | ||
OPERATING_SYSTEM=${OPERATING_SYSTEM:-1} | ||
case $OPERATING_SYSTEM in | ||
2) | ||
echo "Ubuntu 16.04 + cuda 10.0 selected." | ||
OS_STR='16.04' | ||
CONTAINER_VER='10.0' | ||
CUPY='cupy-cuda100' | ||
;; | ||
echo "Ubuntu 18.04 selected." | ||
OS_STR="ubuntu18.04" | ||
;; | ||
3) | ||
echo "Ubuntu 18.04 + cuda 9.2 selected." | ||
OS_STR='18.04' | ||
CONTAINER_VER='9.2' | ||
CUPY='cupy-cuda92' | ||
;; | ||
4) | ||
echo "Ubuntu 18.04 + cuda 10.0 selected." | ||
OS_STR='18.04' | ||
CONTAINER_VER='10.0' | ||
CUPY='cupy-cuda100' | ||
;; | ||
echo "CentOS selected." | ||
OS_STR="centos7" | ||
;; | ||
*) | ||
echo "Ubuntu 16.04 + cuda 9.2 selected." | ||
OS_STR='16.04' | ||
CONTAINER_VER='9.2' | ||
CUPY='cupy-cuda92' | ||
;; | ||
echo "Ubuntu 16.04 selected." | ||
OS_STR="ubuntu16.04" | ||
;; | ||
esac | ||
|
||
CONTAINER="nvcr.io/nvidia/rapidsai/rapidsai:0.9-cuda${CONTAINER_VER}-runtime-ubuntu${OS_STR}" | ||
echo -e "\nPlease, select your cuda version:\n" \ | ||
" - '1' for cuda 9.2\n" \ | ||
" - '2' for cuda 10.0\n" \ | ||
" - '3' for cuda 10.1.2" | ||
|
||
read -p "Enter your option and hit return [1]-3: " CUDA_VERSION | ||
|
||
RAPIDS_VERSION="0.13" | ||
|
||
read -p "Would you like to install Vim JupyterLab Extension (optional) [N]/y: " VIM_INSTALL | ||
CUDA_VERSION=${CUDA_VERSION:-1} | ||
case $CUDA_VERSION in | ||
2) | ||
echo "cuda 10.0 selected." | ||
CONTAINER_VER='10.0' | ||
;; | ||
3) | ||
echo "cuda 10.1.2 selected." | ||
CONTAINER_VER='10.1' | ||
;; | ||
*) | ||
echo "cuda 9.2 selected." | ||
CONTAINER_VER='9.2' | ||
;; | ||
esac | ||
|
||
VIM_INSTALL=${VIM_INSTALL:-N} | ||
if [ "$VIM_INSTALL" = "Y" ] || [ "$VIM_INSTALL" = "y" ]; then | ||
echo "Vim JupyterLab Extension will be installed." | ||
else | ||
echo "Vim JupyterLab Extension will not be installed." | ||
fi | ||
CONTAINER="nvcr.io/nvidia/rapidsai/rapidsai:${RAPIDS_VERSION}-cuda${CONTAINER_VER}-runtime-${OS_STR}" | ||
|
||
D_FILE=${D_FILE:='Dockerfile.Rapids'} | ||
D_CONT=${D_CONT:='gquant/gquant:latest'} | ||
|
||
mkdir -p gQuant | ||
cp -r ../gquant ./gQuant | ||
|
@@ -60,30 +62,31 @@ cp ../setup.py ./gQuant | |
cp ../LICENSE ./gQuant | ||
rsync -av --progress ../notebooks ./gQuant --exclude data --exclude .cache --exclude many-small --exclude storage --exclude dask-worker-space --exclude __pycache__ | ||
|
||
gquant_ver=$(grep version gQuant/setup.py | sed "s/^.*version='\([^;]*\)'.*/\1/") | ||
D_CONT=${D_CONT:="gquant/gquant:${gquant_ver}_${OS_STR}_${CONTAINER_VER}_${RAPIDS_VERSION}"} | ||
|
||
cat > $D_FILE <<EOF | ||
FROM $CONTAINER | ||
USER root | ||
ADD ./gQuant /rapids/gQuant | ||
RUN apt-get update && apt-get install -y libfontconfig1 libxrender1 | ||
RUN if [ "$OS_STR" = "centos7" ]; then \ | ||
yum install -y fontconfig-devel libXrender ; \ | ||
else \ | ||
apt-get update && apt-get install -y libfontconfig1 libxrender1 ; \ | ||
fi | ||
# RUN apt-get update && apt-get install -y libfontconfig1 libxrender1 | ||
SHELL ["bash","-c"] | ||
# | ||
# Additional python libs | ||
# | ||
RUN source activate rapids \ | ||
&& pip install nxpd $CUPY | ||
RUN source activate rapids \ | ||
&& cd /rapids/gQuant \ | ||
&& pip install . | ||
RUN source activate rapids \ | ||
&& conda install -y -c conda-forge dask-labextension recommonmark numpydoc sphinx_rtd_theme pudb \ | ||
python-graphviz bqplot=0.11.5 nodejs=11.11.0 jupyterlab=0.35.4 ipywidgets=7.4.2 pytables mkl numexpr | ||
python-graphviz bqplot=0.11.5 nodejs=11.11.0 jupyterlab=0.35.4 ipywidgets=7.4.2 pytables mkl numexpr \ | ||
pydot | ||
# | ||
# required set up | ||
# | ||
|
@@ -92,17 +95,13 @@ RUN source activate rapids \ | |
&& jupyter labextension install [email protected] --no-build \ | ||
&& mkdir /.local /.jupyter /.config /.cupy \ | ||
&& chmod 777 /.local /.jupyter /.config /.cupy | ||
RUN if [ "$VIM_INSTALL" = "Y" ] || [ "$VIM_INSTALL" = "y" ]; then /conda/envs/rapids/bin/jupyter labextension install [email protected] --no-build ; fi | ||
RUN source activate rapids \ | ||
&& jupyter lab build && jupyter lab clean | ||
EXPOSE 8888 | ||
EXPOSE 8787 | ||
EXPOSE 8786 | ||
WORKDIR /rapids | ||
ENTRYPOINT /bin/bash -c 'source activate rapids; /bin/bash' | ||
EOF | ||
|
||
docker build -f $D_FILE -t $D_CONT . |
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,15 @@ | ||
from collections import namedtuple, Mapping | ||
|
||
__all__ = ['_namedtuple_with_defaults'] | ||
|
||
|
||
def _namedtuple_with_defaults(typename, field_names, default_values=()): | ||
# https://stackoverflow.com/a/18348004/3457624 | ||
T = namedtuple(typename, field_names) | ||
T.__new__.__defaults__ = (None,) * len(T._fields) | ||
if isinstance(default_values, Mapping): | ||
prototype = T(**default_values) | ||
else: | ||
prototype = T(*default_values) | ||
T.__new__.__defaults__ = tuple(prototype) | ||
return T |
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
Oops, something went wrong.