impact-graph icon indicating copy to clipboard operation
impact-graph copied to clipboard

Improve deploy github action

Open aminlatifi opened this issue 1 year ago • 7 comments

From docker-compose up help

If there are existing containers for a service, and the service's configuration
or image was changed after the container's creation, `docker-compose up` picks
up the changes by stopping and recreating the containers (preserving mounted
volumes). To prevent Compose from picking up changes, use the `--no-recreate`
flag.

I noticed today docker-compose up recreates dockers if they are updated. We, in our deploy actions, use to bring docker-compose configuration down and up again. Single up command will be enough and reduces downtime probably.

aminlatifi avatar Aug 10 '23 09:08 aminlatifi

Can devops make it happen?

MoeNick avatar Aug 16 '23 11:08 MoeNick

Can devops make it happen?

Yeah, not big change but good to be noticed

aminlatifi avatar Aug 21 '23 11:08 aminlatifi

@aminlatifi Hey what is the exact problem?? Do you mean something is going wrong in the actions??

docker-compose up -d is intentional in our case in giveth-all deployment. In other words it's not a bug, it's a feature.

On the other hand, this is also meant to run as per service bases where it is necessary to pull the new images and recreate the container with the new image that is being pulled after a code push to github

mhmdksh avatar Aug 28 '23 13:08 mhmdksh

@aminlatifi Hey what is the exact problem?? Do you mean something is going wrong in the actions??

docker-compose up -d is intentional in our case in giveth-all deployment. In other words it's not a bug, it's a feature.

On the other hand, this is also meant to run as per service bases where it is necessary to pull the new images and recreate the container with the new image that is being pulled after a code push to github

I mean, the docker-compose -f <docker-compose file> down is not necessary. If we run the pull and up -d everything would be fine (it will recreate dockers with updated images) and we will have more service availability.

aminlatifi avatar Aug 28 '23 13:08 aminlatifi

@aminlatifi Hey what is the exact problem?? Do you mean something is going wrong in the actions?? docker-compose up -d is intentional in our case in giveth-all deployment. In other words it's not a bug, it's a feature. On the other hand, this is also meant to run as per service bases where it is necessary to pull the new images and recreate the container with the new image that is being pulled after a code push to github

I mean, the docker-compose -f <docker-compose file> down is not necessary. If we run the pull and up -d everything would be fine (it will recreate dockers with updated images) and we will have more service availability.

Yes, that's the normal behaviour, Thanks for the info man. We already took advantage of that in our giveth-all deployments :)

I think we can close this issue

mhmdksh avatar Aug 28 '23 13:08 mhmdksh

@aminlatifi Hey what is the exact problem?? Do you mean something is going wrong in the actions?? docker-compose up -d is intentional in our case in giveth-all deployment. In other words it's not a bug, it's a feature. On the other hand, this is also meant to run as per service bases where it is necessary to pull the new images and recreate the container with the new image that is being pulled after a code push to github

I mean, the docker-compose -f <docker-compose file> down is not necessary. If we run the pull and up -d everything would be fine (it will recreate dockers with updated images) and we will have more service availability.

Yes, that's the normal behaviour, Thanks for the info man. We already took advantage of that in our giveth-all deployments :)

I think we can close this issue

But we still have docker-compose stop impact-graph command https://github.com/Giveth/impact-graph/blob/8568a898b16731906d232902e4f733c1b0211ed9/.github/workflows/staging-pipeline.yml#L137C33-L137C33

Is it needed?

aminlatifi avatar Aug 28 '23 14:08 aminlatifi

GM, can someone update me that is it still valid?

MoeNick avatar Feb 06 '24 13:02 MoeNick

@aminlatifi Hey what is the exact problem?? Do you mean something is going wrong in the actions?? docker-compose up -d is intentional in our case in giveth-all deployment. In other words it's not a bug, it's a feature. On the other hand, this is also meant to run as per service bases where it is necessary to pull the new images and recreate the container with the new image that is being pulled after a code push to github

I mean, the docker-compose -f <docker-compose file> down is not necessary. If we run the pull and up -d everything would be fine (it will recreate dockers with updated images) and we will have more service availability.

Yes, that's the normal behaviour, Thanks for the info man. We already took advantage of that in our giveth-all deployments :) I think we can close this issue

But we still have docker-compose stop impact-graph command https://github.com/Giveth/impact-graph/blob/8568a898b16731906d232902e4f733c1b0211ed9/.github/workflows/staging-pipeline.yml#L137C33-L137C33

Is it needed?

@aminlatifi Yes this is exactly what is needed.

@MoeNick @divine-comedian Please close this issue, our deployments are running and updating fine for more than a year now

mhmdksh avatar Jun 25 '24 09:06 mhmdksh