* refactor toc * refactor toc * Change to pydata-sphinx-theme and update packages requirement list for ReadtheDocs * Remove customized css for old theme * Add index page to each top bar section and limit dropdown maximum to be 4 * Use js to change 'More' to 'Libraries' * Add custom.css to conf.py for further css changes * Add BigDL logo and search bar * refactor toc * refactor toc and add overview * refactor toc and add overview * refactor toc and add overview * refactor get started * add paper and video section * add videos * add grid columns in landing page * add document roadmap to index * reapply search bar and github icon commit * reorg orca and chronos sections * Test: weaken ads by js * update: change left attrbute * update: add comments * update: change opacity to 0.7 * Remove useless theme template override for old theme * Add sidebar releases component in the home page * Remove sidebar search and restore top nav search button * Add BigDL handouts * Add back to homepage button to pages except from the home page * Update releases contents & styles in left sidebar * Add version badge to the top bar * Test: weaken ads by js * update: add comments * remove landing page contents * rfix chronos install * refactor install * refactor chronos section titles * refactor nano index * change chronos landing * revise chronos landing page * add document navigator to nano landing page * revise install landing page * Improve css of versions in sidebar * Make handouts image pointing to a page in new tab * add win guide to install * add dliib installation * revise title bar * rename index files * add index page for user guide * add dllib and orca API * update user guide landing page * refactor side bar * Remove extra style configuration of card components & make different card usage consistent * Remove extra styles for Nano how-to guides * Remove extra styles for Chronos how-to guides * Remove dark mode for now * Update index page description * Add decision tree for choosing BigDL libraries in index page * add dllib models api, revise core layers formats * Change primary & info color in light mode * Restyle card components * Restructure Chronos landing page * Update card style * Update BigDL library selection decision tree * Fix failed Chronos tutorials filter * refactor PPML documents * refactor and add friesian documents * add friesian arch diagram * update landing pages and fill key features guide index page * Restyle link card component * Style video frames in PPML sections * Adjust Nano landing page * put api docs to the last in index for convinience * Make badge horizontal padding smaller & small changes * Change the second letter of all header titles to be small capitalizd * Small changes on Chronos index page * Revise decision tree to make it smaller * Update: try to change the position of ads. * Bugfix: deleted nonexist file config * Update: update ad JS/CSS/config * Update: change ad. * Update: delete my template and change files. * Update: change chronos installation table color. * Update: change table font color to --pst-color-primary-text * Remove old contents in landing page sidebar * Restyle badge for usage in card footer again * Add quicklinks template on landing page sidebar * add quick links * Add scala logo * move tf, pytorch out of the link * change orca key features cards * fix typo * fix a mistake in wording * Restyle badge for card footer * Update decision tree * Remove useless html templates * add more api docs and update tutorials in dllib * update chronos install using new style * merge changes in nano doc from master * fix quickstart links in sidebar quicklinks * Make tables responsive * Fix overflow in api doc * Fix list indents problems in [User guide] section * Further fixes to nested bullets contents in [User Guide] section * Fix strange title in Nano 5-min doc * Fix list indent problems in [DLlib] section * Fix misnumbered list problems and other small fixes for [Chronos] section * Fix list indent problems and other small fixes for [Friesian] section * Fix list indent problem and other small fixes for [PPML] section * Fix list indent problem for developer guide * Fix list indent problem for [Cluster Serving] section * fix dllib links * Fix wrong relative link in section landing page Co-authored-by: Yuwen Hu <yuwen.hu@intel.com> Co-authored-by: Juntao Luo <1072087358@qq.com>
141 lines
5.1 KiB
Markdown
141 lines
5.1 KiB
Markdown
# Docker User Guide
|
||
|
||
---
|
||
|
||
### **1. Pull Docker Image**
|
||
|
||
You may pull a Docker image from the [Docker Hub](https://hub.docker.com/r/intelanalytics/bigdl/tags).
|
||
|
||
To pull the nightly build version, use
|
||
```bash
|
||
sudo docker pull intelanalytics/bigdl:2.1.0-SNAPSHOT
|
||
```
|
||
|
||
To pull other versions, please refer to [BigDL Docker Hub Tags](https://hub.docker.com/r/intelanalytics/bigdl/tags?page=1&ordering=last_updated), select a tag and use
|
||
```bash
|
||
sudo docker pull intelanalytics/bigdl:tag_name
|
||
```
|
||
|
||
**Configuring resources**
|
||
|
||
For Docker Desktop users, the default resources (2 CPUs and 2GB memory) are relatively small, and you may want to change them to larger values (8GB memory and 4 CPUs should be a good estimate for most examples, and the exact memory requirements vary for different applications). For more information, view the Docker documentation for [MacOS](https://docs.docker.com/docker-for-mac/#resources) and [Windows](https://docs.docker.com/docker-for-windows/#resources).
|
||
|
||
**Speed up pulling image by adding mirrors**
|
||
|
||
To speed up pulling the image from DockerHub, you may add the registry-mirrors key and value by editing `daemon.json` (located in `/etc/docker/` folder on Linux):
|
||
```
|
||
{
|
||
"registry-mirrors": ["https://<my-docker-mirror-host>"]
|
||
}
|
||
```
|
||
For instance, users in China may add the USTC mirror as follows:
|
||
```
|
||
{
|
||
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
|
||
}
|
||
```
|
||
|
||
|
||
After that, flush changes and restart docker:
|
||
|
||
```
|
||
sudo systemctl daemon-reload
|
||
sudo systemctl restart docker
|
||
```
|
||
|
||
### **2. Launch Docker Container**
|
||
|
||
After pulling the BigDL Docker image, you can launch an BigDL Docker container:
|
||
```
|
||
sudo docker run -it --rm --net=host \
|
||
-e http_proxy=http://your-proxy-host:your-proxy-port \
|
||
-e https_proxy=https://your-proxy-host:your-proxy-port \
|
||
intelanalytics/bigdl:2.1.0-SNAPSHOT bash
|
||
```
|
||
|
||
* The value 12345 is a user specified port number.
|
||
* The value "your-token" is a user specified string.
|
||
* If you need to use http/https proxy, please use -e http_proxy/https_proxy
|
||
|
||
Once the container is successfully launched, you will automatically login into the container and see this as the output:
|
||
```
|
||
root@[hostname]:/opt/work#
|
||
```
|
||
|
||
The /opt/work directory contains:
|
||
|
||
* start-notebook.sh is used for starting the jupyter notebook. You can specify the environment settings and spark settings to start a specified jupyter notebook.
|
||
* bigdl-${BigDL_VERSION} is the BigDL home of BigDL distribution.
|
||
* spark-${SPARK_VERSION} is the Spark home.
|
||
* BigDL is cloned from https://github.com/intel-analytics/BigDL.git, contains apps, examples using BigDL.
|
||
* opt/download-bigdl.sh is used for downloading BigDL distributions.
|
||
|
||
### **3. Run Jupyter Notebook Examples in the Container**
|
||
|
||
After a Docker container is launched and user login into the container, you can start the Jupyter Notebook service inside the container.
|
||
|
||
#### **3.1 Start the Jupyter Notebook services**
|
||
|
||
In the `/opt/work` directory, run this command line to start the Jupyter Notebook service:
|
||
```
|
||
./start-notebook.sh
|
||
```
|
||
|
||
You will see the output message like below. This means the Jupyter Notebook service has started successfully within the container.
|
||
```
|
||
[I 07:40:39.354 NotebookApp] Serving notebooks from local directory: /opt/work/bigdl-2.1.0-SNAPSHOT/apps
|
||
[I 07:40:39.355 NotebookApp] Jupyter Notebook 6.4.6 is running at:
|
||
[I 07:40:39.355 NotebookApp] http://(the-host-name):12345/?token=...
|
||
[I 07:40:39.355 NotebookApp] or http://127.0.0.1:12345/?token=...
|
||
[I 07:40:39.355 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
|
||
```
|
||
|
||
#### **3.2 Connect to Jupyter Notebook service from a browser**
|
||
|
||
After the Jupyter Notebook service is successfully started, you can connect to the Jupyter Notebook service from a browser.
|
||
|
||
1. Get the IP address of the container
|
||
2. Launch a browser, and connect to the Jupyter Notebook service with the URL: https://container-ip-address:port-number/?token=your-token
|
||
As a result, you will see the Jupyter Notebook like this:
|
||
|
||

|
||
|
||
#### **3.3 Run BigDL Jupyter Notebooks**
|
||
|
||
After connecting to the Jupyter Notebook in the browser, you can run multiple BigDL Jupyter Notebook examples. The example shown below is the “dogs-vs-cats”.
|
||
|
||
* Click into the "dogs-vs-cats" folder:
|
||
|
||

|
||
|
||
* Open the notebook file:
|
||
|
||

|
||
|
||
* Start to run the "dogs-vs-cats" notebook:
|
||
|
||

|
||
|
||
* Run through the example and check the prediction:
|
||
|
||

|
||
|
||
### **4. Shut Down Docker Container**
|
||
|
||
You should shut down the BigDL Docker container after using it.
|
||
|
||
1. You can list all the active Docker containers by command line:
|
||
```
|
||
sudo docker ps
|
||
```
|
||
|
||
2. You will see your docker containers:
|
||
```
|
||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||
40de2cdad025 intelanalytics/bigdl:2.1.0-SNAPSHOT "/opt/work/start-n..." 3 hours ago Up 3 hours upbeat_al
|
||
```
|
||
|
||
3. Shut down the corresponding docker container by its ID:
|
||
```
|
||
$sudo docker rm -f 40de2cdad025
|
||
```
|