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

Add support for GPU fields in Cloud Run Service v1 and v2 api #11597

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

trshafer
Copy link
Contributor

@trshafer trshafer commented Aug 30, 2024

Adds support for GPU fields which requires changes to limits as well as adding a new field nodeSelector to v1 and v2 api.

Release Note Template for Downstream PRs (will be copied)

cloudrun: added `nvidia.com/gpu` to `resources` and `node_selector` to  `google_cloud_run_service` resource (beta)
cloudrunv2: added `nvidia.com/gpu` to `resources` and `node_selector` to `google_cloud_run_v2_service` resource (beta)

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 119 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 258 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 74
Passed tests: 61
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 19 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 243 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@trshafer trshafer marked this pull request as ready for review August 30, 2024 22:16
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions bot requested a review from shuyama1 August 30, 2024 22:16
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 74
Passed tests: 61
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 19 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 243 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 74
Passed tests: 61
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • cloudrunv2
  • cloudrun
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 19 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 243 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 74
Passed tests: 61
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 19 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 307 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 30
Passed tests: 23
Skipped tests: 7
Affected tests: 0

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements
    $\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 19 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 243 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 76
Passed tests: 63
Skipped tests: 12
Affected tests: 1

Click here to see the affected service packages
  • cloudrunv2
  • cloudrun
#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccCloudRunService_resourcesRequirements

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccCloudRunV2Service_cloudrunv2ServiceWithResourcesRequirements[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

description: Node Selector describes the hardware requirements of the resources.
properties:
- !ruby/object:Api::Type::String
name: 'accelerator'
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 make this field required, given this is the only subfield under node_selector currently. We'd generally want to prevent users sending empty blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If different fields are added later and all are optional, is it a breaking change to remove required on accelerator?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, required -> optional is non-breaking

<% unless version == 'ga' -%>

func TestAccCloudRunService_resourcesRequirements(t *testing.T) {
acctest.SkipIfVcr(t)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any particular reason that we need to skip VCR for this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching. I have removed these tests in favor of the examples.

@@ -0,0 +1,34 @@
resource "google_cloud_run_service" "<%= ctx[:primary_resource_id] %>" {
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to add an example block to the resource.yaml file to register this example for documentation and test case generation. Please refer to step 5 in https://googlecloudplatform.github.io/magic-modules/develop/test/test/#add-a-create-test for guidance. Additionally, we can remove the handwritten test since the resource configurations in the examples and the handwritten test are mostly identical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I have removed the tests in favor of the examples.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 217 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 8 files changed, 546 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 128 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 79
Passed tests: 67
Skipped tests: 11
Affected tests: 1

Click here to see the affected service packages
  • cloudrunv2
  • cloudrun

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunService_resourcesRequirements

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccCloudRunService_resourcesRequirements[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@jasonsmithio
Copy link

Howdy!

I love this. Is this ready for review and merging? Happy to help if anything else is needed.

Copy link

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

LGTM overall, only a small comment regarding the example version

mmv1/products/cloudrun/Service.yaml Outdated Show resolved Hide resolved
mmv1/products/cloudrunv2/Service.yaml Outdated Show resolved Hide resolved
@github-actions github-actions bot requested a review from shuyama1 September 17, 2024 17:04
@trshafer
Copy link
Contributor Author

LGTM overall, only a small comment regarding the example version

Thanks! I have applied the suggested fixes.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 95 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 8 files changed, 546 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 79
Passed tests: 66
Skipped tests: 11
Affected tests: 2

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccCloudRunV2Service_cloudrunv2ServiceGpuExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCloudRunService_cloudRunServiceGpuExample[Error message] [Debug log]
TestAccCloudRunV2Service_cloudrunv2ServiceGpuExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

you'll need follow step 3 in https://googlecloudplatform.github.io/magic-modules/develop/test/test/#add-a-create-test to add provider = google-beta to every resource in your example configuration file. This should resolve the test failure. Sorry that I pointed to the wrong step in my previous comment.

@trshafer
Copy link
Contributor Author

Ah, thank you. I have updated the example files.

@github-actions github-actions bot requested a review from shuyama1 September 18, 2024 15:57
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 3 files changed, 97 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 8 files changed, 550 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 48 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 79
Passed tests: 68
Skipped tests: 11
Affected tests: 0

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

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.

4 participants