Skip to content

Conversation

@chucklever
Copy link
Contributor

Add scripts that query the GCE provider API to create kdevops' Kconfig menus dynamically.

Split the VM machine menu and the OS image menu into separate
Kconfig files, as these two will each be generated by different
scripts.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Instead of sourcing files in a subdirectory, move the content of
those files right into Kconfig.location. This will make it easier
to examine the differences between the current menu content and
the dynamically-generated content.

The pattern of multiple TERRAFORM_GCE_ZONE declarations is valid
Kconfig since each is in a mutually exclusive if block (only one
region can be active at a time).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
…hine

Instead of sourcing files in a subdirectory, move the content of
those files right into Kconfig.machine. This will make it easier
to examine the differences between the current menu content and
the dynamically-generated content.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Instead of sourcing files in a subdirectory, move the content of
those files right into Kconfig.image. This will make it easier
to examine the differences between the current menu content and
the dynamically-generated content.

The consolidation is bug-for-bug compatible with the original
files, including missing default selections in some choice blocks.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This adds a Python script that queries the Google Cloud REST API
to retrieve available regions and zones, and then generates the
GCE Kconfig.location file dynamically. This ensures the region
list is always up-to-date and includes only regions accessible
to the user's project.

The implementation follows the same pattern as AWS and OCI. It
provides dynamic region discovery via the Google Cloud REST API
with friendly display names for each region. Inaccessible regions
are automatically filtered, and the script supports both
command-line querying and Kconfig file generation.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Similar to commit 0e572ac ("terraform/oci: Generate
Kconfig.shapes dynamically"), this patch adds a Python script that
queries the Google Cloud API to dynamically generate a Kconfig menu
for machine types.

Usage:

./gen_kconfig_machine > ../kconfigs/Kconfig.machine

./gen_kconfig_machine --series

./gen_kconfig_machine n2-standard

./gen_kconfig_machine --zone us-west2-a --series

The script uses the GCE REST API directly to match existing GCE
script patterns. It properly handles machine type series grouping
such as n2-standard and n2-highcpu, correctly identifies variants
like local SSD and bare metal configurations, and includes
appropriate architecture dependencies for x86_64 and arm64 platforms.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Similar to commit dab6b48 for OCI, add a Python script to
dynamically generate Linux OS image Kconfig configuration by
querying the Google Compute API for available Linux distributors
and their releases.

Usage:

cd terraform/gce/scripts
./gen_kconfig_image > ../kconfigs/Kconfig.image

./gen_kconfig_image --publishers

./gen_kconfig_image debian --format raw

The new script follows the same patterns as the AWS, Azure, and OCI
scripts but uses the GCE REST API directly with google-auth and
requests (as the existing gce_common.py module does) for better
distribution package availability.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This change enables dynamic GCE region, image, and machine type
discovery and Kconfig generation via "make cloud-config" or "make
cloud-config-gce".

The generate_gce_kconfig() function runs the existing scripts in
terraform/gce/scripts (gen_kconfig_image, gen_kconfig_location, and
gen_kconfig_machine) and writes their output to the generated Kconfig
files that are now sourced by terraform/gce/Kconfig.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
@chucklever chucklever merged commit f752039 into main Dec 23, 2025
20 of 22 checks passed
@chucklever chucklever deleted the cel/gce-dynamic-kconfig branch December 23, 2025 21:17
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.

2 participants