Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions Dockerfile.github-release
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
FROM megflow:latest as stage
ARG PY_VERSION

# build .whl
RUN eval "$(conda shell.bash hook)" && conda activate py${PY_VERSION} \
RUN eval "$(conda shell.bash hook)" && conda activate py3.6 \
&& cargo build --release \
&& cargo build --example megflow_run --release \
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
&& cd flow-python \
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist

RUN eval "$(conda shell.bash hook)" && conda activate py3.7 \
&& cargo build --release \
&& cargo build --example megflow_run \
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
&& cd flow-python \
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist

RUN eval "$(conda shell.bash hook)" && conda activate py3.8 \
&& cargo build --release \
&& cargo build --example megflow_run --release \
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
&& cd flow-python \
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist

RUN eval "$(conda shell.bash hook)" && conda activate py3.9 \
&& cargo build --release \
&& cargo build --example megflow_run --release \
&& cp target/release/examples/megflow_run flow-python/megflow/megflow_run_inner \
&& cp target/release/megflow_quickstart flow-python/megflow/megflow_quickstart_inner \
&& cd flow-python \
&& python3 setup.py bdist_wheel -p linux-x86_64 -d ../dist

# copy back to host
FROM scratch AS export-stage
COPY --from=stage /megflow-runspace/dist/ .
7 changes: 7 additions & 0 deletions docs/how-to-add-my-service/01-quickstart.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ custom
* 分支名称
* 如有 placeholder,应该替换成什么

placeholder 使用的正则匹配是
```bash
$ cat flow-quickstart/main.rs
...
let re = Regex::new(r"##[_\-a-zA-Z0-9]*##").unwrap();
...
```

## MegFlow 服务使用方式

Expand Down
4 changes: 2 additions & 2 deletions docs/how-to-pack-python-whl.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ $ # 构造开发环境,安装依赖。已执行过 docker 编译可以跳过
$ docker build -t megflow -f Dockerfile.github-dev .
$ # 创建结果目录
$ mkdir dist
$ # docker 打包 whl
$ # docker 打包 3.6~3.9 版本 whl
$ # https://stackoverflow.com/questions/33377022/how-to-copy-files-from-dockerfile-to-host
$ DOCKER_BUILDKIT=1 docker build --build-arg PY_VERSION=3.8 -f Dockerfile.github-release --output dist .
$ DOCKER_BUILDKIT=1 docker build -f Dockerfile.github-release --output dist .
```

**注意** COPY to host 需要:
Expand Down