@@ -388,20 +388,20 @@ def package_dataset(hf_dataset_id: str = typer.Option("", help="The repository I
388388@cmd_app .command ("build" , help = "This builds an OCI-compliant image to containerise CMS" )
389389def build_image (dockerfile_path : str = typer .Option (..., help = "The path to the Dockerfile" ),
390390 context_dir : str = typer .Option (..., help = "The directory containing the set of files accessible to the build" ),
391- model_name : Optional [ str ] = typer .Option ("cms_model " , help = "The string representation of the model name" ),
392- user_id : Optional [ int ] = typer .Option (1000 , help = "The ID for the non-root user" ),
393- group_id : Optional [ int ] = typer .Option (1000 , help = "The group ID for the non-root user" ),
394- http_proxy : Optional [ str ] = typer .Option ("" , help = "The string representation of the HTTP proxy" ),
395- https_proxy : Optional [ str ] = typer .Option ("" , help = "The string representation of the HTTPS proxy" ),
396- no_proxy : Optional [ str ] = typer .Option ("localhost,127.0.0.1" , help = "The string representation of addresses by-passing proxies" ),
397- tag : str = typer .Option (None , help = "The tag of the built image" ),
398- backend : Optional [ BuildBackend ] = typer .Option (BuildBackend .DOCKER , help = "The backend used for building the image" )) -> None :
391+ model_name : str = typer .Option ("CMS model " , help = "The string representation of the model name" ),
392+ user_id : int = typer .Option (1000 , help = "The ID for the non-root user" ),
393+ group_id : int = typer .Option (1000 , help = "The group ID for the non-root user" ),
394+ http_proxy : str = typer .Option ("" , help = "The string representation of the HTTP proxy" ),
395+ https_proxy : str = typer .Option ("" , help = "The string representation of the HTTPS proxy" ),
396+ no_proxy : str = typer .Option ("localhost,127.0.0.1" , help = "The string representation of addresses by-passing proxies" ),
397+ version_tag : str = typer .Option ("latest" , help = "The version tag of the built image" ),
398+ backend : BuildBackend = typer .Option (BuildBackend .DOCKER . value , help = "The backend used for building the image" )) -> None :
399399 assert backend is not None
400400 cmd = [
401401 * backend .value .split (),
402402 '-f' , dockerfile_path ,
403403 '--progress=plain' ,
404- '-t' , f'{ model_name } :{ tag } ' ,
404+ '-t' , f'{ model_name . replace ( " " , "-" ). lower () } :{ version_tag } ' ,
405405 '--build-arg' , f'CMS_MODEL_NAME={ model_name } ' ,
406406 '--build-arg' , f'CMS_UID={ str (user_id )} ' ,
407407 '--build-arg' , f'CMS_GID={ str (group_id )} ' ,
0 commit comments