Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
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
12 changes: 10 additions & 2 deletions commands/install-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,12 @@ func ensureStandaloneRunnerAvailable(ctx context.Context, printer standalone.Sta

// Create the model runner container.
port := uint16(standalone.DefaultControllerPortMoby)
environment := "moby"
if engineKind == desktop.ModelRunnerEngineKindCloud {
port = standalone.DefaultControllerPortCloud
environment = "cloud"
}
if err := standalone.CreateControllerContainer(ctx, dockerClient, port, false, gpu, modelStorageVolume, printer); err != nil {
if err := standalone.CreateControllerContainer(ctx, dockerClient, port, environment, false, gpu, modelStorageVolume, printer); err != nil {
return nil, fmt.Errorf("unable to initialize standalone model runner container: %w", err)
}

Expand Down Expand Up @@ -188,6 +190,12 @@ func newInstallRunner() *cobra.Command {
port = standalone.DefaultControllerPortCloud
}

// Set the appropriate environment.
environment := "moby"
if engineKind == desktop.ModelRunnerEngineKindCloud {
environment = "cloud"
}

// Create a Docker client for the active context.
dockerClient, err := desktop.DockerClientForContext(dockerCLI, dockerCLI.CurrentContext())
if err != nil {
Expand Down Expand Up @@ -230,7 +238,7 @@ func newInstallRunner() *cobra.Command {
return fmt.Errorf("unable to initialize standalone model storage: %w", err)
}
// Create the model runner container.
if err := standalone.CreateControllerContainer(cmd.Context(), dockerClient, port, doNotTrack, gpu, modelStorageVolume, cmd); err != nil {
if err := standalone.CreateControllerContainer(cmd.Context(), dockerClient, port, environment, doNotTrack, gpu, modelStorageVolume, cmd); err != nil {
return fmt.Errorf("unable to initialize standalone model runner container: %w", err)
}

Expand Down
7 changes: 5 additions & 2 deletions pkg/standalone/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func determineBridgeGatewayIP(ctx context.Context, dockerClient *client.Client)
}

// CreateControllerContainer creates and starts a controller container.
func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, doNotTrack bool, gpu gpupkg.GPUSupport, modelStorageVolume string, printer StatusPrinter) error {
func CreateControllerContainer(ctx context.Context, dockerClient *client.Client, port uint16, environment string, doNotTrack bool, gpu gpupkg.GPUSupport, modelStorageVolume string, printer StatusPrinter) error {
// Determine the target image.
var imageName string
switch gpu {
Expand All @@ -78,7 +78,10 @@ func CreateControllerContainer(ctx context.Context, dockerClient *client.Client,

// Set up the container configuration.
portStr := strconv.Itoa(int(port))
env := []string{"MODEL_RUNNER_PORT=" + portStr}
env := []string{
"MODEL_RUNNER_PORT=" + portStr,
"MODEL_RUNNER_ENVIRONMENT=" + environment,
}
if doNotTrack {
env = append(env, "DO_NOT_TRACK=1")
}
Expand Down