[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
This commit is contained in:
Hu, Zhaojie 2022-10-13 22:20:28 +08:00 committed by GitHub
parent c40a88e8ae
commit 4d56ece258

View file

@ -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.