[Docs] Update Docker docs (#718)

* [Docs] update docker docs

* [Docs] update docker docs
This commit is contained in:
Hubert 2023-12-19 23:29:43 +08:00 committed by GitHub
parent 5e8b838f51
commit fdf18a3238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 10 deletions

View File

@ -25,20 +25,28 @@ Choose the dockerfile corresponding to the dataset you need, and replace `humane
```shell ```shell
git clone https://github.com/open-compass/code-evaluator.git git clone https://github.com/open-compass/code-evaluator.git
sudo docker build -t code-eval-{your-dataset}:latest -f docker/{your-dataset}/Dockerfile . docker build -t code-eval-{your-dataset}:latest -f docker/{your-dataset}/Dockerfile .
``` ```
3. Create a container with the following commands: 3. Create a container with the following commands:
```shell ```shell
# Log output format # Log output format
sudo docker run -it -p 5000:5000 code-eval-{your-dataset}:latest python server.py docker run -it -p 5000:5000 code-eval-{your-dataset}:latest python server.py
# Run the program in the background # Run the program in the background
# sudo docker run -itd -p 5000:5000 code-eval-{your-dataset}:latest python server.py # docker run -itd -p 5000:5000 code-eval-{your-dataset}:latest python server.py
# Using different ports # Using different ports
# sudo docker run -itd -p 5001:5001 code-eval-{your-dataset}:latest python server.py --port 5001 # docker run -itd -p 5001:5001 code-eval-{your-dataset}:latest python server.py --port 5001
```
**Note:**
- If you encounter a timeout during the evaluation of Go, please use the following command when creating the container.
```shell
docker run -it -p 5000:5000 -e GO111MODULE=on -e GOPROXY=https://goproxy.io code-eval-{your-dataset}:latest python server.py
``` ```
4. To ensure you have access to the service, use the following command to check the inference environment and evaluation service connection status. (If both inferences and code evaluations run on the same host, skip this step.) 4. To ensure you have access to the service, use the following command to check the inference environment and evaluation service connection status. (If both inferences and code evaluations run on the same host, skip this step.)
@ -205,7 +213,7 @@ When supporting new datasets or modifying post-processors, it is possible that m
1. Remove the installation of the `code-evaluator` in `Dockerfile`, mount the `code-evaluator` when starting the container instead: 1. Remove the installation of the `code-evaluator` in `Dockerfile`, mount the `code-evaluator` when starting the container instead:
```shell ```shell
sudo docker run -it -p 5000:5000 -v /local/path/of/code-evaluator:/workspace/code-evaluator code-eval:latest bash docker run -it -p 5000:5000 -v /local/path/of/code-evaluator:/workspace/code-evaluator code-eval:latest bash
``` ```
2. Install and start the code evaluation service locally. At this point, any necessary modifications can be made to the local copy of the `code-evaluator`. 2. Install and start the code evaluation service locally. At this point, any necessary modifications can be made to the local copy of the `code-evaluator`.

View File

@ -25,20 +25,28 @@ Python 多算法库数据集 [ds1000](https://github.com/xlang-ai/DS-1000)
```shell ```shell
git clone https://github.com/open-compass/code-evaluator.git git clone https://github.com/open-compass/code-evaluator.git
sudo docker build -t code-eval-{your-dataset}:latest -f docker/{your-dataset}/Dockerfile . docker build -t code-eval-{your-dataset}:latest -f docker/{your-dataset}/Dockerfile .
``` ```
3. 使用以下命令创建容器 3. 使用以下命令创建容器
```shell ```shell
# 输出日志格式 # 输出日志格式
sudo docker run -it -p 5000:5000 code-eval-{your-dataset}:latest python server.py docker run -it -p 5000:5000 code-eval-{your-dataset}:latest python server.py
# 在后台运行程序 # 在后台运行程序
# sudo docker run -itd -p 5000:5000 code-eval-{your-dataset}:latest python server.py # docker run -itd -p 5000:5000 code-eval-{your-dataset}:latest python server.py
# 使用不同的端口 # 使用不同的端口
# sudo docker run -itd -p 5001:5001 code-eval-{your-dataset}:latest python server.py --port 5001 # docker run -itd -p 5001:5001 code-eval-{your-dataset}:latest python server.py --port 5001
```
**注:**
- 如在评测Go的过程中遇到timeout请在创建容器时候使用以下命令
```shell
docker run -it -p 5000:5000 -e GO111MODULE=on -e GOPROXY=https://goproxy.io code-eval-{your-dataset}:latest python server.py
``` ```
4. 为了确保您能够访问服务,通过以下命令检测推理环境和评测服务访问情况。 (如果推理和代码评测在同一主机中运行服务,就跳过这个操作) 4. 为了确保您能够访问服务,通过以下命令检测推理环境和评测服务访问情况。 (如果推理和代码评测在同一主机中运行服务,就跳过这个操作)
@ -203,7 +211,7 @@ curl -X POST -F 'file=@./internlm-chat-7b-hf-v11/ds1000_Numpy.json' -F 'debug=er
1. 删除 `Dockerfile` 中安装 `code-evaluator` 的部分,在启动容器时将 `code-evaluator` 挂载 1. 删除 `Dockerfile` 中安装 `code-evaluator` 的部分,在启动容器时将 `code-evaluator` 挂载
```shell ```shell
sudo docker run -it -p 5000:5000 -v /local/path/of/code-evaluator:/workspace/code-evaluator code-eval:latest bash docker run -it -p 5000:5000 -v /local/path/of/code-evaluator:/workspace/code-evaluator code-eval:latest bash
``` ```
2. 安装并启动代码评测服务,此时可以根据需要修改本地 `code-evaluator` 中的代码来进行调试 2. 安装并启动代码评测服务,此时可以根据需要修改本地 `code-evaluator` 中的代码来进行调试