Prep for PROD ECS - #16651
Conversation
| new RenderingCDKStack( | ||
| cdkApp, | ||
| 'TagPageRendering-PROD', | ||
| getTagPageRenderingPropsPROD(process.env.IMAGE_DIGEST), |
There was a problem hiding this comment.
This is the biggie. This will trigger a deployment including ECS
akash1810
left a comment
There was a problem hiding this comment.
IIUC this PR, ultimately, adds a CDK snapshot test for the current state of tag-page-rendering PROD? If so, could we can make the diff smaller to make this more accessible for future travellers? For example, I don't think we need to convert from a const to a function?
| instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.SMALL), | ||
| imageIdentifier: process.env.IMAGE_DIGEST ?? 'DEV', | ||
| }; | ||
| export function getTagPageRenderingPropsCODE( |
There was a problem hiding this comment.
Why are we converting to a function here?
There was a problem hiding this comment.
I wanted to make it possible to synth with and without process.env.IMAGE_IDENTIFIER in two tests so I could compare the outputs, and so we could switch in and out with confidence.
In the end I think I only added one test for PROD though! I can go back and add the other test OR just tear it out if we are confident this is the direction of travel.
There was a problem hiding this comment.
I wanted to make it possible to synth with and without process.env.IMAGE_IDENTIFIER in two tests so I could compare the outputs, and so we could switch in and out with confidence.
I think that's already possible via the imageIdentifier property being an optional string within RenderingCDKStackProps? As we're falling back to DEV, I'm not sure the second test works as expected?
🚀 Image pushed to AWS ECRImage digest: 🐛 Run the image locallyThe following can be used to run the image locally: # Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:784755d244a1514824b47c2d1cb445a527ea51659ec44843fa74277cd063a7da"
# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-jr-prep-for-prod-ecs"
# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-30801"
# Refer to image via the GitHub commit SHA tag
# IMAGE_IDENTIFIER=":sha-b06c2f157b59e0bbba37e103a37c37bac5736a00"
# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"
IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/deployTools --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering${IMAGE_IDENTIFIER}"
# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY
# Pull the image
docker pull $IMAGE
# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE |
67bb56a to
c9a5d27
Compare
c9a5d27 to
b06c2f1
Compare
What does this change?
This PR adds ECS capability to the PROD tag rendering nodes, and expands testing to cover with and without ECS.
Why?
How has this change been tested?
Screenshots