chore: manage docker bloat on deployments#1981
Conversation
automatically prune old images and raise warnings for dangling volumes and exited containers on GitHub Actions workflow deployments. Closes kernelci#1918 Signed-off-by: Luiz Georg <luiz.georg@profusion.mobi>
| git checkout ${GITHUB_SHA} && | ||
| docker compose -f docker-compose-next.yml pull && | ||
| docker compose -f docker-compose-next.yml up -d | ||
| docker compose up --pull=always --remove-orphans --detach && |
There was a problem hiding this comment.
why are we changing the docker compose file here?
Shouldn't we be pointing to docker-compose-next.yml?
| cd dashboard-staging && | ||
| git checkout ${GITHUB_SHA} && | ||
| docker compose down && | ||
| docker compose build --no-cache && |
There was a problem hiding this comment.
Even with the policy of always pulling, isn´t it safer to build with no-cache here?
| env: | ||
| SSH_HOSTKEY: ${{ secrets.STAGING_HOSTKEY }} | ||
|
|
||
| - name: Deploy production |
There was a problem hiding this comment.
I am just starting a discussion, do not take it as the best approach.
Wouldn´t it be better to leave the docker prune as a separate step here?
This way could even make it as an optional step, and if the cleanup fails the deploy process can still take place. Or would be better to fail imediatelly in such case?
There was a problem hiding this comment.
Also, should we also remove docker builder cache? docker builder prune -f --filter "until=48h"
There was a problem hiding this comment.
I tried to avoid opening a second SSH connection, a separate step is indeed better. I moved them to another job altogether, so the status of the deployment job actually means whether deployment happened.
d88f321 to
d8862dc
Compare
Signed-off-by: Luiz Georg <luiz.georg@profusion.mobi>
d8862dc to
d8bf89b
Compare
|
@nuclearcat can you take a look at this? It would affect docker system-wide for staging, staging-db and production |
automatically prune old images and raise warnings for dangling volumes and exited containers on GitHub Actions workflow deployments.
Closes #1918