Add a way to set a timeout for abra deploy #437

Closed
opened 2023-03-22 14:10:36 +00:00 by moritz · 3 comments
Member

Per default abra deploy waits until every container returns a healthy state.
But after a fixed timeout of 50s it will abort.
Many applications need much more time to come up, therefore it would be good to specify a timeout for each app.
I think the compose file could be a good place to specify the timeout, so it will be bound to the application and it won't clutter the .env even more.

Per default `abra deploy` waits until every container returns a healthy state. But after a fixed timeout of 50s it will abort. Many applications need much more time to come up, therefore it would be good to specify a timeout for each app. I think the compose file could be a good place to specify the timeout, so it will be bound to the application and it won't clutter the .env even more.
moritz added the
enhancement
label 2023-03-22 14:10:36 +00:00
Owner

Excellent idea @moritz!

I've tried to experiment with those timeout values quite a bit and they vary heavily according to app but also according to the machine you're deploying to. It's hard to get a correct balance but I agree that the naive 50 seconds could really be improved.

Keycloak, for example, often needs much more time no matter the machine.

Are you thinking about a global traefik flag on the recipes or another type of label like https://docs.docker.com/compose/compose-file/compose-file-v3/#labels-1? I don't think there is an existing timeout key we can use in the Compose spec? I only see one in healthcheck.

Excellent idea @moritz! I've tried to experiment with those timeout values quite a bit and they vary heavily according to app but also according to the machine you're deploying to. It's hard to get a correct balance but I agree that the naive 50 seconds could really be improved. Keycloak, for example, often needs much more time no matter the machine. Are you thinking about a global traefik flag on the recipes or another type of label like https://docs.docker.com/compose/compose-file/compose-file-v3/#labels-1? I don't think there is an existing `timeout` key we can use in the Compose spec? I only see one in `healthcheck`.
Author
Member

I thought about a label like coop-cloud.${STACK_NAME}.timeout=120 this could easily be read by abra to set a custom timeout.

I thought about a label like `coop-cloud.${STACK_NAME}.timeout=120` this could easily be read by abra to set a custom timeout.
Owner

@moritz oh nice, should we maybe do coop-cloud.${STACK_NAME}.timeout=${TIMEOUT} and have TIMEOUT=... option in the .env file? If this isn't detected, then we default to 50 seconds? Then it's configurable which I think could be important for a long-term solution because the timeout depends on the capacity of the hardware to get the app up and that will always be different. So, e.g. a raspberry pi deploying a keycloak (could be like 2 mins) vs. a powerful desktop machine (could be 1 min).

@moritz oh nice, should we maybe do `coop-cloud.${STACK_NAME}.timeout=${TIMEOUT}` and have `TIMEOUT=...` option in the `.env` file? If this isn't detected, then we default to 50 seconds? Then it's configurable which I think could be important for a long-term solution because the timeout depends on the capacity of the hardware to get the app up and that will always be different. So, e.g. a raspberry pi deploying a keycloak (could be like 2 mins) vs. a powerful desktop machine (could be 1 min).
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#437
No description provided.