@@ -160,6 +160,16 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
160
160
print(f"Priority class {priority_class} is not available in the cluster")
161
161
return None
162
162
163
+ def validate_image_config(self):
164
+ """
165
+ Validates that the image configuration is not empty.
166
+
167
+ :param image: The image string to validate
168
+ :raises ValueError: If the image is not specified
169
+ """
170
+ if self.config.image == "" or self.config.image == None:
171
+ raise ValueError("Image must be specified in the ClusterConfiguration")
172
+
163
173
def create_app_wrapper(self):
164
174
"""
165
175
Called upon cluster object creation, creates an AppWrapper yaml based on
@@ -175,6 +185,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
175
185
f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
176
186
)
177
187
188
+ # Validate image configuration
189
+ self.validate_image_config()
190
+
178
191
# Before attempting to create the cluster AW, let's evaluate the ClusterConfig
179
192
if self.config.dispatch_priority:
180
193
if not self.config.mcad:
@@ -1095,6 +1108,16 @@ <h2 class="section-title" id="header-classes">Classes</h2>
1095
1108
print(f"Priority class {priority_class} is not available in the cluster")
1096
1109
return None
1097
1110
1111
+ def validate_image_config(self):
1112
+ """
1113
+ Validates that the image configuration is not empty.
1114
+
1115
+ :param image: The image string to validate
1116
+ :raises ValueError: If the image is not specified
1117
+ """
1118
+ if self.config.image == "" or self.config.image == None:
1119
+ raise ValueError("Image must be specified in the ClusterConfiguration")
1120
+
1098
1121
def create_app_wrapper(self):
1099
1122
"""
1100
1123
Called upon cluster object creation, creates an AppWrapper yaml based on
@@ -1110,6 +1133,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
1110
1133
f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
1111
1134
)
1112
1135
1136
+ # Validate image configuration
1137
+ self.validate_image_config()
1138
+
1113
1139
# Before attempting to create the cluster AW, let's evaluate the ClusterConfig
1114
1140
if self.config.dispatch_priority:
1115
1141
if not self.config.mcad:
@@ -1650,6 +1676,9 @@ <h3>Methods</h3>
1650
1676
f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
1651
1677
)
1652
1678
1679
+ # Validate image configuration
1680
+ self.validate_image_config()
1681
+
1653
1682
# Before attempting to create the cluster AW, let's evaluate the ClusterConfig
1654
1683
if self.config.dispatch_priority:
1655
1684
if not self.config.mcad:
@@ -2088,6 +2117,28 @@ <h3>Methods</h3>
2088
2117
return _kube_api_error_handling(e)</ code > </ pre >
2089
2118
</ details >
2090
2119
</ dd >
2120
+ < dt id ="codeflare_sdk.cluster.cluster.Cluster.validate_image_config "> < code class ="name flex ">
2121
+ < span > def < span class ="ident "> validate_image_config</ span > </ span > (< span > self)</ span >
2122
+ </ code > </ dt >
2123
+ < dd >
2124
+ < div class ="desc "> < p > Validates that the image configuration is not empty.</ p >
2125
+ < p > :param image: The image string to validate
2126
+ :raises ValueError: If the image is not specified</ p > </ div >
2127
+ < details class ="source ">
2128
+ < summary >
2129
+ < span > Expand source code</ span >
2130
+ </ summary >
2131
+ < pre > < code class ="python "> def validate_image_config(self):
2132
+ """
2133
+ Validates that the image configuration is not empty.
2134
+
2135
+ :param image: The image string to validate
2136
+ :raises ValueError: If the image is not specified
2137
+ """
2138
+ if self.config.image == "" or self.config.image == None:
2139
+ raise ValueError("Image must be specified in the ClusterConfiguration")</ code > </ pre >
2140
+ </ details >
2141
+ </ dd >
2091
2142
< dt id ="codeflare_sdk.cluster.cluster.Cluster.wait_ready "> < code class ="name flex ">
2092
2143
< span > def < span class ="ident "> wait_ready</ span > </ span > (< span > self, timeout: Optional[int] = None, dashboard_check: bool = True)</ span >
2093
2144
</ code > </ dt >
@@ -2182,6 +2233,7 @@ <h4><code><a title="codeflare_sdk.cluster.cluster.Cluster" href="#codeflare_sdk.
2182
2233
< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.torchx_config " href ="#codeflare_sdk.cluster.cluster.Cluster.torchx_config "> torchx_config</ a > </ code > </ li >
2183
2234
< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler " href ="#codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler "> torchx_scheduler</ a > </ code > </ li >
2184
2235
< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.up " href ="#codeflare_sdk.cluster.cluster.Cluster.up "> up</ a > </ code > </ li >
2236
+ < li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.validate_image_config " href ="#codeflare_sdk.cluster.cluster.Cluster.validate_image_config "> validate_image_config</ a > </ code > </ li >
2185
2237
< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.wait_ready " href ="#codeflare_sdk.cluster.cluster.Cluster.wait_ready "> wait_ready</ a > </ code > </ li >
2186
2238
</ ul >
2187
2239
</ li >
0 commit comments