-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize make up command: (#22938)
- Updated docker-compose files to use named volumes instead of bind mounts for better portability and consistency. - Introduced a new healthcheck script to monitor the status of the Celery worker and web service. - Removed deprecated healthcheck configurations from services in docker-compose.yml. - Adjusted Makefile to better separate the up recipe and include new healtch check in initialize recipe - Cleaned up Dockerfile by linking package.json and package-lock.json to the correct paths.
- Loading branch information
Showing
9 changed files
with
152 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
import time | ||
|
||
|
||
env = os.environ.copy() | ||
|
||
env['DJANGO_SETTINGS_MODULE'] = 'olympia' | ||
|
||
|
||
def worker_healthcheck(): | ||
subprocess.run( | ||
['celery', '-A', 'olympia.amo.celery', 'status'], | ||
env=env, | ||
stdout=subprocess.DEVNULL, | ||
) | ||
|
||
|
||
def web_healthcheck(): | ||
subprocess.run( | ||
[ | ||
'curl', | ||
'--fail', | ||
'--show-error', | ||
'--include', | ||
'--location', | ||
'--silent', | ||
'http://127.0.0.1:8002/__version__', | ||
], | ||
stdout=subprocess.DEVNULL, | ||
) | ||
|
||
|
||
TIME = time.time() | ||
TIMEOUT = 60 | ||
SLEEP = 1 | ||
|
||
while time.time() - TIME < TIMEOUT: | ||
try: | ||
worker_healthcheck() | ||
web_healthcheck() | ||
print('OK') | ||
sys.exit(0) | ||
except Exception as e: | ||
print(f'Error: {e}') | ||
time.sleep(SLEEP) | ||
SLEEP *= 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters