distribution/ folder, and deploys the AWS side. The track machines then pull, on their own schedule.
This page is how a change ships. For what the deployed cloud resources then do with a run, see DAQ Upload and Conversion.
Two Stages, Two Pipelines
The CDK app defines one stack per stage,TelemetryDev and TelemetryProd, and each creates its own self mutating CodePipeline named TelemetryPipeline-{stage}.
The stage is the branch. The pipeline source is the GitHub repository connected through CodeConnections, and the branch it watches is the stage name itself. So
dev builds from the dev branch and prod builds from the prod branch. Merging to prod is the act of releasing.eu-west-2.
What A Run Does
A run has three parts, in order.1
Synth
Builds the Python Lambda bundles as a side input, then installs and synthesises the CDK app. The Lambda step installs each function’s
requirements.txt into its own folder and zips it, and the synth step copies those zips into build_assets/ before running cdk synth.2
ECR repositories, then the images
A stage creates the ECR repositories, and eight docker build steps then run after it, one per image. Each logs in to ECR, builds from its own context and Dockerfile, and pushes.
3
The application stack
Deploys the topic, queues, Lambdas and bucket notifications that make up the cloud side of the pipeline.
The Images
Eight images are built on every run, each pushed totelemetry/{image}-{stage} in ECR:
The first seven run on a track machine.
offloaded-data-converter is the odd one out: it is built from the same API project but deployed as the conversion Lambda in AWS, not to a track.
Tags
Each image is pushed twice, aslatest and as the resolved commit SHA of the run that built it.
That SHA tag is the only version handle in the system. The track scripts pull
latest, so the SHA is what lets you identify exactly what a track is running, and what you would pin to in order to go back.The Distribution Publish
The step that actually reaches the tracks is a one line sync:setup_application.bat at that track, which is normally once per event. See Getting An Update Onto The Machine.
So a merge to
prod never changes a track by itself. It changes what a track will pick up the next time someone runs setup there, which is why the same change can be live at one region and not another for weeks.What The Application Stack Creates
The cloud side is small: one topic, three queues and two Lambdas.
Both Lambdas run with 3008 MB and a 5 minute timeout.
The converter Lambda’s image tag is resolved at synth time from the build’s commit SHA, falling back to
latest. So the cloud converter is pinned to the exact image from its own pipeline run, unlike the track machines which always pull latest.Deploying By Hand
The pipelines are the supported route. The CDK app is a standard TypeScript project, sonpx cdk synth and npx cdk diff from CdkBuild/ are the way to see what a change would do before merging it.
Where Things Are Named
Everything is derived from the stage, so the whole estate can be located from it:Production ECR repositories are retained on stack deletion. Dev repositories are destroyed with the stack, as is the pipeline artifacts bucket in both stages.
Key Files
All paths are underCdkBuild/ in can-wifi.
