Skip to content

Commit f1ff57b

Browse files
committed
Raise error before jobs getting stuck in CREATING STACK cfn-airflow-flower
If your job is stuck here for more then 10 minutes, you probably have an issue with your deployment. The main causes for this is ECS tasks not being able to find the image definition on ECR, possibly caused by an autentication error between Docker and ECR. Now if there was an issue while pushing the image, we will raise an error instead of continuing deployment.
1 parent b83894b commit f1ff57b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

deploy_docker.py

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
IMAGE_TAG = 'latest'
1717

1818

19+
class DockerException(Exception): pass
20+
21+
1922
def connect_to_ecr():
2023
client = boto3.client('ecr')
2124
token = client.get_authorization_token()
@@ -47,6 +50,10 @@ def tag_and_push_to_ecr(image, tag):
4750
ecr_repo_name = '{}/{}'.format(registry.replace('https://', ''), ECR_REPO_NAME)
4851
image.tag(ecr_repo_name, tag)
4952
push_log = docker_client.images.push(ecr_repo_name, tag=tag)
53+
54+
if 'errorDetail' in push_log:
55+
logging.error(push_log)
56+
raise DockerException()
5057
logging.info(push_log)
5158

5259

service.yml

-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ metadataDb:
9797
parameters:
9898
maxConnections: 100
9999

100-
101-
102100
celeryBackend:
103101
port: 6379
104102
azMode: single-az

0 commit comments

Comments
 (0)