Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Remove dangling docker layers #2017

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/docker-devito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
build-args: base=devitocodes/${{ matrix.base }}

- name: Remove dangling layers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the impression this was happening already, ok

run: docker system prune -f

- name: Run tests
run: |
docker run ${{ matrix.flag }} --rm --name testrun 'devitocodes/devito:${{ matrix.tag }}-dev' pytest ${{ matrix.test }}
5 changes: 4 additions & 1 deletion .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ jobs:

- name: Build docker image
run: |
docker build . --pull --file docker/Dockerfile.devito --tag devito_img --build-arg base=${{ matrix.base }}
docker build . --rm --pull --file docker/Dockerfile.devito --tag devito_img --build-arg base=${{ matrix.base }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't --rm a run option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a build too -- it removes the dangling layers!


- name: Remove dangling layers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why is it needed again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~300 GB of layers on v1003 and counting, which I purged manully for now

if we pushed too much in a good week before docker-build kicks in (which does purge IIRC), we might end up saturating the hard drive

though now that I think about it, that's weird, the base image shouldn't get rebuilt each time... mh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is ~300 GB of layers then there is something else going on probably due to

  • cancelled workflow
  • Dev on the machine

So this may "fix" some of it but it should be safer to have the actual machine have a safety cron job with that

run: docker system prune -f

- name: Test with pytest
run: |
Expand Down