@@ -208,30 +208,31 @@ def build_dpu_operator_images() -> str:
208
208
return registry
209
209
210
210
211
- def start_dpu_operator (host : host .Host , client : K8sClient , operator_image : str , daemon_image : str , repo_wipe : bool = False ) -> None :
212
- logger .info (f"Deploying dpu operator containers on { host .hostname ()} " )
211
+ def start_dpu_operator (h : host .Host , client : K8sClient , operator_image : str , daemon_image : str , repo_wipe : bool = False ) -> None :
212
+ logger .info (f"Deploying dpu operator containers on { h .hostname ()} " )
213
213
if repo_wipe :
214
- host .run (f"rm -rf { REPO_DIR } " )
215
- host .run_or_die (f"git clone { DPU_OPERATOR_REPO } " )
214
+ h .run (f"rm -rf { REPO_DIR } " )
215
+ h .run_or_die (f"git clone { DPU_OPERATOR_REPO } " )
216
216
render_local_images_yaml (operator_image = operator_image , daemon_image = daemon_image , outfilename = "/tmp/dpu-local-images-template.yaml" , pull_policy = "IfNotPresent" )
217
- host .copy_to ("/tmp/dpu-local-images-template.yaml" , f"{ REPO_DIR } /config/dev/local-images-template.yaml" )
218
-
219
- host .run ("dnf install -y pip" )
220
- host .run_or_die ("pip install yq" )
221
- ensure_go_installed (host )
222
- reglocal .local_trust (host )
223
- host .run_or_die (f"podman pull { operator_image } " )
224
- host .run_or_die (f"podman pull { daemon_image } " )
225
- if host .is_localhost ():
217
+ h .copy_to ("/tmp/dpu-local-images-template.yaml" , f"{ REPO_DIR } /config/dev/local-images-template.yaml" )
218
+
219
+ h .run ("dnf install -y pip" )
220
+ h .run_or_die ("pip install yq" )
221
+ ensure_go_installed (h )
222
+ reglocal .local_trust (h )
223
+ h .run_or_die (f"podman pull { operator_image } " )
224
+ h .run_or_die (f"podman pull { daemon_image } " )
225
+ if h .is_localhost ():
226
226
env = os .environ .copy ()
227
227
env ["KUBECONFIG" ] = client ._kc
228
- host .run (f"make -C { REPO_DIR } undeploy" , env = env )
229
- ret = host .run (f"make -C { REPO_DIR } local-deploy" , env = env )
228
+ env ["REGISTRY" ] = host .LocalHost ().hostname ()
229
+ h .run (f"make -C { REPO_DIR } undeploy" , env = env )
230
+ ret = h .run (f"make -C { REPO_DIR } local-deploy" , env = env )
230
231
if not ret .success ():
231
232
logger .error_and_exit ("Failed to deploy dpu operator" )
232
233
else :
233
- host .run (f"cd { REPO_DIR } && export KUBECONFIG={ client ._kc } && make undeploy" )
234
- host .run_or_die (f"cd { REPO_DIR } && export KUBECONFIG={ client ._kc } && make local-deploy" )
234
+ h .run (f"cd { REPO_DIR } && export KUBECONFIG={ client ._kc } && make undeploy" )
235
+ h .run_or_die (f"cd { REPO_DIR } && export KUBECONFIG={ client ._kc } && make local-deploy" )
235
236
logger .info ("Waiting for all dpu operator pods to become ready" )
236
237
time .sleep (30 )
237
238
client .oc_run_or_die ("wait --for=condition=Ready pod --all -n openshift-dpu-operator --timeout=5m" )
0 commit comments