Skip to content

Commit 71c6e6e

Browse files
AnaySharmaCodeAnaySh
authored andcommitted
fix: argument list to long error for large dags
Signed-off-by: Anay Sharma <anay20sharma11@gmail.com>
1 parent 251b5f7 commit 71c6e6e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

backend/src/v2/cmd/driver/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"os"
3030
"path/filepath"
3131
"strconv"
32+
"strings"
3233

3334
"github.com/golang/glog"
3435
"github.com/kubeflow/pipelines/api/v2alpha1/go/pipelinespec"
@@ -146,6 +147,18 @@ func drive() (err error) {
146147
return err
147148
}
148149

150+
// Support reading component spec from a file if value starts with @
151+
// This bypasses exec() argument size limits for large workflows
152+
if strings.HasPrefix(*componentSpecJson, "@") {
153+
filePath := (*componentSpecJson)[1:] // Remove the "@" prefix
154+
data, err := os.ReadFile(filePath)
155+
if err != nil {
156+
return fmt.Errorf("failed to read component spec from file %s: %w", filePath, err)
157+
}
158+
*componentSpecJson = string(data)
159+
glog.Infof("Read component spec from file: %s (%d bytes)", filePath, len(data))
160+
}
161+
149162
proxy.InitializeConfig(*httpProxy, *httpsProxy, *noProxy)
150163
glog.Infof("input ComponentSpec:%s\n", prettyPrint(*componentSpecJson))
151164
componentSpec := &pipelinespec.ComponentSpec{}

0 commit comments

Comments
 (0)