By using AWS re:Post, you agree to the Terms of Use

Questions tagged with AWS CodeDeploy

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

how to deploy an ecs service with a task definition that has 2 images with blue green deployment?

I had configured CodePipeline with CodeBuild and ECS blue green as an action provider to deploy my ECS service. In my buildspec.yml I created imageDetail.json like this ``` {"ImageURI": "imageid"}. ``` This setup was working fine when my task definition had only one image. Now my task definition has two images where one image depends from the other so I changed my buildspec.yml to create an imageDetail.json like this: ``` [{"ImageURI":"image1"}, {"ImageURI":"image2"}] ``` When configuring the pipeline with codebuild and ECS blue green deploy with this new task definition and imageDetail.json that has 2 images it is throwing the following error: "Exception while trying to parse the image URI file from the artifact: BuildArtifact." Then I tried doing this same setup but with ECS (rolling update) as an action provider instead of ECS blue green and it worked. With ECS (rolling update) as an action provider I needed to create an imagedefinitions.json instead of an imageDetail.json. The imagedefinitions.json created in buildspec.yml looks like this: ``` [{"name":"name1","imageUri":"image1"}, {"name":"name2","imageUri":"image2"}] ``` However, I want to use ECS blue green as an action provider where I need to create an imageDetail.json in the buildspec.yml file. So, can I create an imageDetail.json with two images like in imagedefinitions.json? I also made the same question here: https://stackoverflow.com/questions/73947923/how-to-deploy-an-ecs-service-with-a-task-definition-that-has-2-images-with-blue
0
answers
0
votes
2
views
asked 9 minutes ago

How to install playwright in elastic beanstalk via .ebextensions?

I need to install [Playwright](https://playwright.dev/docs/ci#introduction) in my Elastic beanstalk. So, I am using this command in `.ebextensions` `.ebextensions/01_install_playwright.config` ``` container_commands: install_playwright: command: "npx playwright install --with-deps chromium" ``` But it's getting error out. Here are the logs from cfn-init.log - ``` 2022-09-29 05:16:17,188 [INFO] -----------------------Starting build----------------------- 2022-09-29 05:16:17,194 [INFO] Running configSets: Infra-EmbeddedPostBuild 2022-09-29 05:16:17,197 [INFO] Running configSet Infra-EmbeddedPostBuild 2022-09-29 05:16:17,200 [INFO] Running config postbuild_0_test_worker 2022-09-29 05:16:18,246 [ERROR] Command install_playwright (npx playwright install --with-deps chromium) failed 2022-09-29 05:16:18,246 [ERROR] Error encountered during build of postbuild_0_test_worker: Command install_playwright failed Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 576, in run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 276, in build self._config.commands) File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply raise ToolError(u"Command %s failed" % name) cfnbootstrap.construction_errors.ToolError: Command install_playwright failed 2022-09-29 05:16:18,247 [ERROR] -----------------------BUILD FAILED!------------------------ 2022-09-29 05:16:18,247 [ERROR] Unhandled exception during build: Command install_playwright failed Traceback (most recent call last): File "/opt/aws/bin/cfn-init", line 176, in <module> worklog.build(metadata, configSets) File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 137, in build Contractor(metadata).build(configSets, self) File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 564, in build self.run_config(config, worklog) File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 576, in run_config CloudFormationCarpenter(config, self._auth_config).build(worklog) File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 276, in build self._config.commands) File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply raise ToolError(u"Command %s failed" % name) cfnbootstrap.construction_errors.ToolError: Command install_playwright failed ``` Am I missing something or any suggestion on how to run the npx command on .ebextensions. I also [posted on SO](https://stackoverflow.com/questions/73890683/how-to-install-playwright-dependency-in-elastic-beanstalk-ebextensions) but didn't see any response. While everything is working fine on code pipeline using buildspec.yml and same command ``` phases: install: runtime-versions: nodejs: 16 #nodejs: latest pre_build: commands: - echo Installing source NPM dependencies... - npm install - echo Installing Chromium... - npx playwright install --with-deps chromium ```
0
answers
0
votes
12
views
asked 4 days ago

Automatically stop CodeDeploy ECS Blue/Green deployment on unhealthy containers

We are writing a CI/CD setup where we remotely trigger a CodePipeline pipeline which fetches its task definition and appspec.yaml from S3 and includes a CodeDeploy ECS Blue/Green step for updating an ECS service. Images are pushed to ECR also remotely. This setup works and if the to-be-deployed application is not faulty and well configured the deployment succeeds in under 5 minutes. However, if the application does not pass health checks, or the task definition is broken, CodeDeploy will continuously re-deploy this revision during its "Install" step without end, creating tens of stopped tasks in the ECS Service. According to some this should time out after an hour, however we have not tested this. What we would like to achieve is automatic stops and rollbacks of these failing deployments. Ideally CodeDeploy should try only once to deploy the application and if that fails, immediately cancel the deployment and thus the pipeline run. According to the AWS documentation no options for this exist in CodeDeploy or the appspec.yaml that we upload to S3, so we are unsure of how to configure this if it is at all possible. We had two wanted scenarios in mind: 1. After one health check failure, the deployment stops and rolls back; 2. The deployment times out after a period shorter than one hour; ideally < 10 minutes. We currently have no alarms attached to the CodeDeploy deployment group, but it was my understanding that these alarms only trigger before the installation step to verify that the deployment can proceed instead of running alongside the deployment. In short; how would we configure either of those scenarios or at least prevent CodeDeploy from endlessly deploying replacement task sets?
0
answers
0
votes
17
views
asked 5 days ago

CodeBuild Bug? AWS CLI broken on AL2/aarch64 env, error "pyenv: version `3.9.7' is not installed"

## Summary: On CodeBuild projects running on AL2/aarch64, running the `aws` CLI command (any command works, I use `--version` as a sanity check) yields the following error: ``` [Container] 2022/09/10 02:39:37 Running command aws --version pyenv: version `3.9.7' is not installed (set by /codebuild/output/src576940877/src/.python-version) ``` The process exits with status code 1 and the build terminates. I can reproduce the error exactly on my M1 MBP running locally, following the instructions for local agent usage [here](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html). ## Steps to Reproduce 1. Create minimal buildspec.yml: ```yml version: 0.2 phases: build: commands: - aws --version ``` 2. Launch on CodeBuild project set to AL2/aarch64, on SMALL size build. ## Expected behavior Build should pass. Output of command should be: ``` [Container] 2022/09/10 03:00:41 Running command /usr/local/bin/aws --version aws-cli/2.7.31 Python/3.9.11 Linux/5.10.104-linuxkit exe/aarch64.amzn.2 prompt/off ``` ## Actual behavior Output is actually: ``` [Container] 2022/09/10 02:39:37 Running command aws --version pyenv: version `3.9.7' is not installed (set by /codebuild/output/src576940877/src/.python-version) ``` ## Workaround The AWS CLI can be installed manually and run via direct path: ``` version: 0.2 phases: install: runtime-versions: python: 3.9 commands: - curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - ./aws/install build: commands: - /usr/local/bin/aws --version ``` This produces the expected output and the build succeeds.
0
answers
0
votes
21
views
asked 24 days ago

Why are we getting a temporary failure in name resolution for one of our codedeploy jobs.

We've double checked our resolv.conf settings and confirmed DNS is working on the instance. Are we hitting some kind of DNS quota here? https://us-west-1.console.aws.amazon.com/codesuite/codedeploy/deployments/d-DK3X9YR2J?region=us-west-1 ``` [stderr]error pulling image configuration: Get https://prod-us-west-1-starport-layer-bucket.s3.us-west-1.amazonaws.com/f3ebb4-118139069697-febca158-fcb4-8691-5416-12213ec5f233/09333ef6-c54b-402e-bdbe-a506aae50ad8?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJX%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLXdlc3QtMSJGMEQCIDvxxOc2QHUZICVPv8z4JcO9guj9TFhOHz%2BhFNFcJ3xnAiBIxXYH%2BfSfjKa5Qfy27sX3THps6binPSUWk0GDEsU%2FcSrAAwguEAMaDDY0MTkwMjM0NjY5NCIMMiTs4I8IsHhsS7kjKp0DekQoQzo9dMIxxuZwbRVYz2K7odpA0iNNaT2Wyz1gKWNGCHhL1ofyMrt0INEQ9VsPpQ0rV357OmZgR1h2WZDX7cpmbRDkY9vBafNwwhsVI3yACmvQI%2BnBbZPQn2cL2sbBUu1CYOegiFm0R4VgZKJ6ofx%2B3kfDTR5FO6rBouF0GXkc2MSbn%2BLnIYvfJSFMj7E19CmGZxDCOj2HnK3cEDba2pMNjSxAc9YQBgyVEtC%2Faz7rZ7FiFE2CgNQrxifxVUaIRdNDSzLtdkDPX3OQP85rQODTsFSz8lhQOKy8U7XqVbILRQKxzOnrKZiaChMhyO1m3rkUE9DuPO7t%2F473QQuPDB6o%2B2OavSdlylDvsA6aJdcy%2B6rAaylirvQ5734f2Qy81Ek7nbwPq2dw4%2BSx7Sw8XPzVADXWz%2Fv%2BAics2Wk0nX01rz3psYH4BbDGNMSLEWzORzdqiDq5O1vPHTtfHul%2FtyeeVRULtIb2XHc8ms2%2FWd88DBHonBAgnzjO0GVi9Jgldd5ff7jt6sfeVuA%2BwCZes%2BkqPVDr0JRcTiSvCkww%2B8jnmAY6ogECc3hG9IbK8NDsMSvjW5unt5iaJaqLH9NvAAS1DXKWhkz8DS36MW4rM65NMwD2Fn3NfyGaVRZIQ7iHKM%2F4ksUpQxi68ObptEQjbE4di%2FkMOyH%2BZxuFq%2BskEMNvwTKDYcBClpi8UphJdxLqqXVfAithlYGd7GL2row%2FIzom9xMO9tUY5paxq6Bm%2BnAim2KPtS%2FwSWqhg5R3dMSAB%2FGysZY6efU%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220908T135103Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAZK5C4QHDIWPJ2TM5%2F20220908%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Signature=e66c322896f64ba188ce5bd2f171cfb1e7dc014f2be30ab93a6a600db7e28f7b: dial tcp: lookup prod-us-west-1-starport-layer-bucket.s3.us-west-1.amazonaws.com: Temporary failure in name resolution ```
1
answers
0
votes
20
views
asked a month ago
0
answers
0
votes
15
views
asked a month ago