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

ci: Initial Terraform configurations (Work in Progress) #8436

Closed
wants to merge 111 commits into from

Conversation

burkedavison
Copy link
Member

See ./.terraform/test.sh for instructions.

These terraform configurations are (currently) designed to create and destroy a new GCP project for each module being tested. To run the script, you must identify a GCP Folder ID in which the project(s) will be created, and a GCP Billing Account ID to assign to the created project(s).

This is a work in progress. We have not decided we want to do this, but it does offer full isolation between integration tests.

terraform and gcloud must be installed. Developed on MacOS. Not yet tested on Linux.

@burkedavison burkedavison marked this pull request as draft September 21, 2022 19:09
@meltsufin
Copy link
Member

meltsufin commented Sep 21, 2022

Have you looked into how we will run it as part of CI/Kokoro? I guess we'll need to configure Kokoro service account to have permissions on the projects directory.

@burkedavison
Copy link
Member Author

burkedavison commented Sep 21, 2022 via email

.terraform/test.sh Outdated Show resolved Hide resolved
@@ -0,0 +1,43 @@
terraform {
required_providers {
google = {
Copy link
Member

Choose a reason for hiding this comment

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

I feel these first declaration redundant. The three main.tf has the almost same section. Is there a way to eliminate the redundancy?

Copy link
Member Author

Choose a reason for hiding this comment

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

Investigating

.terraform/test.sh Outdated Show resolved Hide resolved
@@ -0,0 +1,20 @@
# Modules to be tested when no specific module is given to test.sh as an argument
Copy link
Member

Choose a reason for hiding this comment

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

I think this file can be replaced by a command to find directories that contain Terraform configuration. With that we can eliminate a possibility of having discrepancy (Terraform files are added to modules but forget updating this file). What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion. TODO

@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 6, 2022
@@ -0,0 +1,48 @@
# Auto-generated by generate-config.sh
Copy link
Member

Choose a reason for hiding this comment

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

What if we don't add generated files. Would this PR becomes much smaller?

Copy link
Member Author

Choose a reason for hiding this comment

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

These three 'template' files aren't actually generated -- they're used to copy and then append to the "actual" generated files which are not in git.

@burkedavison burkedavison added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 11, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 11, 2022
burkedavison and others added 4 commits October 14, 2022 09:22
# Conflicts:
#	.gitignore
* chore: release main

* chore: manual fix

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: ddixit14 <deepankardixit@google.com>
# Conflicts:
#	.release-please-manifest.json
#	gapic-libraries-bom/CHANGELOG.md
#	gapic-libraries-bom/pom.xml
#	google-cloud-jar-parent/CHANGELOG.md
#	google-cloud-pom-parent/CHANGELOG.md
#	java-accessapproval/CHANGELOG.md
#	java-accesscontextmanager/CHANGELOG.md
#	java-aiplatform/CHANGELOG.md
#	java-analytics-admin/CHANGELOG.md
#	java-analytics-data/CHANGELOG.md
#	java-analyticshub/CHANGELOG.md
#	java-api-gateway/CHANGELOG.md
#	java-apigee-connect/CHANGELOG.md
#	java-apigee-registry/CHANGELOG.md
#	java-apikeys/CHANGELOG.md
#	java-appengine-admin/CHANGELOG.md
#	java-area120-tables/CHANGELOG.md
#	java-artifact-registry/CHANGELOG.md
#	java-asset/CHANGELOG.md
#	java-assured-workloads/CHANGELOG.md
#	java-automl/CHANGELOG.md
#	java-bare-metal-solution/CHANGELOG.md
#	java-batch/CHANGELOG.md
#	java-beyondcorp-appconnections/CHANGELOG.md
#	java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections-bom/pom.xml
#	java-beyondcorp-appconnections/google-cloud-beyondcorp-appconnections/pom.xml
#	java-beyondcorp-appconnections/grpc-google-cloud-beyondcorp-appconnections-v1/pom.xml
#	java-beyondcorp-appconnections/pom.xml
#	java-beyondcorp-appconnections/proto-google-cloud-beyondcorp-appconnections-v1/pom.xml
#	java-beyondcorp-appconnections/versions.txt
#	java-beyondcorp-appconnectors/CHANGELOG.md
#	java-beyondcorp-appconnectors/google-cloud-beyondcorp-appconnectors-bom/pom.xml
#	java-beyondcorp-appconnectors/google-cloud-beyondcorp-appconnectors/pom.xml
#	java-beyondcorp-appconnectors/grpc-google-cloud-beyondcorp-appconnectors-v1/pom.xml
#	java-beyondcorp-appconnectors/pom.xml
#	java-beyondcorp-appconnectors/proto-google-cloud-beyondcorp-appconnectors-v1/pom.xml
#	java-beyondcorp-appconnectors/versions.txt
#	java-beyondcorp-appgateways/CHANGELOG.md
#	java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways-bom/pom.xml
#	java-beyondcorp-appgateways/google-cloud-beyondcorp-appgateways/pom.xml
#	java-beyondcorp-appgateways/grpc-google-cloud-beyondcorp-appgateways-v1/pom.xml
#	java-beyondcorp-appgateways/pom.xml
#	java-beyondcorp-appgateways/proto-google-cloud-beyondcorp-appgateways-v1/pom.xml
#	java-beyondcorp-appgateways/versions.txt
#	java-beyondcorp-clientconnectorservices/CHANGELOG.md
#	java-beyondcorp-clientgateways/CHANGELOG.md
#	java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways-bom/pom.xml
#	java-beyondcorp-clientgateways/google-cloud-beyondcorp-clientgateways/pom.xml
#	java-beyondcorp-clientgateways/grpc-google-cloud-beyondcorp-clientgateways-v1/pom.xml
#	java-beyondcorp-clientgateways/pom.xml
#	java-beyondcorp-clientgateways/proto-google-cloud-beyondcorp-clientgateways-v1/pom.xml
#	java-beyondcorp-clientgateways/versions.txt
#	java-bigquery-data-exchange/CHANGELOG.md
#	java-bigqueryconnection/CHANGELOG.md
#	java-bigquerydatapolicy/CHANGELOG.md
#	java-bigquerydatatransfer/CHANGELOG.md
#	java-bigquerymigration/CHANGELOG.md
#	java-bigqueryreservation/CHANGELOG.md
#	java-billing/CHANGELOG.md
#	java-billingbudgets/CHANGELOG.md
#	java-binary-authorization/CHANGELOG.md
#	java-certificate-manager/CHANGELOG.md
#	java-channel/CHANGELOG.md
#	java-cloudbuild/CHANGELOG.md
#	java-cloudcommerceconsumerprocurement/CHANGELOG.md
#	java-compute/CHANGELOG.md
#	java-contact-center-insights/CHANGELOG.md
#	java-container/CHANGELOG.md
#	java-containeranalysis/CHANGELOG.md
#	java-data-fusion/CHANGELOG.md
#	java-datacatalog/CHANGELOG.md
#	java-dataflow/CHANGELOG.md
#	java-dataform/CHANGELOG.md
#	java-datalabeling/CHANGELOG.md
#	java-dataplex/CHANGELOG.md
#	java-dataproc-metastore/CHANGELOG.md
#	java-dataproc/CHANGELOG.md
#	java-datastream/CHANGELOG.md
#	java-debugger-client/CHANGELOG.md
#	java-deploy/CHANGELOG.md
#	java-dialogflow-cx/CHANGELOG.md
#	java-dialogflow/CHANGELOG.md
#	java-distributedcloudedge/CHANGELOG.md
#	java-dlp/CHANGELOG.md
#	java-dms/CHANGELOG.md
#	java-dns/CHANGELOG.md
#	java-document-ai/CHANGELOG.md
#	java-domains/CHANGELOG.md
#	java-errorreporting/CHANGELOG.md
#	java-essential-contacts/CHANGELOG.md
#	java-eventarc-publishing/CHANGELOG.md
#	java-eventarc/CHANGELOG.md
#	java-filestore/CHANGELOG.md
#	java-functions/CHANGELOG.md
#	java-game-servers/CHANGELOG.md
#	java-gke-backup/CHANGELOG.md
#	java-gke-connect-gateway/CHANGELOG.md
#	java-gke-multi-cloud/CHANGELOG.md
#	java-gkehub/CHANGELOG.md
#	java-grafeas/CHANGELOG.md
#	java-gsuite-addons/CHANGELOG.md
#	java-iam-admin/CHANGELOG.md
#	java-iamcredentials/CHANGELOG.md
#	java-ids/CHANGELOG.md
#	java-iot/CHANGELOG.md
#	java-kms/CHANGELOG.md
#	java-language/CHANGELOG.md
#	java-life-sciences/CHANGELOG.md
#	java-managed-identities/CHANGELOG.md
#	java-mediatranslation/CHANGELOG.md
#	java-memcache/CHANGELOG.md
#	java-monitoring-dashboards/CHANGELOG.md
#	java-monitoring/CHANGELOG.md
#	java-network-management/CHANGELOG.md
#	java-network-security/CHANGELOG.md
#	java-networkconnectivity/CHANGELOG.md
#	java-notebooks/CHANGELOG.md
#	java-optimization/CHANGELOG.md
#	java-orchestration-airflow/CHANGELOG.md
#	java-orgpolicy/CHANGELOG.md
#	java-os-config/CHANGELOG.md
#	java-os-login/CHANGELOG.md
#	java-phishingprotection/CHANGELOG.md
#	java-policy-troubleshooter/CHANGELOG.md
#	java-private-catalog/CHANGELOG.md
#	java-profiler/CHANGELOG.md
#	java-publicca/CHANGELOG.md
#	java-recaptchaenterprise/CHANGELOG.md
#	java-recommendations-ai/CHANGELOG.md
#	java-recommender/CHANGELOG.md
#	java-redis/CHANGELOG.md
#	java-resource-settings/CHANGELOG.md
#	java-resourcemanager/CHANGELOG.md
#	java-retail/CHANGELOG.md
#	java-run/CHANGELOG.md
#	java-scheduler/CHANGELOG.md
#	java-secretmanager/CHANGELOG.md
#	java-security-private-ca/CHANGELOG.md
#	java-securitycenter-settings/CHANGELOG.md
#	java-securitycenter/CHANGELOG.md
#	java-service-control/CHANGELOG.md
#	java-service-management/CHANGELOG.md
#	java-service-usage/CHANGELOG.md
#	java-servicedirectory/CHANGELOG.md
#	java-shell/CHANGELOG.md
#	java-speech/CHANGELOG.md
#	java-storage-transfer/CHANGELOG.md
#	java-talent/CHANGELOG.md
#	java-tasks/CHANGELOG.md
#	java-texttospeech/CHANGELOG.md
#	java-tpu/CHANGELOG.md
#	java-trace/CHANGELOG.md
#	java-translate/CHANGELOG.md
#	java-video-intelligence/CHANGELOG.md
#	java-video-live-stream/CHANGELOG.md
#	java-video-stitcher/CHANGELOG.md
#	java-video-transcoder/CHANGELOG.md
#	java-vision/CHANGELOG.md
#	java-vmmigration/CHANGELOG.md
#	java-vpcaccess/CHANGELOG.md
#	java-webrisk/CHANGELOG.md
#	java-websecurityscanner/CHANGELOG.md
#	java-workflow-executions/CHANGELOG.md
#	java-workflows/CHANGELOG.md
#	release-please-config.json
@burkedavison burkedavison added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 24, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 24, 2022
@burkedavison
Copy link
Member Author

See #8555 for continuation of this effort.

@burkedavison burkedavison deleted the terraform branch October 26, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants