https://garden.io logo
#🌱|help-and-getting-started
How to wait for build before deploying?
a

average-painter-87026

03/10/2023, 8:13 PM
I have a kubernetes module (
myservice
) which depends on an image that is built from a container module (
myimage
).
myservice
has
myimage
in it's build dependencies When I
garden deploy myservice
, it kicks off the build
myimage
and deploy
myservice
steps at the same time. Often,
myservice
will timeout while waiting for the build to finish. Is it possible to configure garden to not even start to deploy
myservice
until
myimage
is done building?
b

bright-policeman-43626

03/10/2023, 8:16 PM
Hey @average-painter-87026! By any chance are you using the built-in dependencies between those two modules? It seems like your myservice module needs to have an explicit dependency to your myimage one!
a

average-painter-87026

03/10/2023, 8:17 PM
no, I just have this in my myservice module:
Copy code
build:
   dependencies:
     name: myimage
so you think just adding
dependencies: [myimage]
would do it?
i shouldve tried that before bothering you guys haha
I thought that build.dependencies.name = myimage would do that implicitly
b

bright-policeman-43626

03/10/2023, 8:20 PM
I think adding that explicit dependency at the module level should help, do you mind giving it a try?✨
a

average-painter-87026

03/10/2023, 8:21 PM
doesn't seem to work, because myimage doesn't have a service attached to it (it's just for building the image)
Service 'myservice' (in  module 'myservice'): Unknown service or task 'myimage' referenced in dependencies
it's just like this:
Copy code
kind: Module
type: container
name: myimage
dockerfile: Dockerfile
b

bright-policeman-43626

03/10/2023, 11:28 PM
You are right, it should be enough with the build dependencies you added at first. Could you extend a little bit on what are you doing in your kubernetes module so I can try to reproduce the issue? Is it a single deployment manifest?
Hey @average-painter-87026 just checking back into this, where you able to solve this issue? Thanks a lot!
a

average-painter-87026

03/17/2023, 2:35 PM
Sorry for the delay, I started working on something else but am back using garden again. Will try to get you more info