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

Cache source artifacts #992

Merged
merged 3 commits into from
May 11, 2020

Conversation

danielmitterdorfer
Copy link
Member

With this commit we add a cache for source artifacts. It can be enabled
by setting cache = true in the source section of rally.ini.
Caching works based on the specified revision. We don't implement an
eviction policy for now but assume that an external process cleans up
cached artifacts.

With this commit we add a cache for source artifacts. It can be enabled
by setting `cache = true` in the `source` section of `rally.ini`.
Caching works based on the specified revision. We don't implement an
eviction policy for now but assume that an external process cleans up
cached artifacts.
@danielmitterdorfer danielmitterdorfer added enhancement Improves the status quo :Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch labels May 11, 2020
@danielmitterdorfer danielmitterdorfer added this to the 2.0.1 milestone May 11, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this May 11, 2020
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Looks and works great!

I left a question.

# this can be None if the Elasticsearch does not reside in a git repo and the user has only
# copied all source files. In that case, we cannot resolve a revision hash and thus we cannot cache.
if self.cached_path:
shutil.copy(original_path, self.cached_path)
Copy link
Contributor

@dliappis dliappis May 11, 2020

Choose a reason for hiding this comment

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

What if there is some issue, out of disk space, file in use etc? Should we catch IOError, log it, and fallback to no caching?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I've pushed 937595e.

Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM

@danielmitterdorfer danielmitterdorfer merged commit bd2749e into elastic:master May 11, 2020
@danielmitterdorfer danielmitterdorfer deleted the source-cache branch May 11, 2020 13:50
danielmitterdorfer added a commit to danielmitterdorfer/rally that referenced this pull request May 13, 2020
With this commit we create the artifact cache directory if it does not
exist yet. Otherwise, the artifact cannot be cached making the cache
ineffective.

Relates elastic#992
danielmitterdorfer added a commit that referenced this pull request May 13, 2020
With this commit we create the artifact cache directory if it does not
exist yet. Otherwise, the artifact cannot be cached making the cache
ineffective.

Relates #992
danielmitterdorfer added a commit to danielmitterdorfer/rally that referenced this pull request May 20, 2020
With this commit we add the artifact cache introduced by elastic#992 also for
plugins and implement a cache cleanup mechanism that cleans up artifacts
after seven days by default (can be configured with `cache.days`). As
artifact caching can now replace the pipeline `from-sources-skip-build`
we deprecate it along with `from-sources-complete` and introduce a new
pipeline `from-sources` instead.
danielmitterdorfer added a commit that referenced this pull request May 25, 2020
With this commit we add the artifact cache introduced by #992 also for
plugins and implement a cache cleanup mechanism that cleans up artifacts
after seven days by default (can be configured with `cache.days`). As
artifact caching can now replace the pipeline `from-sources-skip-build`
we deprecate it along with `from-sources-complete` and introduce a new
pipeline `from-sources` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Benchmark Candidate Management Anything affecting how Rally sets up Elasticsearch enhancement Improves the status quo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants