Repository navigation
|
I already build, tag and push a base (vanilla--no github hooks) Dockerfile image to ECR using semantic version and hash tags to manage automated rebuilds. This ECR image is then used as the basis to build a github injected image for an EcsRunnerProvider. Base image builds and pushes are done using bash scripts, but I want base image changes to be managed (built, tagged and pushed) in CDK/Cloudsnorkel. I have tried DockerImageAsset but we need multi-architecture images--this is unreliable. I have tried codebuild.Project but the complexity of coordinating base image build completion with a later EcsRunnerProvider build image is untenable (I don't want to write a step function, which cloudsnorkel already does). My next question is can the cloudsnorkel framework handle this? I have been looking at CodeBuildImageBuilder, but it injects github hooks. Is there a way I could disable that feature for my specific use case? The use case of building a base, vanilla image that is later used by runner image builders would seem to be typical, not a corner case. Can someone suggest another way to leverage how I could use the existing cloudsnorkel image building framework to achieve a base image build (no github hooks) that is then used by the runner provider image build to inject github hooks? Here's a snippet of my cdk app.py: |
Replies: 1 comment 2 replies
|
One way that comes to mind is to factor out the vanilla base image codebuild.Project to a separate cdk app/stack, away from the cloudsnorkel runners stack. The base image app/stack would create an SSM ECR parameter that the runners stack would use to build the github injected image. The github workflow (ci) would use one job for the base image build and start the codebuild project/wait for it and a dependent job for the runner build. This effectively refactors the runner github injection image build wait for image builds from cdk/cloudsnorkel to the github workflow. Is there a simpler way I am overlooking? |
I think you're describing what I would suggest.
rebuild_intervalto zero to disable automatic rebuilds.base_docker_imagetoBaseContainerImage.from_ecr()image_builder.node.find_child('CodeBuild').project_arnIf this is a common ask, we can find a more CDK way of doing number 4.