Skip to content

Commit abdbf56

Browse files
committed
Rebase on upstream KFP 7838009
2 parents a4c5b1a + 7838009 commit abdbf56

File tree

14 files changed

+708
-576
lines changed

14 files changed

+708
-576
lines changed

.github/workflows/validate-generated-files.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Validate Generated Files
22
on:
3+
push:
4+
branches:
5+
- master
36
pull_request:
47
paths:
5-
- 'backend/api/**/*.proto'
68
- '.github/workflows/validate-generated-files.yml'
9+
- 'backend/api/**/*.proto'
710
- 'backend/api/**/go_http_client/**'
811
- 'backend/api/**/go_client/**'
912
- 'backend/api/**/python_http_client/**'
1013
- 'backend/api/**/swagger/**'
14+
- 'api/**/*.proto'
15+
- 'api/**/*.go'
16+
- 'kubernetes_platform/**/*.proto'
17+
- 'kubernetes_platform/**/*.go'
1118

1219
jobs:
1320
validate-generated-files:

api/v2alpha1/go/pipelinespec/pipeline_spec.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v2alpha1/pipeline_spec.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ message TaskInputsSpec {
292292

293293
// Represents an input parameter. The value can be taken from an upstream
294294
// task's output parameter (if specifying `producer_task` and
295-
// `output_parameter_key`, or it can be a runtime value, which can either be
295+
// `output_parameter_key`), or it can be a runtime value, which can either be
296296
// determined at compile-time, or from a pipeline parameter.
297297
message InputParameterSpec {
298298
// Represents an upstream task's output parameter.
@@ -307,9 +307,9 @@ message TaskInputsSpec {
307307

308308
// Represents an upstream task's final status. The field can only be set if
309309
// the schema version is `2.0.0`. The resolved input parameter will be a
310-
// json payload in string type.
310+
// JSON payload in string type.
311311
message TaskFinalStatus {
312-
// The name of the upsteram task where the final status is coming from.
312+
// The name of the upstream task where the final status is coming from.
313313
string producer_task = 1;
314314
}
315315

backend/src/apiserver/server/list_request_util.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"strconv"
2222
"strings"
2323

24+
"github.com/golang/protobuf/jsonpb"
2425
apiv1beta1 "github.com/kubeflow/pipelines/backend/api/v1beta1/go_client"
2526
apiv2beta1 "github.com/kubeflow/pipelines/backend/api/v2beta1/go_client"
2627
"github.com/kubeflow/pipelines/backend/src/apiserver/common"
@@ -147,13 +148,13 @@ func parseAPIFilter(encoded string, apiVersion string) (interface{}, error) {
147148
switch apiVersion {
148149
case "v2beta1":
149150
f := &apiv2beta1.Filter{}
150-
if err := util.UnmarshalString(decoded, f); err != nil {
151+
if err := jsonpb.UnmarshalString(decoded, f); err != nil {
151152
return nil, util.NewInvalidInputError("failed to parse valid filter from %q: %v", encoded, err)
152153
}
153154
return f, nil
154155
case "v1beta1":
155156
f := &apiv1beta1.Filter{}
156-
if err := util.UnmarshalString(decoded, f); err != nil {
157+
if err := jsonpb.UnmarshalString(decoded, f); err != nil {
157158
return nil, util.NewInvalidInputError("failed to parse valid filter from %q: %v", encoded, err)
158159
}
159160
return f, nil

backend/src/common/util/pipelinerun.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"flag"
2020
"fmt"
21+
"github.com/golang/protobuf/jsonpb"
2122
"sort"
2223
"strings"
2324
"time"
@@ -663,7 +664,7 @@ func collectTaskRunMetricsOrNil(
663664
// ReportRunMetricsRequest as a workaround to hold user's metrics, which is a superset of what
664665
// user can provide.
665666
reportMetricsRequest := new(api.ReportRunMetricsRequest)
666-
err = UnmarshalString(metricsJSON, reportMetricsRequest)
667+
err = jsonpb.UnmarshalString(metricsJSON, reportMetricsRequest)
667668
if err != nil {
668669
// User writes invalid metrics JSON.
669670
// TODO(#1426): report the error back to api server to notify user

backend/src/common/util/workflow.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/argoproj/argo-workflows/v3/workflow/packer"
3030
"github.com/argoproj/argo-workflows/v3/workflow/validate"
3131
"github.com/golang/glog"
32+
"github.com/golang/protobuf/jsonpb"
3233
api "github.com/kubeflow/pipelines/backend/api/v1beta1/go_client"
3334
exec "github.com/kubeflow/pipelines/backend/src/common"
3435
swfregister "github.com/kubeflow/pipelines/backend/src/crd/pkg/apis/scheduledworkflow"
@@ -516,7 +517,7 @@ func collectNodeMetricsOrNil(runID string, nodeStatus *workflowapi.NodeStatus, r
516517
// ReportRunMetricsRequest as a workaround to hold user's metrics, which is a superset of what
517518
// user can provide.
518519
reportMetricsRequest := new(api.ReportRunMetricsRequest)
519-
err = UnmarshalString(metricsJSON, reportMetricsRequest)
520+
err = jsonpb.UnmarshalString(metricsJSON, reportMetricsRequest)
520521
if err != nil {
521522
// User writes invalid metrics JSON.
522523
// TODO(#1426): report the error back to api server to notify user

backend/src/v2/compiler/argocompiler/container.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ import (
2020
"strconv"
2121
"strings"
2222

23-
"github.com/kubeflow/pipelines/backend/src/common/util"
24-
2523
wfapi "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
2624
"github.com/golang/glog"
25+
"github.com/golang/protobuf/jsonpb"
2726
"github.com/kubeflow/pipelines/api/v2alpha1/go/pipelinespec"
2827
"github.com/kubeflow/pipelines/backend/src/apiserver/common"
2928
"github.com/kubeflow/pipelines/backend/src/v2/component"
@@ -431,7 +430,7 @@ func (c *workflowCompiler) addContainerExecutorTemplate(refName string) string {
431430

432431
if kubernetesConfigParam != nil {
433432
k8sExecCfg := &kubernetesplatform.KubernetesExecutorConfig{}
434-
if err := util.UnmarshalString(string(*kubernetesConfigParam.Value), k8sExecCfg); err == nil {
433+
if err := jsonpb.UnmarshalString(string(*kubernetesConfigParam.Value), k8sExecCfg); err == nil {
435434
extendPodMetadata(&executor.Metadata, k8sExecCfg)
436435
}
437436
}

backend/src/v2/compiler/visitor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ package compiler
2424
import (
2525
"bytes"
2626
"fmt"
27-
"github.com/kubeflow/pipelines/backend/src/common/util"
2827
"sort"
2928

3029
"github.com/golang/protobuf/jsonpb"
@@ -188,7 +187,7 @@ func GetPipelineSpec(job *pipelinespec.PipelineJob) (*pipelinespec.PipelineSpec,
188187
return nil, fmt.Errorf("failed marshal pipeline spec to json: %w", err)
189188
}
190189
spec := &pipelinespec.PipelineSpec{}
191-
if err := util.UnmarshalString(json, spec); err != nil {
190+
if err := jsonpb.UnmarshalString(json, spec); err != nil {
192191
return nil, fmt.Errorf("failed to parse pipeline spec: %v", err)
193192
}
194193
return spec, nil

backend/src/v2/compiler/visitor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ package compiler_test
1515

1616
import (
1717
"fmt"
18-
"github.com/kubeflow/pipelines/backend/src/common/util"
1918
"os"
2019
"testing"
2120

21+
"github.com/golang/protobuf/jsonpb"
2222
"github.com/google/go-cmp/cmp"
2323
"github.com/kubeflow/pipelines/api/v2alpha1/go/pipelinespec"
2424
"github.com/kubeflow/pipelines/backend/src/v2/compiler"
@@ -93,7 +93,7 @@ func load(t *testing.T, path string) *pipelinespec.PipelineJob {
9393
}
9494
json := string(content)
9595
job := &pipelinespec.PipelineJob{}
96-
if err := util.UnmarshalString(json, job); err != nil {
96+
if err := jsonpb.UnmarshalString(json, job); err != nil {
9797
t.Errorf("Failed to parse pipeline job, error: %s, job: %v", err, json)
9898
}
9999
return job

kubernetes_platform/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ clean-python:
6060
.PHONY: generate-go-in-container
6161
generate-go-in-container:
6262
mkdir -p go/kubernetesplatform
63-
cd proto && protoc -I=. \
63+
cd proto && protoc -I=. -I=../../api/v2alpha1 \
6464
--go_out=../go/kubernetesplatform \
6565
--go_opt=paths=source_relative \
6666
kubernetes_executor_config.proto

0 commit comments

Comments
 (0)