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

mkcloud: improve image cache usage #3428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jdsn
Copy link
Member

@jdsn jdsn commented May 14, 2019

In order to prevent the image cache directory to fill up
the disk the cache should share its images with all jobs.
A 'per' job cache does not make sense for an image thats
just used once.

So the value of $cache_dir_default is now a shared directory
and no longer contains the cloud name.
To not break running deployments rsync needs to drop the
'inplace' parameter, so that it first syncs the new image
and then does a rename at the end.
This guarantees that

  1. there is always one consistent image to deploy from,
  2. no running jobs read from currupt files,
  3. the cache really caches for all jobs on the host.

In order to prevent the image cache directory to fill up
the disk the cache should share its images with all jobs.
A 'per' job cache does not make sense for an image thats
just used once.

So the value of $cache_dir_default is now a shared directory
and no longer contains the cloud name.
To not break running deployments rsync needs to drop the
'inplace' parameter, so that it first syncs the new image
and then does a rename at the end.
This guarantees that
1) there is always one consistent image to deploy from,
2) no running jobs read from currupt files,
3) the cache really caches for all jobs on the host.

The compress parameter can also be dropped because the image
files are already compressed. So we can save CPU cycles.
@jdsn jdsn force-pushed the better-cache-handling branch from 3562f8b to 9e622d3 Compare May 14, 2019 09:31
Copy link
Contributor

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

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

cache_dir isn't only used for images which can be shared, but also for repositories, which might have different content per cloudsource. This is the original reason why it was non-shared. We could have a shared images folder if thats your main concern.

@jdsn
Copy link
Member Author

jdsn commented May 14, 2019

Thanks for the hint, will rework the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants