Add Docker support for running onnx-modifier#146
Open
helloworld77 wants to merge 2 commits intoZhangGe6:masterfrom
Open
Add Docker support for running onnx-modifier#146helloworld77 wants to merge 2 commits intoZhangGe6:masterfrom
helloworld77 wants to merge 2 commits intoZhangGe6:masterfrom
Conversation
Owner
|
@helloworld77 Thanks for the contribution. What are the necessities of the modifications in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
This PR adds the ability to run onnx-modifier in a Docker container, so users can start the service without installing Python or dependencies locally. The documentation in README is updated with a new section "launch from Docker container".
Motivation
Changes
Dockerfile(new)requirements.txt.python entry.py --host 0.0.0.0 --port 5000so the app is reachable from outside the container.README.mddocker buildanddocker runcommands.http://0.0.0.0:5000/andhttp://127.0.0.1:5000/; opening either in the browser launches onnx-modifier.onnx_modifier/flask_server.pyentry.py(or the script that starts the server) is assumed to support--hostand--portso the server can bind to0.0.0.0:5000inside the container. Any small changes in this file are to support that and/or fix download behavior when running in Docker (e.g. using absolute path forsend_fileif needed).How to use (for reviewers/users)
Then open
http://127.0.0.1:5000/(orhttp://0.0.0.0:5000/) in a browser.Note for maintainers
python:3.9-slimandpip installcan be run without a custom index (e.g. remove-i https://pypi.tuna.tsinghua.edu.cn/simplefor a generic Dockerfile).中文版(可选)
标题
feat: 支持通过 Docker 容器启动 onnx-modifier
简述
本 PR 增加通过 Docker 运行 onnx-modifier 的方式,并在 README 中新增「launch from Docker container」小节,包含构建与运行命令。使用方式与从源码启动一致:构建镜像 → 运行容器 → 在浏览器中打开输出的地址即可使用。
修改说明
requirements.txt,默认以--host 0.0.0.0 --port 5000启动,便于从宿主机访问。http://0.0.0.0:5000/或http://127.0.0.1:5000/。--host/--port并在容器内正确绑定;如有需要,修正下载逻辑(如使用绝对路径)以在 Docker 环境下正常工作。使用步骤
见上方英文版中的
docker build与docker run命令,启动后在浏览器打开http://127.0.0.1:5000/即可。