Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Backend + SDK): Update kfp backend and kubernetes sdk to support ConfigMaps as volumes and as env variables #10483

Merged
merged 11 commits into from
Feb 24, 2024

Conversation

roytman
Copy link
Contributor

@roytman roytman commented Feb 14, 2024

Description of your changes:
Part of #9768
Fixes #10251

Update kfp backend and kubernetes sdk to support Config Maps as volumes and environment variables.

Checklist:

…s and as env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Copy link

Hi @roytman. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
@roytman
Copy link
Contributor Author

roytman commented Feb 14, 2024

/lint

Copy link

@google-oss-prow google-oss-prow bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roytman: 0 warnings.

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
@Tomcli
Copy link
Member

Tomcli commented Feb 14, 2024

/ok-to-test

@@ -108,7 +107,7 @@ gocloud.dev,https://github.com/google/go-cloud/blob/v0.22.0/LICENSE,Apache-2.0
golang.org/x/crypto,https://cs.opensource.google/go/x/crypto/+/v0.9.0:LICENSE,BSD-3-Clause
golang.org/x/net,https://cs.opensource.google/go/x/net/+/v0.10.0:LICENSE,BSD-3-Clause
golang.org/x/oauth2,https://cs.opensource.google/go/x/oauth2/+/d3ed0bb2:LICENSE,BSD-3-Clause
golang.org/x/sys,https://cs.opensource.google/go/x/sys/+/v0.8.0:LICENSE,BSD-3-Clause
golang.org/x/sys/unix,https://cs.opensource.google/go/x/sys/+/v0.8.0:LICENSE,BSD-3-Clause
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the latest commit changed the deps on the apiserver. It should only updated the kubernetes_platform version.

@@ -512,6 +512,39 @@ func extendPodSpecPatch(
}
}

// Get config map mount information
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we can refactor these two for loops into functions so that we can also reuse them for secret mount and secret env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Copy link
Member

@Tomcli Tomcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @roytman, the tests are passed now. Are you planning to refactor the two for loops for configmap mount and configmap env into functions?

/assign @chensun

@roytman
Copy link
Contributor Author

roytman commented Feb 15, 2024

Thanks @roytman, the tests are passed now. Are you planning to refactor the two for loops for configmap mount and configmap env into functions?

Hi @Tomcli , sorry, I don't see how it can be done without changes in kubernetes_platform/proto/kubernetes_executor_config.proto and in k8s.io/api/core/v1 can we check it together?

@Tomcli
Copy link
Member

Tomcli commented Feb 15, 2024

Thanks @roytman, the tests are passed now. Are you planning to refactor the two for loops for configmap mount and configmap env into functions?

Hi @Tomcli , sorry, I don't see how it can be done without changes in kubernetes_platform/proto/kubernetes_executor_config.proto and in k8s.io/api/core/v1 can we check it together?

I'm thinking more of refactoring the common pieces between configmap and secret volume mount into a common function. Since it involved some object abstraction for configmapRef/secretRef, we can defer this to a follow up PR.

/lgtm

Copy link
Member

@connor-mccarthy connor-mccarthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm from SDK standpoint

config_map_key_to_env: Dict[str, str],
) -> PipelineTask:
"""Use a Kubernetes ConfigMap as an environment variable as described in
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we style the link using RST for clean rendering in the reference docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks

kubernetes_platform/python/kfp/kubernetes/config_map.py Outdated Show resolved Hide resolved
Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
@google-oss-prow google-oss-prow bot removed the lgtm label Feb 16, 2024
@connor-mccarthy
Copy link
Member

/lgtm for SDK

config_map_name: str,
config_map_key_to_env: Dict[str, str],
) -> PipelineTask:
"""use a Kubernetes ConfigMap as an environment variable as described by the `Kubernetes documentation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""use a Kubernetes ConfigMap as an environment variable as described by the `Kubernetes documentation
"""Use a Kubernetes ConfigMap as an environment variable as described by the `Kubernetes documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Copy link
Member

@Tomcli Tomcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Feb 19, 2024
@connor-mccarthy
Copy link
Member

/lgtm for SDK

@google-oss-prow google-oss-prow bot removed the lgtm label Feb 23, 2024
Copy link

google-oss-prow bot commented Feb 23, 2024

@roytman: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
kubeflow-pipelines-samples-v2 36daba6 link false /test kubeflow-pipelines-samples-v2
kfp-kubernetes-execution-tests 36daba6 link false /test kfp-kubernetes-execution-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@Tomcli Tomcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Feb 24, 2024
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chensun, connor-mccarthy, Tomcli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 1edd85f into kubeflow:master Feb 24, 2024
12 of 14 checks passed
petethegreat pushed a commit to petethegreat/pipelines that referenced this pull request Mar 27, 2024
… ConfigMaps as volumes and as env variables (kubeflow#10483)

* Update kfp backend and kubernetes sdk to support ConfigMaps as volumes and as env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* add test/snapshot/data files

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix tests

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* go mod tidy

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

---------

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
rimolive pushed a commit to rimolive/data-science-pipelines that referenced this pull request Mar 28, 2024
… ConfigMaps as volumes and as env variables (kubeflow#10483)

* Update kfp backend and kubernetes sdk to support ConfigMaps as volumes and as env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* add test/snapshot/data files

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix tests

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* go mod tidy

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

---------

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
petethegreat pushed a commit to petethegreat/pipelines that referenced this pull request Mar 29, 2024
… ConfigMaps as volumes and as env variables (kubeflow#10483)

* Update kfp backend and kubernetes sdk to support ConfigMaps as volumes and as env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* add test/snapshot/data files

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix tests

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* go mod tidy

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

---------

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
VaniHaripriya pushed a commit to VaniHaripriya/data-science-pipelines that referenced this pull request Sep 23, 2024
… ConfigMaps as volumes and as env variables (kubeflow#10483)

* Update kfp backend and kubernetes sdk to support ConfigMaps as volumes and as env

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* add test/snapshot/data files

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix tests

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* go mod tidy

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update backend/third_party_licenses/apiserver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* fix comments

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

* update go.mod, apiserver.csv and driver.csv

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>

---------

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[question] sdk v2 environment variables from configmaps and secrets
4 participants