Skip to content

Commit 9df8e74

Browse files
docs(docker): fix build fail (#45)
Co-authored-by: MegEngine <megengine@megvii.com>
1 parent a043cf9 commit 9df8e74

3 files changed

Lines changed: 34 additions & 4 deletions

File tree

Dockerfile.github-release

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
FROM megflow:latest as stage
2-
ARG PY_VERSION
32

43
# build .whl
5-
RUN eval "$(conda shell.bash hook)" && conda activate py${PY_VERSION} \
4+
RUN eval "$(conda shell.bash hook)" && conda activate py3.6 \
5+
&& cargo build --release \
6+
&& cargo build --example megflow_run --release \
7+
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
8+
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
9+
&& cd flow-python \
10+
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist
11+
12+
RUN eval "$(conda shell.bash hook)" && conda activate py3.7 \
613
&& cargo build --release \
714
&& cargo build --example megflow_run \
815
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
916
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
1017
&& cd flow-python \
1118
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist
1219

20+
RUN eval "$(conda shell.bash hook)" && conda activate py3.8 \
21+
&& cargo build --release \
22+
&& cargo build --example megflow_run --release \
23+
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
24+
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
25+
&& cd flow-python \
26+
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist
27+
28+
RUN eval "$(conda shell.bash hook)" && conda activate py3.9 \
29+
&& cargo build --release \
30+
&& cargo build --example megflow_run --release \
31+
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
32+
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
33+
&& cd flow-python \
34+
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist
35+
1336
# copy back to host
1437
FROM scratch AS export-stage
1538
COPY --from=stage /megflow-runspace/dist/ .

docs/how-to-add-my-service/01-quickstart.zh.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ custom
9191
* 分支名称
9292
* 如有 placeholder,应该替换成什么
9393
94+
placeholder 使用的正则匹配是
95+
```bash
96+
$ cat flow-quickstart/main.rs
97+
...
98+
let re = Regex::new(r"##[_\-a-zA-Z0-9]*##").unwrap();
99+
...
100+
```
94101
95102
## MegFlow 服务使用方式
96103

docs/how-to-pack-python-whl.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ $ # 构造开发环境,安装依赖。已执行过 docker 编译可以跳过
1313
$ docker build -t megflow -f Dockerfile.github-dev .
1414
$ # 创建结果目录
1515
$ mkdir dist
16-
$ # docker 打包 whl
16+
$ # docker 打包 3.6~3.9 版本 whl
1717
$ # https://stackoverflow.com/questions/33377022/how-to-copy-files-from-dockerfile-to-host
18-
$ DOCKER_BUILDKIT=1 docker build --build-arg PY_VERSION=3.8 -f Dockerfile.github-release --output dist .
18+
$ DOCKER_BUILDKIT=1 docker build -f Dockerfile.github-release --output dist .
1919
```
2020

2121
**注意** COPY to host 需要:

0 commit comments

Comments
 (0)