1

I my .ebextensions/00.command.config, I have:

container_commands:
  00_download_models:
    command: "./download.py"

In download.py, I have some code that downloads a lot of files (around 20GB). That takes time and I'd like that to finish before Elastic Beanstalk attempts to boot my app. But in /var/log/web.stdout.log, I see:

Jun 27 19:42:46 ip-172-31-46-211 web: [2020-06-27 19:42:46 +0000] [3997] [INFO] Worker exiting (pid: 3997)
Jun 27 19:42:46 ip-172-31-46-211 web: Loading generator
Jun 27 19:42:46 ip-172-31-46-211 web: using device: cpu

Loading generator is what I print in my application.py. This is a flask app, if that matters. It appears to attempt to restart the app multiple times while downloading.

What can I do to first finish download.py, THEN attempt to start the app?

Shamoon
  • 41,293
  • 91
  • 306
  • 570
  • 20GB dependencies will slow down everything. I think you should consider creating custom AMI with all these dependencies, or at least attempt to put them in S3 and download from S3. – Marcin Jun 27 '20 at 22:06
  • They are being downloaded from S3 – Shamoon Jun 27 '20 at 23:06
  • How long does it take to download them if you do it manually? Your EB setup maybe timing out? – Marcin Jun 27 '20 at 23:34
  • Maybe 20 or so min? – Shamoon Jun 27 '20 at 23:36
  • If you check [here](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elasticbeanstalkcommand), the default timeout is 600 seconds (10 minutes). Have you increased it? – Marcin Jun 27 '20 at 23:41

1 Answers1

1

In EB, you can disable health checks during deployments. For example in console you can do this as shown in the screenshot:

enter image description here

Obviously, you can also do it form CLI if you use it for deployments.

They still may show as unhealthy, but won't lead to failed deployments.

Marcin
  • 215,873
  • 14
  • 235
  • 294