@@ -185,10 +185,10 @@ def copy_local_registry_certs(host: host.Host, path: str) -> None:
185
185
host .copy_to (f"{ directory } /{ file } " , f"{ path } /{ file } " )
186
186
187
187
188
- def build_dpu_operator_images () -> str :
188
+ def build_dpu_operator_images (repo : str , branch : str ) -> str :
189
189
logger .info ("Building dpu operator images" )
190
190
lh = host .LocalHost ()
191
- git_repo_setup (REPO_DIR , repo_wipe = True , url = DPU_OPERATOR_REPO , branch = "main" )
191
+ git_repo_setup (REPO_DIR , repo_wipe = True , url = repo , branch = branch )
192
192
update_dockerfiles_with_ose_images (REPO_DIR )
193
193
194
194
# Start a local registry to store dpu-operator images
@@ -201,11 +201,11 @@ def build_dpu_operator_images() -> str:
201
201
return registry
202
202
203
203
204
- def start_dpu_operator (h : host .Host , client : K8sClient , repo_wipe : bool = False ) -> None :
204
+ def start_dpu_operator (h : host .Host , client : K8sClient , repo_wipe : bool = False , repo : str = DPU_OPERATOR_REPO , branch : str = "main" ) -> None :
205
205
logger .info (f"Deploying dpu operator containers on { h .hostname ()} " )
206
206
if repo_wipe :
207
207
h .run (f"rm -rf { REPO_DIR } " )
208
- h .run_or_die (f"git clone { DPU_OPERATOR_REPO } " )
208
+ h .run_or_die (f"git clone --branch { branch } { repo } { REPO_DIR } " )
209
209
210
210
REGISTRY = host .LocalHost ().hostname ()
211
211
h .run ("dnf install -y pip" )
@@ -240,7 +240,7 @@ def ExtraConfigDpu(cc: ClustersConfig, cfg: ExtraConfigArgs, futures: dict[str,
240
240
client = K8sClient (MICROSHIFT_KUBECONFIG , acc )
241
241
242
242
if cfg .rebuild_dpu_operators_images :
243
- registry = build_dpu_operator_images ()
243
+ registry = build_dpu_operator_images (repo = cfg . dpu_operator_repo , branch = cfg . dpu_operator_branch )
244
244
else :
245
245
logger .info ("Will not rebuild dpu-operator images" )
246
246
registry = _ensure_local_registry_running (lh , delete_all = False )
@@ -257,7 +257,7 @@ def ExtraConfigDpu(cc: ClustersConfig, cfg: ExtraConfigArgs, futures: dict[str,
257
257
acc .run_or_die (cmd )
258
258
vendor_plugin .build_and_start (acc , client , registry )
259
259
260
- start_dpu_operator (acc , client , repo_wipe = True )
260
+ start_dpu_operator (acc , client , repo_wipe = True , repo = cfg . dpu_operator_repo , branch = cfg . dpu_operator_branch )
261
261
262
262
# Disable firewall to ensure host-side can reach dpu
263
263
acc .run ("systemctl stop firewalld" )
@@ -293,7 +293,7 @@ def ExtraConfigDpuHost(cc: ClustersConfig, cfg: ExtraConfigArgs, futures: dict[s
293
293
client = K8sClient (cc .kubeconfig )
294
294
295
295
if cfg .rebuild_dpu_operators_images :
296
- registry = build_dpu_operator_images ()
296
+ registry = build_dpu_operator_images (repo = cfg . dpu_operator_repo , branch = cfg . dpu_operator_branch )
297
297
else :
298
298
logger .info ("Will not rebuild dpu-operator images" )
299
299
registry = _ensure_local_registry_running (lh , delete_all = False )
@@ -306,7 +306,7 @@ def ExtraConfigDpuHost(cc: ClustersConfig, cfg: ExtraConfigArgs, futures: dict[s
306
306
vendor_plugin = init_vendor_plugin (h )
307
307
vendor_plugin .build_and_start (lh , client , registry )
308
308
309
- start_dpu_operator (lh , client )
309
+ start_dpu_operator (lh , client , repo_wipe = False , repo = cfg . dpu_operator_repo , branch = cfg . dpu_operator_branch )
310
310
311
311
def helper (h : host .Host , node : NodeConfig ) -> Optional [host .Result ]:
312
312
# Temporary workaround, remove once 4.16 installations are working
0 commit comments