-
Notifications
You must be signed in to change notification settings - Fork 99
refactor: remove models-store in favor of default ~/.docker/models #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,9 +33,7 @@ add_optional_args() { | |
| args+=(-p "$PORT:$PORT" -e "MODEL_RUNNER_PORT=$PORT") | ||
| fi | ||
|
|
||
| if [ -n "${MODELS_PATH-}" ]; then | ||
| args+=(-v "$MODELS_PATH:/models" -e MODELS_PATH=/models) | ||
| fi | ||
| args+=(-v "$models_path:/models" -e MODELS_PATH=/models) | ||
|
|
||
| for i in /usr/local/dcmi /usr/local/bin/npu-smi /usr/local/Ascend/driver/lib64/ /usr/local/Ascend/driver/version.info /etc/ascend_install.info; do | ||
| if [ -e "$i" ]; then | ||
|
|
@@ -65,14 +63,11 @@ add_optional_args() { | |
| main() { | ||
| set -eux -o pipefail | ||
|
|
||
| local models_path="${MODELS_PATH:-$HOME/.docker/models}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question (bug_risk): The new defaulting behavior removes the ability to opt out of a models volume by setting an empty MODELS_PATH.
|
||
| local args=(docker run --rm -e LLAMA_SERVER_PATH=/app/bin) | ||
| add_optional_args | ||
|
|
||
| # Ensure model path exists only if provided | ||
| if [ -n "${MODELS_PATH-}" ]; then | ||
| mkdir -p "$MODELS_PATH" | ||
| chmod a+rwx "$MODELS_PATH" | ||
| fi | ||
| mkdir -p "$models_path" | ||
| chmod a+rwx "$models_path" | ||
|
|
||
| if [ -z "${DOCKER_IMAGE-}" ]; then | ||
| echo "DOCKER_IMAGE is required" >&2 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes break the
docker-runfamily of targets. While the Go application may have a default model path for local runs, when running in Docker, a volume must be mounted from the host to the container to share the model store. By removingMODELS_PATHfrom this rule,docker-run.shwill no longer mount any volume for models, and the container will be isolated from the host's~/.docker/modelsdirectory.To fix this while still defaulting to
~/.docker/models, you can use shell parameter expansion to provide a default value. This also keeps the ability for users to override the path via the command line (e.g.,make docker-run MODELS_PATH=/custom/path).