Skip to content

Commit 4fd0b09

Browse files
authored
Merge pull request #81 from HumairAK/stable
Stable
2 parents 52e45a8 + 93be581 commit 4fd0b09

File tree

18 files changed

+112
-24
lines changed

18 files changed

+112
-24
lines changed

.github/workflows/build-prs-trigger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo ${{ github.event.pull_request.state }} >> ./pr/pr_state
2828
echo ${{ github.event.pull_request.head.sha }} >> ./pr/head_sha
2929
echo ${{ github.event.action }} >> ./pr/event_action
30-
- uses: actions/upload-artifact@v2
30+
- uses: actions/upload-artifact@v3
3131
with:
3232
name: pr
3333
path: pr/

backend/src/apiserver/client_manager/client_manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ func (c *ClientManager) init() {
208208

209209
c.k8sCoreClient = client.CreateKubernetesCoreOrFatal(common.GetDurationConfig(initConnectionTimeout), clientParams)
210210

211-
newClient, err := metadata.NewClient(common.GetMetadataGrpcServiceServiceHost(), common.GetMetadataGrpcServiceServicePort())
211+
newClient, err := metadata.NewClient(common.GetMetadataGrpcServiceServiceHost(), common.GetMetadataGrpcServiceServicePort(), common.GetMetadataTLSEnabled())
212+
212213
if err != nil {
213214
glog.Fatalf("Failed to create metadata client. Error: %v", err)
214215
}

backend/src/apiserver/common/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
TokenReviewAudience string = "TOKEN_REVIEW_AUDIENCE"
3535
MetadataGrpcServiceServiceHost string = "METADATA_GRPC_SERVICE_SERVICE_HOST"
3636
MetadataGrpcServiceServicePort string = "METADATA_GRPC_SERVICE_SERVICE_PORT"
37+
MetadataTLSEnabled string = "METADATA_TLS_ENABLED"
3738
SignedURLExpiryTimeSeconds string = "SIGNED_URL_EXPIRY_TIME_SECONDS"
3839
)
3940

@@ -142,3 +143,7 @@ func GetMetadataGrpcServiceServicePort() string {
142143
func GetSignedURLExpiryTimeSeconds() int {
143144
return GetIntConfigWithDefault(SignedURLExpiryTimeSeconds, DefaultSignedURLExpiryTimeSeconds)
144145
}
146+
147+
func GetMetadataTLSEnabled() bool {
148+
return GetBoolConfigWithDefault(MetadataTLSEnabled, DefaultMetadataTLSEnabled)
149+
}

backend/src/apiserver/common/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const DefaultTokenReviewAudience string = "pipelines.kubeflow.org"
5757
const (
5858
DefaultMetadataGrpcServiceServiceHost = "metadata-grpc-service"
5959
DefaultMetadataGrpcServiceServicePort = "8080"
60+
DefaultMetadataTLSEnabled = false
6061
)
6162

6263
const (

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ var (
7070
conditionPath = flag.String("condition_path", "", "Condition output path")
7171

7272
mlPipelineServiceTLSEnabledStr = flag.String("mlPipelineServiceTLSEnabled", "false", "Set to 'true' if mlpipeline api server serves over TLS (default: 'false').")
73+
metadataTLSEnabledStr = flag.String("metadataTLSEnabled", "false", "Set to 'true' if metadata server serves over TLS (default: 'false').")
7374
)
7475

7576
// func RootDAG(pipelineName string, runID string, component *pipelinespec.ComponentSpec, task *pipelinespec.PipelineTaskSpec, mlmd *metadata.Client) (*Execution, error) {
@@ -154,6 +155,11 @@ func drive() (err error) {
154155
return err
155156
}
156157

158+
metadataTLSEnabled, err := strconv.ParseBool(*metadataTLSEnabledStr)
159+
if err != nil {
160+
return err
161+
}
162+
157163
cacheClient, err := cacheutils.NewClient(mlPipelineServiceTLSEnabled)
158164
if err != nil {
159165
return err
@@ -167,6 +173,9 @@ func drive() (err error) {
167173
DAGExecutionID: *dagExecutionID,
168174
IterationIndex: *iterationIndex,
169175
MLPipelineTLSEnabled: mlPipelineServiceTLSEnabled,
176+
MLMDServerAddress: *mlmdServerAddress,
177+
MLMDServerPort: *mlmdServerPort,
178+
MLMDTLSEnabled: metadataTLSEnabled,
170179
}
171180
var execution *driver.Execution
172181
var driverErr error
@@ -292,5 +301,11 @@ func newMlmdClient() (*metadata.Client, error) {
292301
mlmdConfig.Address = *mlmdServerAddress
293302
mlmdConfig.Port = *mlmdServerPort
294303
}
295-
return metadata.NewClient(mlmdConfig.Address, mlmdConfig.Port)
304+
305+
tlsEnabled, err := strconv.ParseBool(*metadataTLSEnabledStr)
306+
if err != nil {
307+
return nil, err
308+
}
309+
310+
return metadata.NewClient(mlmdConfig.Address, mlmdConfig.Port, tlsEnabled)
296311
}

backend/src/v2/cmd/launcher-v2/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var (
4343
mlmdServerAddress = flag.String("mlmd_server_address", "", "The MLMD gRPC server address.")
4444
mlmdServerPort = flag.String("mlmd_server_port", "8080", "The MLMD gRPC server port.")
4545
mlPipelineServiceTLSEnabledStr = flag.String("mlPipelineServiceTLSEnabled", "false", "Set to 'true' if mlpipeline api server serves over TLS (default: 'false').")
46+
metadataTLSEnabledStr = flag.String("metadataTLSEnabled", "false", "Set to 'true' if metadata server serves over TLS (default: 'false').")
4647
)
4748

4849
func main() {
@@ -71,6 +72,12 @@ func run() error {
7172
if err != nil {
7273
return err
7374
}
75+
76+
metadataServiceTLSEnabled, err := strconv.ParseBool(*metadataTLSEnabledStr)
77+
if err != nil {
78+
return err
79+
}
80+
7481
launcherV2Opts := &component.LauncherV2Options{
7582
Namespace: namespace,
7683
PodName: *podName,
@@ -80,6 +87,7 @@ func run() error {
8087
PipelineName: *pipelineName,
8188
RunID: *runID,
8289
MLPipelineTLSEnabled: mlPipelineServiceTLSEnabled,
90+
MetadataTLSEnabled: metadataServiceTLSEnabled,
8391
}
8492

8593
switch *executorType {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package argocompiler
1717
import (
1818
wfapi "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
1919
"github.com/kubeflow/pipelines/api/v2alpha1/go/pipelinespec"
20+
"github.com/kubeflow/pipelines/backend/src/apiserver/common"
2021
"github.com/kubeflow/pipelines/backend/src/v2/component"
2122
k8score "k8s.io/api/core/v1"
2223
"os"
@@ -163,6 +164,9 @@ func (c *workflowCompiler) addContainerDriverTemplate() string {
163164
"--condition_path", outputPath(paramCondition),
164165
"--kubernetes_config", inputValue(paramKubernetesConfig),
165166
"--mlPipelineServiceTLSEnabled", strconv.FormatBool(c.mlPipelineServiceTLSEnabled),
167+
"--mlmd_server_address", common.GetMetadataGrpcServiceServiceHost(),
168+
"--mlmd_server_port", common.GetMetadataGrpcServiceServicePort(),
169+
"--metadataTLSEnabled", strconv.FormatBool(common.GetMetadataTLSEnabled()),
166170
},
167171
Resources: driverResources,
168172
},

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ package argocompiler
1515

1616
import (
1717
"fmt"
18+
"github.com/kubeflow/pipelines/backend/src/apiserver/common"
1819
"sort"
1920
"strconv"
2021
"strings"
@@ -443,6 +444,9 @@ func (c *workflowCompiler) addDAGDriverTemplate() string {
443444
"--iteration_count_path", outputPath(paramIterationCount),
444445
"--condition_path", outputPath(paramCondition),
445446
"--mlPipelineServiceTLSEnabled", strconv.FormatBool(c.mlPipelineServiceTLSEnabled),
447+
"--mlmd_server_address", common.GetMetadataGrpcServiceServiceHost(),
448+
"--mlmd_server_port", common.GetMetadataGrpcServiceServicePort(),
449+
"--metadataTLSEnabled", strconv.FormatBool(common.GetMetadataTLSEnabled()),
446450
},
447451
Resources: driverResources,
448452
},

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package argocompiler
1616

1717
import (
1818
"fmt"
19+
"github.com/kubeflow/pipelines/backend/src/apiserver/common"
1920

2021
wfapi "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
2122
"github.com/kubeflow/pipelines/api/v2alpha1/go/pipelinespec"
@@ -76,10 +77,8 @@ func (c *workflowCompiler) addImporterTemplate() string {
7677
fmt.Sprintf("$(%s)", component.EnvPodName),
7778
"--pod_uid",
7879
fmt.Sprintf("$(%s)", component.EnvPodUID),
79-
"--mlmd_server_address",
80-
fmt.Sprintf("$(%s)", component.EnvMetadataHost),
81-
"--mlmd_server_port",
82-
fmt.Sprintf("$(%s)", component.EnvMetadataPort),
80+
"--mlmd_server_address", common.GetMetadataGrpcServiceServiceHost(),
81+
"--mlmd_server_port", common.GetMetadataGrpcServiceServicePort(),
8382
}
8483
importerTemplate := &wfapi.Template{
8584
Name: name,

backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ spec:
6767
- '{{inputs.parameters.kubernetes-config}}'
6868
- "--mlPipelineServiceTLSEnabled"
6969
- "false"
70+
- "--mlmd_server_address"
71+
- "metadata-grpc-service"
72+
- "--mlmd_server_port"
73+
- "8080"
74+
- "--metadataTLSEnabled"
75+
- "false"
7076
command:
7177
- driver
7278
image: gcr.io/ml-pipeline/kfp-driver
@@ -312,6 +318,12 @@ spec:
312318
- '{{outputs.parameters.condition.path}}'
313319
- "--mlPipelineServiceTLSEnabled"
314320
- "false"
321+
- "--mlmd_server_address"
322+
- "metadata-grpc-service"
323+
- "--mlmd_server_port"
324+
- "8080"
325+
- "--metadataTLSEnabled"
326+
- "false"
315327
command:
316328
- driver
317329
image: gcr.io/ml-pipeline/kfp-driver

0 commit comments

Comments
 (0)