3030
3131from scripts .invocations .common import MINIKUBE_PROFILE , check_env_tools , get_docker_env , get_host_env
3232
33- KUBE_VERSION = os .environ .get ("INVOKE_KUBE_VERSION" , "v1.25.7 " )
33+ KUBE_VERSION = os .environ .get ("INVOKE_KUBE_VERSION" , "v1.29 " )
3434NAMESPACE = "datakitchen"
3535HELM_SVC_FOLDER = os .path .join ("deploy" , "charts" , "observability-services" )
3636HELM_APP_FOLDER = os .path .join ("deploy" , "charts" , "observability-app" )
@@ -273,7 +273,7 @@ def helm_services(ctx, upgrade=False, template=False, atomic=False, timeout=None
273273 ("backend" , "Builds only the Observability backend image" ),
274274 ("ui" , "Builds only the Observability UI image" ),
275275 ("base-image-url" , "Base image prefix. Useful to enable a dependency proxy" ),
276- ("local " , "Use the local docker instead of minikube's ." ),
276+ ("load " , "Loads the image into the current minikube profile ." ),
277277 )
278278 ),
279279)
@@ -284,7 +284,7 @@ def build(
284284 tag = "latest" ,
285285 no_cache = False ,
286286 base_image_url = None ,
287- local = False ,
287+ load = False ,
288288):
289289 """
290290 Build Observability's images inside the minikube instance.
@@ -296,9 +296,6 @@ def build(
296296 backend = True
297297 ui = True
298298
299- # "minikube image build" support for build-arg is clunky, using the docker CLI instead
300- env = {} if local else get_docker_env (ctx )
301-
302299 args_str = ""
303300 if no_cache :
304301 args_str += "--no-cache "
@@ -307,17 +304,21 @@ def build(
307304 args_str += f"--build-arg BASE_IMAGE_URL={ base_image_url } "
308305
309306 if backend :
307+ be_tag = f"observability-be:{ tag } "
310308 ctx .run (
311309 f"docker build . { args_str } --build-arg tag={ tag } "
312- f"-t 'observability-be:{ tag } ' -f ./deploy/docker/observability-be.dockerfile" ,
313- env = env ,
310+ f"-t '{ be_tag } ' -f ./deploy/docker/observability-be.dockerfile" ,
314311 )
312+ if load :
313+ ctx .run (f"minikube image load --daemon { be_tag } " , echo = True )
315314
316315 if ui :
316+ ui_tag = f"observability-ui:{ tag } "
317317 ctx .run (
318- f"docker build . { args_str } " f"-t 'observability-ui:{ tag } ' -f ./deploy/docker/observability-ui.dockerfile" ,
319- env = env ,
318+ f"docker build . { args_str } " f"-t '{ ui_tag } ' -f ./deploy/docker/observability-ui.dockerfile" ,
320319 )
320+ if load :
321+ ctx .run (f"minikube image load --daemon { ui_tag } " , echo = True )
321322
322323
323324@task (
@@ -419,7 +420,7 @@ def local(ctx, values="", driver=None, memory=None, cpus=None, base_image_url=""
419420 Required tools: docker, helm, minikube
420421 """
421422 minikube (ctx , driver = driver , memory = memory , cpus = cpus )
422- build (ctx , base_image_url = base_image_url )
423+ build (ctx , base_image_url = base_image_url , load = True )
423424 helm_build (ctx )
424425 helm_services (ctx , timeout = "10m" )
425426 helm_app (ctx , timeout = "10m" )
0 commit comments