@@ -59,15 +59,44 @@ func run(cmd *cobra.Command, args []string) error {
5959 if err != nil {
6060 return err
6161 }
62+ client := registry .NewRegistryClient ()
6263
6364 cfg , projectDir , err := config .GetConfig (configFilename )
6465 if err != nil {
6566 return err
6667 }
67- client := registry .NewRegistryClient ()
68- imageName , err := image .BuildBase (ctx , dockerClient , cfg , projectDir , buildUseCudaBaseImage , DetermineUseCogBaseImage (cmd ), buildProgressOutput , client )
69- if err != nil {
70- return err
68+
69+ var imageName string
70+ if cfg .Build .Fast || buildFast {
71+ imageName = config .DockerImageName (projectDir )
72+ err = image .Build (
73+ ctx ,
74+ cfg ,
75+ projectDir ,
76+ imageName ,
77+ buildSecrets ,
78+ buildNoCache ,
79+ buildSeparateWeights ,
80+ buildUseCudaBaseImage ,
81+ buildProgressOutput ,
82+ buildSchemaFile ,
83+ buildDockerfileFile ,
84+ DetermineUseCogBaseImage (cmd ),
85+ buildStrip ,
86+ buildPrecompile ,
87+ cfg .Build .Fast || buildFast ,
88+ nil ,
89+ buildLocalImage ,
90+ dockerClient ,
91+ client )
92+ if err != nil {
93+ return err
94+ }
95+ } else {
96+ imageName , err = image .BuildBase (ctx , dockerClient , cfg , projectDir , buildUseCudaBaseImage , DetermineUseCogBaseImage (cmd ), buildProgressOutput , client )
97+ if err != nil {
98+ return err
99+ }
71100 }
72101
73102 gpus := ""
@@ -102,10 +131,6 @@ func run(cmd *cobra.Command, args []string) error {
102131 console .Info ("" )
103132 console .Infof ("Running '%s' in Docker with the current directory mounted as a volume..." , strings .Join (args , " " ))
104133
105- if buildFast {
106- console .Info ("Fast run enabled." )
107- }
108-
109134 err = docker .Run (ctx , dockerClient , runOptions )
110135 // Only retry if we're using a GPU but but the user didn't explicitly select a GPU with --gpus
111136 // If the user specified the wrong GPU, they are explicitly selecting a GPU and they'll want to hear about it
0 commit comments