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
8 changes: 8 additions & 0 deletions cmd/cli/pkg/standalone/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ func CreateControllerContainer(ctx context.Context, dockerClient *client.Client,
if doNotTrack {
env = append(env, "DO_NOT_TRACK=1")
}

// Pass proxy environment variables to the container if they are set
proxyEnvVars := []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"}
for _, proxyVar := range proxyEnvVars {
if value, ok := os.LookupEnv(proxyVar); ok {
env = append(env, proxyVar+"="+value)
}
Comment thread
ericcurtin marked this conversation as resolved.
}
config := &container.Config{
Image: imageName,
Env: env,
Expand Down
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,22 @@ func main() {

memEstimator := memory.NewEstimator(sysMemInfo)

// Create a proxy-aware HTTP transport
// Use a safe type assertion with fallback, and explicitly set Proxy to http.ProxyFromEnvironment
var baseTransport *http.Transport
if t, ok := http.DefaultTransport.(*http.Transport); ok {
baseTransport = t.Clone()
} else {
baseTransport = &http.Transport{}
Comment thread
ericcurtin marked this conversation as resolved.
}
baseTransport.Proxy = http.ProxyFromEnvironment

modelManager := models.NewManager(
log,
models.ClientConfig{
StoreRootPath: modelPath,
Logger: log.WithFields(logrus.Fields{"component": "model-manager"}),
Transport: resumable.New(http.DefaultTransport),
Transport: resumable.New(baseTransport),
Comment thread
ericcurtin marked this conversation as resolved.
},
nil,
memEstimator,
Expand Down
Loading