@@ -52,12 +52,16 @@ def start(
5252 jupyter_port : int = typer .Option (
5353 8895 , "--jupyter-port" , "-j" , help = "Port for JupyterLab"
5454 ),
55- delete_volume : bool = typer .Option (
56- False , "--delete-volume" , "-v" , help = "Delete volumes on shutdown"
57- ),
5855 docker_build : bool = typer .Option (
5956 False , "--docker-build" , "-b" , help = "Force Docker image build"
6057 ),
58+ user_env_name : str = typer .Option (
59+ None , "--env" , "-e" , help = "Provide conda/mamba environment name for "
60+ "Jupyter Lab to run. If not set, it will use the name from your environment.yml file."
61+ ),
62+ env_tool : "str" = typer .Option (
63+ "mamba" , "--env-tool" , "-t" , help = "Which tool to use for running your Jupyter lab. Options: mamba, conda" ,
64+ ),
6165):
6266 imports = load_imports ()
6367 typer .echo (f"Selected Gaiaflow services: { service } " )
@@ -84,8 +88,9 @@ def start(
8488 service = s ,
8589 cache = cache ,
8690 jupyter_port = jupyter_port ,
87- delete_volume = delete_volume ,
8891 docker_build = docker_build ,
92+ user_env_name = user_env_name ,
93+ env_tool = env_tool ,
8994 )
9095 else :
9196 typer .echo ("Running start with all services" )
@@ -97,8 +102,9 @@ def start(
97102 service = Service .all ,
98103 cache = cache ,
99104 jupyter_port = jupyter_port ,
100- delete_volume = delete_volume ,
101105 docker_build = docker_build ,
106+ user_env_name = user_env_name ,
107+ env_tool = env_tool ,
102108 )
103109
104110
@@ -265,8 +271,31 @@ def dockerize(
265271 image_name = image_name
266272 )
267273
274+ @app .command (help = "Update the dependencies for the Airflow tasks. This command "
275+ "synchronizes the running container environments with the project's"
276+ "`environment.yml`. Make sure you have updated "
277+ "`environment.yml` before running"
278+ "this, as the container environments are updated based on "
279+ "its contents." )
280+ def update_deps (
281+ project_path : Path = typer .Option (..., "--path" , "-p" , help = "Path to your project" ),
282+ ):
283+ imports = load_imports ()
284+ gaiaflow_path , user_project_path = imports .create_gaiaflow_context_path (
285+ project_path
286+ )
287+ gaiaflow_path_exists = imports .gaiaflow_path_exists_in_state (gaiaflow_path , True )
288+ if not gaiaflow_path_exists :
289+ imports .save_project_state (user_project_path , gaiaflow_path )
290+ else :
291+ typer .echo (
292+ f"Gaiaflow project already exists at { gaiaflow_path } . Skipping "
293+ f"saving to the state"
294+ )
268295
269-
270- # TODO: To let the user update the current infra with new local packages or
271- # mounts as they want it.
272- # def update():
296+ typer .echo ("Running update_deps" )
297+ imports .MlopsManager .run (
298+ gaiaflow_path = gaiaflow_path ,
299+ user_project_path = user_project_path ,
300+ action = imports .ExtendedAction .UPDATE_DEPS ,
301+ )
0 commit comments