From 4d56ece2582a995d6c45909921bb9a334f24829a Mon Sep 17 00:00:00 2001 From: "Hu, Zhaojie" Date: Thu, 13 Oct 2022 22:20:28 +0800 Subject: [PATCH] [Chronos] Add install options in chronos-nightly docker image (#6064) * add install options for chronos dockerfile * add invaild argument check * add arg num check & add extra_dep arg * remove debug message * add build args message in README & change arg num check message * add ml option in arg model * add default value for each build arg * update readme and howto guides * fix typo * fix typo * fix markdown * fix markdown --- .../Chronos/Howto/docker_guide_single_node.md | 50 +++++++++++++++++-- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md b/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md index 8c526569..0922747d 100644 --- a/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md +++ b/docs/readthedocs/source/doc/Chronos/Howto/docker_guide_single_node.md @@ -11,11 +11,49 @@ Then `cd` to the root directory of `BigDL`, and copy the Dockerfile to it. cd BigDL cp docker/chronos-nightly/Dockerfile ./Dockerfile ``` -Then build your docker image with Dockerfile: +When building image, you can specify some build args to install chronos with necessary dependencies according to your own needs. +The build args are similar to the install options in [Chronos documentation](https://bigdl.readthedocs.io/en/latest/doc/Chronos/Overview/chronos.html#install). + +``` +model: which model or framework you want. + value: pytorch (default) + tensorflow + prophet + arima + ml (for machine learning models). + +auto_tuning: whether to enable auto tuning. + value: y (for yes) + n (default, for no). + +hardware: run chronos on a single machine or a cluster. + value: single (default) + cluster + +extra_dep: whether to install some extra dependencies like onnx and jupyter. + value: y (for yes) + n (default, for no) + if specified to y, the following dependencies will be installed: + neural_compressor, onnxruntime, onnx, tsfresh, + prometheus_pandas, xgboost, jupyter +``` + +If you want to build image with the default options, you can simply use the following command: ```bash sudo docker build -t chronos-nightly:b1 . # You may choose any NAME:TAG you want. ``` -(Optional) Or build with a proxy: + +You can also build with other options by specifying the build args: +```bash +sudo docker build \ + --build-arg model=pytorch \ + --build-arg auto_tuning=y \ + --build-arg hardware=single \ + --build-arg extra_dep=n \ + -t chronos-nightly:b1 . # You may choose any NAME:TAG you want. +``` + +(Optional) If you need a proxy, you can add two additional build args to specify it: ```bash # typically, you need a proxy for building since there will be some downloading. sudo docker build \ @@ -33,15 +71,17 @@ sudo docker run -it --rm --net=host chronos-nightly:b1 bash ``` ## Use Chronos -A conda environment is created for you automatically. `bigdl-chronos` and all of its depenencies are installed inside this environment. +A conda environment is created for you automatically. `bigdl-chronos` and the necessary depenencies (based on the build args) are installed inside this environment. ```bash (chronos) root@cpx-3:/opt/work# ``` -## Run unitest examples on Jupyter Notebook for a quick use +## Run unittest examples on Jupyter Notebook for a quick use +> Note: To use jupyter notebook, you need to specify the build arg `extra_dep` to `y`. + You can run these on Jupyter Notebook on single node server if you pursue a quick use on Chronos. ```bash -(chronos) root@cpx-3:/opt/work# cd /opt/work/colab-notebook #Unitest examples are here. +(chronos) root@cpx-3:/opt/work# cd /opt/work/colab-notebook #Unittest examples are here. ``` ```bash (chronos) root@cpx-3:/opt/work# jupyter notebook --notebook-dir=./ --ip=* --allow-root #Start the Jupyter Notebook services.