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(sdk): Add Input Parameter support for configmap, secrets, node selectors, tolerations, pull secrets #11621

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HumairAK
Copy link
Collaborator

@HumairAK HumairAK commented Feb 12, 2025

Description of your changes:

Related:

These will be marked resolved once the backend & sdk changes are merged after this.

This change provides proto api support for the following kubernetes platform
fields:

  • configmap name for configmap as env & volume
  • secret name for configmap as env & volume
  • image pull secret name
  • toleration json
  • node selector json

Checklist:

@HumairAK
Copy link
Collaborator Author

cc @chensun please review the proto changes here when you get the chance so we are aligned here, as some fields are also being deprecated

@HumairAK
Copy link
Collaborator Author

HumairAK commented Feb 12, 2025

Please also note that this is a more generic implementation of how we were handling inputs already for pvc mounts in the k8s platform spec here, but extended to various other fields

One thing also worth noting is that we probably don't need the entire InputParameterSpec as it is defined in the pipelinespec, for example TaskFinalStatus might not make much sense here, but for simplicity and maintainability's sake I figured it's easier to just keep them fully in sync. In the future we should consider just updating the structure of our proto files so we can directly import these instead of copying them over.

@chensun chensun self-assigned this Feb 12, 2025
@HumairAK
Copy link
Collaborator Author

HumairAK commented Feb 12, 2025

CI failures are due to flaky tests I believe. Will retry them a couple of times to confirm.
Actually I don't think so, investigating.

@HumairAK
Copy link
Collaborator Author

HumairAK commented Feb 12, 2025

The tests failures are a redherring, it's because of the compiled proto packages that are not utilizing the new code
See this test PR that references the k8s go packages locally, the tests here pass, the only difference being this commit

@google-oss-prow google-oss-prow bot added size/XXL and removed size/L labels Feb 23, 2025
@HumairAK HumairAK force-pushed the issue-10914-sdk branch 2 times, most recently from 06de2bc to 5106646 Compare February 23, 2025 02:57
@HumairAK
Copy link
Collaborator Author

HumairAK commented Feb 24, 2025

cc @chensun wdyt? any objections to merging this? Once done I'll follow up with backend PR.

Copy link
Member

@chensun chensun 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 26, 2025
# Ensure Python can find the protobuf-generated modules
# This is needed in order to resolve common proto python module
# that is generated via generate_proto.py
package_dir = os.path.dirname(os.path.abspath(__file__))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still needed?

Copy link
Collaborator Author

@HumairAK HumairAK Feb 26, 2025

Choose a reason for hiding this comment

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

well we need this line to be recognizable in kubernetes_executor_config_pb2.py (the python proto output):

import pipeline_spec_pb2 as pipeline__spec__pb2

here python will not be able to find this module because we're outputing it in the same location

another maybe a more preferable approach can be to just create the module directory with an __init__.py and have the output go there, this should get it to work and we can drop these lines

I don't have a strong preference

This change adds the necessary proto changes to accomodate parameterized
input for various k8s platform fields: secrets, configmaps, node
selectors, tolerations, and image pull secrets.

Signed-off-by: Humair Khan <[email protected]>
Copy link

New changes are detected. LGTM label has been removed.

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from chensun. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants