Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New platform branch to support ECS-based docker running on AL2 #163

Closed
equivalent opened this issue Apr 12, 2021 · 4 comments
Closed

New platform branch to support ECS-based docker running on AL2 #163

equivalent opened this issue Apr 12, 2021 · 4 comments

Comments

@equivalent
Copy link

equivalent commented Apr 12, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or "me too" comments. They generate extra noise for issue followers and do not help prioritize the request.

Tell us about your request

in Multicontainer Docker platform (Amazon Linux AMI) there was an option to provide essential in Dockerrun.aws.json so that entire EB docker run script re triggers if essential container fails.

Example :

{
  "AWSEBDockerrunVersion": 2,

  "containerDefinitions": [
    {
      "name": "background-worker",
      "image": "my-company/my-bg-worker-app",
      "essential": true
    },
    {
      "name": "health_check_nginx",
      "image": "equivalent/health_check_nginx",
      "portMappings": [
        {
          "hostPort": 80,
          "containerPort": 80
        }
      ]
    }
  ]
}

form health_check_nginx_docker

Now that I've switched to Docker Amazon Linux 2 and docker-compose.yml there is no option for me to specify which containers are essential (docker steps for EB should restart)

Yes docer-compose.yml provides depends_on but this will not prompt EB to restart the cycle to try re-up the containers as it was in Multicontainer Docker Platform with Dockerrun file

---
version: '3'
services:
  healthcheck:
    image: equivalent/health_check_nginx
    ports:
      - '80:80'
    depends_on:
      - worker
  worker:
    image: myprivateapplicationworker
    environment:
      ROLE: 'worker'
    env_file:
      - .env

Nothing will happen if worker container dies

thing to consider

one way to solve this globally for all EB Linux 2 platforms would be to use docker-compose up --abort-on-container-exit (as mentioned in this stack overflow issue ) but that may not be the best for all use cases of all EB applications

@equivalent equivalent changed the title EB Docker Amazon Linux 2* specify essential containers in docker-compose.yml EB Docker Amazon Linux 2 - specify essential containers in docker-compose.yml Apr 12, 2021
@equivalent
Copy link
Author

equivalent commented May 20, 2021

ok here is another scenario that makes EB Docker Amazon Linux 2 inferior for production apps due to missing the essential option

given I have docker-compose.yml file with just one container running
when I kill that container (E.g. memory issue)
then instance will not restart the container

with Multicontainer Docker Platform if I specify "this docker container is essential" if it dies the EB agent would try to restart it which helps a lot if dev-ops person is not available immediately when error happens (many times this feature saved me during a holiday). In my opinion this was the best feature of AWS EB.

@AvihaiSam
Copy link

ok here is another scenario that makes EB Docker Amazon Linux 2 inferior for production apps due to missing the essential option

given I have docker-compose.yml file with just one container running
when I kill that container (E.g. memory issue)
then instance will not restart the container

with Multicontainer Docker Platform if I specify "this docker container is essential" if it dies the EB agent would try to restart it which helps a lot if dev-ops person is not available immediately when error happens (many times this feature saved me during a holiday). In my opinion this was the best feature of AWS EB.

I've seen that on AL1 as well...
usually I open a ticket once a month for that...

@1tonyca
Copy link

1tonyca commented Nov 4, 2021

Thanks for bringing this back to our attention.

For customers who prefer to use docker-compose to ensure container running after it was killed, please consider adding restart policy in your docker-compose.yml, more details are here

For customers who prefer essential parameter that is supported by ECS, we are currently working on a new platform branch to support ECS-based docker running on AL2, so it would be simpler port for environments running on Multicontainer docker platform

@1tonyca 1tonyca removed the Proposed label Jan 4, 2022
@1tonyca 1tonyca changed the title EB Docker Amazon Linux 2 - specify essential containers in docker-compose.yml New platform branch to support ECS-based docker running on AL2 Jan 4, 2022
@1tonyca
Copy link

1tonyca commented Mar 26, 2022

https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2022-03-25-ecsal2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Just Shipped
Development

No branches or pull requests

3 participants