atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Docker Image doesn't work properly

Open thundersoft90 opened this issue 10 months ago • 1 comments

Hi,

When I use or build docker image of your code. I encountered errors in main_static_data branch while I was building image and in both branches when I use docker compose up command.

When I use docker compose file to run containers. Containers are downloaded but run for 1 or 2 seconds and exists automatically. Only certbot container continues to work.

When I inteded to run docker image of atlas_app I recieve error as

File "/usr/local/lib/python3.12/site-packages/gunicorn/arbiter.py", line 525, in reap_workers raise HaltServer(reason, self.WORKER_BOOT_ERROR) gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> And for the main_static_data branch i doesn't build and run the image at all. I have also uploaded some screenshots that display the error I recieved.

Would you please suggest me some solutions to get rid of these errors.

Thanks in Advance,

Image Image Image

thundersoft90 avatar Feb 15 '25 12:02 thundersoft90

Hi thundersoft. Welcome to world of pain that is trying to maintain this project with such a large number of dependencies that keep breaking things. You've highlighted a few issues and I've just done some quick fixes and should have an option that can at least get something running on your local pc. Bottom line is I did a big update to Python3.12 to fix some dependency issues with the packages the app needs, and I did not go back and fix these for the older main_static_data branch. I've now partially done that.

Assuming you are using Linux Ubuntu 22.04 which is what I'd recommend.

Main branch will be of no use to you (unfortunately)

The reason the app container goes down immediately after startup via docker-compose is because it's trying to load Azure credentials from a .env file that will not exist on your machine. This is used by the new version of the app to connect to Azure Blob and pull the processed parquet files at run-time from the cloud, which is a major technical upgrade I've recently done. It will not be able to find the creds and so it crashes immediately. In production, this works ok as I inject these secrets as part of the build, but of course I do not want to share my Azure creds so this makes the main branch really difficult for others to use. I'm thinking about a way to make this better, and might just keep a copy of the processed master dataset on the main branch with an option flag to use it (so no Azure creds are required). But not there just yet.

Docker-compose is also painfully complicated as it brings up 4 containers (certbox, the app itself, nginx reverse proxy, and datadog agent). These are really only needed in production so there are some simpler ways to just run the app itself.

Main_static_data branch fixes applied

  • This is what you'd really want to work with. It's an older branch where all the datasets are stored in the repo, and a fully processed master dataset is available to be read in by the main app at run-time. data_lakehouse/titanium/
  • I've just pushed a few fixes to the requirements.txt and Dockerfile to support Python3.12 (needed due to dependency issues) and I've updated the readme on this branch to (now correctly) reflect the steps to follow.
  • The simplest way is to get the app up is to run the wsgi.py entrypoint file directly, although you'd need Python3.12 running on your local machine. On Ubuntu, the readme now has steps to follow to do this and after you've installed all the packages in requirements.txt you can just run the app with python3.12 wsgi.py
  • The Dockerfile also now works, and does not require you have Python3.12 installed locally, as it uses an image that already has this version of Python. i.e. sudo docker build . --tag atlas_app then sudo docker run -dp 80:8050 atlas_app will now work.
  • This should allow you to run the app itself directly on your local machine and I've just confirmed it starts up, reads in the data and runs. Unfortunately the main map is not displaying correctly for continous datasets, although it works for categoricals like fun-facts 'electricity plug voltage' or 'which side of the road to they drive' The bar chart is screwy but the line chart works. Something has been fucked due to dependencies and breaking changes as it used to work perfectly.
  • I dont have time at the moment to look into it in more detail (sorry!) but just wanted to give you something that would actually run. Hope that helps :)

Cheers, Dan.

danny-baker avatar Feb 15 '25 20:02 danny-baker