Skip to content

Commit aa7ff44

Browse files
committed
datacrunch: convert to .default scheme for consistency
Previously, DataCrunch had its .generated files tracked directly in git. This worked for fresh clones but meant that running 'make cloud-config' would cause the files to show as modified in git status. This converts DataCrunch to use the same .default scheme as the other cloud providers. The .generated files are now gitignored, and .default files provide the sensible static defaults. The Makefile copies from .default to .generated if the generated files don't exist. This makes DataCrunch consistent with Lambda Labs, AWS, Azure, and OCI, and prevents git pollution after regenerating from the API. Generated-by: Claude AI Signed-off-by: Chuck Lever <cel@kernel.org>
1 parent fa582f9 commit aa7ff44

File tree

5 files changed

+47
-13
lines changed

5 files changed

+47
-13
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ archive/
112112
nixos/generated/
113113

114114
# Dyanmic cloud kconfig files
115+
terraform/datacrunch/kconfigs/Kconfig.compute.generated
116+
terraform/datacrunch/kconfigs/Kconfig.images.generated
117+
terraform/datacrunch/kconfigs/Kconfig.location.generated
118+
115119
terraform/lambdalabs/kconfigs/Kconfig.compute.generated
116120
terraform/lambdalabs/kconfigs/Kconfig.compute.mappings
117121
terraform/lambdalabs/kconfigs/Kconfig.images.generated

scripts/dynamic-cloud-kconfig.Makefile

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,21 @@ OCI_KCONFIG_SHAPE_DEFAULT := $(OCI_KCONFIG_DIR)/Kconfig.shape.default
5656

5757
OCI_KCONFIGS := $(OCI_KCONFIG_IMAGE) $(OCI_KCONFIG_LOCATION) $(OCI_KCONFIG_SHAPE)
5858

59+
# DataCrunch dynamic configuration
60+
DATACRUNCH_KCONFIG_DIR := terraform/datacrunch/kconfigs
61+
DATACRUNCH_KCONFIG_COMPUTE := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.compute.generated
62+
DATACRUNCH_KCONFIG_IMAGES := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.images.generated
63+
DATACRUNCH_KCONFIG_LOCATION := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.location.generated
64+
65+
# DataCrunch default files (tracked in git, provide sensible defaults)
66+
DATACRUNCH_KCONFIG_COMPUTE_DEFAULT := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.compute.default
67+
DATACRUNCH_KCONFIG_IMAGES_DEFAULT := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.images.default
68+
DATACRUNCH_KCONFIG_LOCATION_DEFAULT := $(DATACRUNCH_KCONFIG_DIR)/Kconfig.location.default
69+
70+
DATACRUNCH_KCONFIGS := $(DATACRUNCH_KCONFIG_COMPUTE) $(DATACRUNCH_KCONFIG_IMAGES) $(DATACRUNCH_KCONFIG_LOCATION)
71+
5972
# Add generated files to mrproper clean list
60-
KDEVOPS_MRPROPER += $(LAMBDALABS_KCONFIGS) $(AWS_KCONFIGS) $(AZURE_KCONFIGS) $(OCI_KCONFIGS)
73+
KDEVOPS_MRPROPER += $(LAMBDALABS_KCONFIGS) $(AWS_KCONFIGS) $(AZURE_KCONFIGS) $(OCI_KCONFIGS) $(DATACRUNCH_KCONFIGS)
6174

6275
# Ensure Lambda Labs generated files exist with sensible defaults
6376
# Copies from .default files if .generated files don't exist
@@ -87,11 +100,18 @@ dynamic_oci_kconfig_touch:
87100
$(Q)test -f $(OCI_KCONFIG_LOCATION) || cp $(OCI_KCONFIG_LOCATION_DEFAULT) $(OCI_KCONFIG_LOCATION)
88101
$(Q)test -f $(OCI_KCONFIG_SHAPE) || cp $(OCI_KCONFIG_SHAPE_DEFAULT) $(OCI_KCONFIG_SHAPE)
89102

90-
DYNAMIC_KCONFIG += dynamic_lambdalabs_kconfig_touch dynamic_aws_kconfig_touch dynamic_azure_kconfig_touch dynamic_oci_kconfig_touch
103+
# Ensure DataCrunch generated files exist with sensible defaults
104+
# Copies from .default files if .generated files don't exist
105+
dynamic_datacrunch_kconfig_touch:
106+
$(Q)test -f $(DATACRUNCH_KCONFIG_COMPUTE) || cp $(DATACRUNCH_KCONFIG_COMPUTE_DEFAULT) $(DATACRUNCH_KCONFIG_COMPUTE)
107+
$(Q)test -f $(DATACRUNCH_KCONFIG_IMAGES) || cp $(DATACRUNCH_KCONFIG_IMAGES_DEFAULT) $(DATACRUNCH_KCONFIG_IMAGES)
108+
$(Q)test -f $(DATACRUNCH_KCONFIG_LOCATION) || cp $(DATACRUNCH_KCONFIG_LOCATION_DEFAULT) $(DATACRUNCH_KCONFIG_LOCATION)
109+
110+
DYNAMIC_KCONFIG += dynamic_lambdalabs_kconfig_touch dynamic_aws_kconfig_touch dynamic_azure_kconfig_touch dynamic_oci_kconfig_touch dynamic_datacrunch_kconfig_touch
91111

92112
# User-facing target to populate cloud kconfigs with defaults
93113
# This is called automatically before menuconfig, but can be run manually
94-
default-cloud-kconfigs: dynamic_lambdalabs_kconfig_touch dynamic_aws_kconfig_touch dynamic_azure_kconfig_touch dynamic_oci_kconfig_touch
114+
default-cloud-kconfigs: dynamic_lambdalabs_kconfig_touch dynamic_aws_kconfig_touch dynamic_azure_kconfig_touch dynamic_oci_kconfig_touch dynamic_datacrunch_kconfig_touch
95115

96116
# Lambda Labs targets use --provider argument for efficiency
97117
cloud-config-lambdalabs:
@@ -109,6 +129,10 @@ cloud-config-azure:
109129
cloud-config-oci:
110130
$(Q)python3 scripts/generate_cloud_configs.py --provider oci
111131

132+
# DataCrunch targets use --provider argument for efficiency
133+
cloud-config-datacrunch:
134+
$(Q)python3 scripts/generate_cloud_configs.py --provider datacrunch
135+
112136
# Clean Lambda Labs generated files
113137
clean-cloud-config-lambdalabs:
114138
$(Q)rm -f $(LAMBDALABS_KCONFIGS)
@@ -125,25 +149,30 @@ clean-cloud-config-azure:
125149
clean-cloud-config-oci:
126150
$(Q)rm -f $(OCI_KCONFIGS)
127151

128-
DYNAMIC_CLOUD_KCONFIG += cloud-config-lambdalabs cloud-config-aws cloud-config-azure cloud-config-oci
152+
# Clean DataCrunch generated files
153+
clean-cloud-config-datacrunch:
154+
$(Q)rm -f $(DATACRUNCH_KCONFIGS)
155+
156+
DYNAMIC_CLOUD_KCONFIG += cloud-config-lambdalabs cloud-config-aws cloud-config-azure cloud-config-oci cloud-config-datacrunch
129157

130158
cloud-config-help:
131159
@echo "Cloud-specific dynamic kconfig targets:"
132-
@echo "default-cloud-kconfigs - populate cloud kconfigs with defaults (auto-runs before menuconfig)"
133-
@echo "cloud-config - regenerate cloud kconfigs from live API data"
134-
@echo "cloud-config-lambdalabs - generates Lambda Labs dynamic kconfig content"
135-
@echo "cloud-config-aws - generates AWS dynamic kconfig content"
136-
@echo "cloud-config-azure - generates Azure dynamic kconfig content"
137-
@echo "cloud-config-oci - generates OCI dynamic kconfig content"
138-
@echo "clean-cloud-config - removes all generated cloud kconfig files"
139-
@echo "cloud-list-all - list all cloud instances for configured provider"
160+
@echo "default-cloud-kconfigs - populate cloud kconfigs with defaults (auto-runs before menuconfig)"
161+
@echo "cloud-config - regenerate cloud kconfigs from live API data"
162+
@echo "cloud-config-lambdalabs - generates Lambda Labs dynamic kconfig content"
163+
@echo "cloud-config-aws - generates AWS dynamic kconfig content"
164+
@echo "cloud-config-azure - generates Azure dynamic kconfig content"
165+
@echo "cloud-config-oci - generates OCI dynamic kconfig content"
166+
@echo "cloud-config-datacrunch - generates DataCrunch dynamic kconfig content"
167+
@echo "clean-cloud-config - removes all generated cloud kconfig files"
168+
@echo "cloud-list-all - list all cloud instances for configured provider"
140169

141170
HELP_TARGETS += cloud-config-help
142171

143172
cloud-config:
144173
$(Q)python3 scripts/generate_cloud_configs.py
145174

146-
clean-cloud-config: clean-cloud-config-lambdalabs clean-cloud-config-aws clean-cloud-config-azure clean-cloud-config-oci
175+
clean-cloud-config: clean-cloud-config-lambdalabs clean-cloud-config-aws clean-cloud-config-azure clean-cloud-config-oci clean-cloud-config-datacrunch
147176
$(Q)echo "Cleaned all cloud provider dynamic Kconfig files."
148177

149178
cloud-list-all:
@@ -153,5 +182,6 @@ cloud-list-all:
153182
PHONY += cloud-config clean-cloud-config cloud-config-help cloud-list-all default-cloud-kconfigs
154183
PHONY += cloud-config-aws clean-cloud-config-aws
155184
PHONY += cloud-config-azure clean-cloud-config-azure
185+
PHONY += cloud-config-datacrunch clean-cloud-config-datacrunch
156186
PHONY += cloud-config-lambdalabs clean-cloud-config-lambdalabs
157187
PHONY += cloud-config-oci clean-cloud-config-oci

terraform/datacrunch/kconfigs/Kconfig.compute.generated renamed to terraform/datacrunch/kconfigs/Kconfig.compute.default

File renamed without changes.
File renamed without changes.

terraform/datacrunch/kconfigs/Kconfig.location.generated renamed to terraform/datacrunch/kconfigs/Kconfig.location.default

File renamed without changes.

0 commit comments

Comments
 (0)