I'm trying to build docker images using an interme...
# typescript
a
I'm trying to build docker images using an intermediary builder image. But even though I make the builder image a
dependsOn
dependency of the other images, Pulumi doesn't wait to build the other images until the builder is done, instead tries to run them in parallel and of course fails for the other images. I can't see what I'm doing wrong - anyone any idea? I'll attach code-snippets of the relevant pulumi code passage and the dockerfiles in the thread
now I can move creating the builder outside of Pulumi to workaround this, but I'd really rather not.
q
Can you run
pulumi stack graph stack.dot
to save a graphviz visualisation of your dependency graph
This may help you debug this
a
q
Yeah, there's no dependencies here.
Are you open to jumping on a Zoom and sharing your screen?
a
yeah, just let me get zoom
Whenever you're ready, no rush
a
now I got zoom, what is your email so I can invite you?
q
Click the link ^^
a
ah
q
I think your connection dropped
a
aha, I got some network issues, slack doesn't send either
aha,back, but I gotta go into my daily for a few minutes, I'll call you bakc
q
OK. We can pick up when you have time 👍
a
back
please send me a new meeting, the old one seems to have ended/timeouted
I think I found another workaround. Lemme just see whether it runs through, if it does, I'll explain.
yes, that works.
here's what I do: before, the service images depended on the image via dependsOn. now I changed the dockerfiles of the services to take the builder image as an argument. in pulumi, I removed the dependsOn, but added an arg that takes the builder image's imageName output and splits away the auto-generated tag (because with it, docker build fails). now pulumi waits until the builder image is done before starting to build the service images.
for reference, I'll attach the relevant code portions again
I still don't get why the other way didn't work - it seems like the much more straightforward strategy -, but this one does and lets me keep things inside Pulumi.
the dependency graph now looks correct, too, btw.
q
Sorry, I was on a call with another community member. I'm glad you got it working 🎉
a
no worries 🙂
you are a very helpful guy, btw
❤️ 1
q
Always happy to help. Ping me anytime you get stuck 💯
a
another, unrelated question: does Pulumi offer something like a sort of code-review session? the idea would be that we'd show you how we've setup our pipelines with Pulumi and, in our case, Azure DevOps, you look at it and then tell us if you find anything that could be done better, be that runtime-faster, be that refactoring away some boilerplate etc. and if there is such a possibility, what would be the price range and how would we get in touch with you guys about this?
q
I believe you can reach out to our sales team and they would put you in touch with a customer engineer
a
ah, so this kind of service does exist! perfect! thank you!