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

Do not tag intermediate images to allow for automatic pruning #60

Merged
merged 2 commits into from
Sep 13, 2019

Conversation

meyerj
Copy link
Contributor

@meyerj meyerj commented Sep 10, 2019

Docker images need to be cleaned up from time to time to not fill up the file system with obsolete images. This is typically done by running docker image prune or docker system prune. This command does not remove tagged images by default, unless called with -a. The latter is typically not what you want, because it also removes all the images pulled from Docker Hub or other remote registries.

In fact, there is no need for Rocker to assign tags to the intermediate images. The image IDs work just fine.

This patch also renders #52 obsolete.

…utomatic pruning

Docker images need to be cleaned up from time to time to not fill up the
file system with obsolete images. This is typically done by running
`docker image prune` or `docker system prune`. This command does not
remove tagged images by default.

In fact, there is no need for rocker to assign tags to the intermediate
images. The image IDs work just fine.
@tfoote
Copy link
Collaborator

tfoote commented Sep 11, 2019

The CI on this is failing on Python 3.5 https://travis-ci.org/osrf/rocker/jobs/583145753

$ xvfb-run nosetests --with-coverage --cover-package rocker --exclude test_nvidia_glmark2
E..EE.EEE......EEE.E.EE
======================================================================
ERROR: test_device (test_core.RockerCoreTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/osrf/rocker/test/test_core.py", line 92, in test_device
    self.assertEqual(dig.build(), 0)
  File "/home/travis/build/osrf/rocker/src/rocker/core.py", line 122, in build
    output_callback=lambda output: print("building > %s" % output)
  File "/home/travis/build/osrf/rocker/src/rocker/core.py", line 87, in docker_build
    image_id = match[1]
TypeError: '_sre.SRE_Match' object is not subscriptable
-------------------- >> begin captured stdout << ---------------------
Writing dockerfile to /tmp/tmp3y84_107/Dockerfile

The Match appears to only work with subscriptable elements in 3.6 and higher:
https://stackoverflow.com/questions/52404656/sre-sre-match-object-is-not-subscriptable

@codecov
Copy link

codecov bot commented Sep 13, 2019

Codecov Report

Merging #60 into master will increase coverage by 1.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   83.33%   84.49%   +1.15%     
==========================================
  Files           5        5              
  Lines         390      374      -16     
==========================================
- Hits          325      316       -9     
+ Misses         65       58       -7
Impacted Files Coverage Δ
src/rocker/nvidia_extension.py 89.04% <ø> (+1.71%) ⬆️
src/rocker/cli.py 20.45% <ø> (-0.38%) ⬇️
src/rocker/os_detector.py 94.11% <100%> (-0.48%) ⬇️
src/rocker/core.py 90.27% <100%> (+1.78%) ⬆️
src/rocker/extensions.py 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9420de4...0384efc. Read the comment docs.

Copy link
Collaborator

@tfoote tfoote left a comment

Choose a reason for hiding this comment

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

Thanks this is definitely cleaner. I fixed up the regex usage in python 3.5 to pass CI.

@tfoote tfoote merged commit f6d158e into osrf:master Sep 13, 2019
130s pushed a commit to plusone-robotics/rocker that referenced this pull request Apr 17, 2021
* Do not tag images with rocker-... or rocker__detection to allow for automatic pruning

Docker images need to be cleaned up from time to time to not fill up the
file system with obsolete images. This is typically done by running
`docker image prune` or `docker system prune`. This command does not
remove tagged images by default.

In fact, there is no need for rocker to assign tags to the intermediate
images. The image IDs work just fine.
@meyerj meyerj deleted the remove-image-tagging branch October 12, 2021 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants