@@ -160,6 +160,16 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
160160 print(f"Priority class {priority_class} is not available in the cluster")
161161 return None
162162
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+
163173 def create_app_wrapper(self):
164174 """
165175 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>
175185 f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
176186 )
177187
188+ # Validate image configuration
189+ self.validate_image_config()
190+
178191 # Before attempting to create the cluster AW, let's evaluate the ClusterConfig
179192 if self.config.dispatch_priority:
180193 if not self.config.mcad:
@@ -1095,6 +1108,16 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10951108 print(f"Priority class {priority_class} is not available in the cluster")
10961109 return None
10971110
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+
10981121 def create_app_wrapper(self):
10991122 """
11001123 Called upon cluster object creation, creates an AppWrapper yaml based on
@@ -1110,6 +1133,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
11101133 f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
11111134 )
11121135
1136+ # Validate image configuration
1137+ self.validate_image_config()
1138+
11131139 # Before attempting to create the cluster AW, let's evaluate the ClusterConfig
11141140 if self.config.dispatch_priority:
11151141 if not self.config.mcad:
@@ -1650,6 +1676,9 @@ <h3>Methods</h3>
16501676 f"Namespace {self.config.namespace} is of type {type(self.config.namespace)}. Check your Kubernetes Authentication."
16511677 )
16521678
1679+ # Validate image configuration
1680+ self.validate_image_config()
1681+
16531682 # Before attempting to create the cluster AW, let's evaluate the ClusterConfig
16541683 if self.config.dispatch_priority:
16551684 if not self.config.mcad:
@@ -2088,6 +2117,28 @@ <h3>Methods</h3>
20882117 return _kube_api_error_handling(e)</ code > </ pre >
20892118</ details >
20902119</ 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 >
20912142< dt id ="codeflare_sdk.cluster.cluster.Cluster.wait_ready "> < code class ="name flex ">
20922143< span > def < span class ="ident "> wait_ready</ span > </ span > (< span > self, timeout: Optional[int] = None, dashboard_check: bool = True)</ span >
20932144</ code > </ dt >
@@ -2182,6 +2233,7 @@ <h4><code><a title="codeflare_sdk.cluster.cluster.Cluster" href="#codeflare_sdk.
21822233< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.torchx_config " href ="#codeflare_sdk.cluster.cluster.Cluster.torchx_config "> torchx_config</ a > </ code > </ li >
21832234< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler " href ="#codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler "> torchx_scheduler</ a > </ code > </ li >
21842235< 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 >
21852237< li > < code > < a title ="codeflare_sdk.cluster.cluster.Cluster.wait_ready " href ="#codeflare_sdk.cluster.cluster.Cluster.wait_ready "> wait_ready</ a > </ code > </ li >
21862238</ ul >
21872239</ li >
0 commit comments