Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Comments

Add install-runner and uninstall-runner to manage Docker Model Runner#48

Merged
xenoscopic merged 21 commits intodocker:mainfrom
doringeman:install-runner
May 13, 2025
Merged

Add install-runner and uninstall-runner to manage Docker Model Runner#48
xenoscopic merged 21 commits intodocker:mainfrom
doringeman:install-runner

Conversation

@doringeman
Copy link
Collaborator

@doringeman doringeman commented May 8, 2025

$ make install
$ docker model install-runner --help
Usage:  docker model install-runner

Install Docker Model Runner

Options:
      --gpu           Enable GPU support
      --port uint16   Docker container port for Docker Model Runner (default 12434)
$ docker model uninstall-runner --help
Usage:  docker model uninstall-runner

Uninstall Docker Model Runner

Options:
      --images   Remove model runner images
      --models   Remove model storage

To try it out:

$ export _MODEL_RUNNER_TREAT_DESKTOP_AS_MOBY=yes # if on DD
$ docker model install-runner
latest: Pulling from docker/model-runner Digest: sha256:554abef288f3ed304403a7fabd93502b4ee0a1245c2412a5ee911b074d6f4076
Status: Image is up to date for docker/model-runner:latest

Successfully pulled docker/model-runner:latest
Starting model runner container docker-model-runner...
$ docker model ls
MODEL NAME  PARAMETERS  QUANTIZATION  ARCHITECTURE  MODEL ID  CREATED  SIZE

Some future enhancements:

  • Add docker model update-runner to ensure Docker Model Runner is running the latest version.
  • Add "variant" and "version" flags to docker model install-runner.

Copy link
Contributor

@xenoscopic xenoscopic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good like it's mostly there, some things blocked by me, I'll try to get those to you today.

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>
xenoscopic added 13 commits May 12, 2025 11:31
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Most systems won't have NVIDIA GPUs and this behavior better aligns with
what's done in Docker Desktop.

Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
This commit also adds some uninstall functionality.

Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Also add a mechanism to treat Docker Desktop as Moby for testing.

Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
setenv("URL", modelRunner.URL("/engines/v1/"))
} else if kind == desktop.ModelRunnerEngineKindMoby || kind == desktop.ModelRunnerEngineKindCloud {
// TODO: Find a more robust solution in Moby-like environments.
setenv("URL", "http://172.17.0.1:12434/engines/v1/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @glours and @ndeloof - we're trying to figure out the best way to make the DMR + Compose integration work with the standalone Docker Model Runner containers that we're now supporting on Docker CE. Since Compose projects don't attach their service containers to the host bridge network by default, using the 172.17.0.1 address doesn't work. I'm trying to figure out a more elegant solution without requiring users to change their Compose YAML. Do you have any ideas about a good convention that we could use here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best idea I have at the moment is just to default to http://host.docker.internal:12434/engines/v1/ and require a host.docker.internal:host-gateway mapping for every container needing the standalone model runner.

Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
Copy link
Collaborator Author

@doringeman doringeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!
(I can't approve because it's my pull request.)

},
ValidArgsFunction: completion.NoComplete,
}
c.Flags().BoolVar(&models, "models", false, "Remove model storage")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
c.Flags().BoolVar(&models, "models", false, "Remove model storage")
c.Flags().BoolVar(&models, "models", false, "Remove Docker Model Runner storage (docker-model-runner-models volume)")

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified this one a little differently since the volume name isn't guaranteed.

xenoscopic and others added 2 commits May 13, 2025 07:01
Co-authored-by: Dorin-Andrei Geman <doringeman@gmail.com>
Signed-off-by: Jacob Howard <jacob.howard@docker.com>
@xenoscopic xenoscopic merged commit 769e2a3 into docker:main May 13, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants